MTva : Petit ajout
This commit is contained in:
parent
e9a011cecf
commit
fbf5602231
@ -85,10 +85,10 @@ class Metier_Partenaires_MTva
|
||||
$dateRef->sub(new DateInterval('P6M'));
|
||||
$dateMaj = DateTime::createFromFormat('Ymd', $tab['DateMAJ']);
|
||||
$this->vatNumber = "FR".$this->cle.$this->siren;
|
||||
if ($cle !== null) {
|
||||
if ($cle !== null | $cle != 0) {
|
||||
$this->vatDefined = true;
|
||||
return true;
|
||||
} elseif ($cle === null && $dateMaj >= $dateRef) {
|
||||
} elseif (($cle === null || $cle == 0) && $dateMaj >= $dateRef) {
|
||||
$this->vatDefined = false;
|
||||
return true;
|
||||
}
|
||||
@ -146,8 +146,8 @@ class Metier_Partenaires_MTva
|
||||
'traderStreet' => "",
|
||||
'traderPostalCode' => "",
|
||||
'traderCity' => "",
|
||||
'requesterMemberStateCode' => "",
|
||||
'requesterNumber' => "",
|
||||
'requesterMemberStateCode' => "FR",
|
||||
'requesterNumber' => $this->cle.$this->siren,
|
||||
'action' => "check",
|
||||
'check' => "Vérifier",
|
||||
],
|
||||
@ -160,11 +160,11 @@ class Metier_Partenaires_MTva
|
||||
if (preg_match('/Yes, valid VAT number/i', $body)
|
||||
|| preg_match('/Oui, numéro de TVA valide/i', $body)) {
|
||||
if ($exist) {
|
||||
$this->conn->update('sdv1.siren_tva', array('cle' => $this->cle,
|
||||
$this->conn->update('sdv1.siren_tva', array('cle' => intval($this->cle),
|
||||
'duree' => $time), array('siren' => $this->siren));
|
||||
} else {
|
||||
$this->conn->insert('sdv1.siren_tva', array('siren' => $this->siren,
|
||||
'cle' => $this->cle, 'duree' => $time));
|
||||
'cle' => intval($this->cle), 'duree' => $time));
|
||||
}
|
||||
$this->vatNumber = "FR".$this->cle.$this->siren;
|
||||
$this->vatDefined = true;
|
||||
|
Loading…
Reference in New Issue
Block a user