Merge pull request #20550 from ATM-Consulting/FIX_16.0_deprecate_amount_field_on_facture_fourn

Fix 16.0 deprecate amount field on facture fourn?
This commit is contained in:
Laurent Destailleur 2022-04-07 14:06:38 +02:00 committed by GitHub
commit 01f11ff5f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -79,6 +79,11 @@ class FactureFournisseurRec extends CommonInvoice
public $suspended;
public $libelle;
/**
* @deprecated
* @var double $amount
*/
public $amount;
public $remise;
public $vat_src_code;

View File

@ -181,6 +181,10 @@ class FactureFournisseur extends CommonInvoice
*/
public $date_echeance;
/**
* @deprecated
* @var double $amount
*/
public $amount = 0;
public $remise = 0;
@ -1174,7 +1178,8 @@ class FactureFournisseur extends CommonInvoice
$this->paye = trim($this->paye);
}
if (isset($this->amount)) {
$this->amount = trim($this->amount);
if (empty($this->amount)) $this->amount = 0;
else $this->amount = doubleval($this->amount);
}
if (isset($this->remise)) {
$this->remise = trim($this->remise);
@ -1221,7 +1226,8 @@ class FactureFournisseur extends CommonInvoice
$this->fk_facture_source = trim($this->fk_facture_source);
}
if (isset($this->fk_project)) {
$this->fk_project = trim($this->fk_project);
if (empty($this->fk_project)) $this->fk_project = null;
else $this->fk_project = intval($this->fk_project);
}
if (isset($this->cond_reglement_id)) {
$this->cond_reglement_id = trim($this->cond_reglement_id);