Fix warnings

This commit is contained in:
Laurent Destailleur 2020-12-22 17:33:17 +01:00
parent 093817833f
commit bac2ae0d5f
4 changed files with 18 additions and 18 deletions

View File

@ -3159,8 +3159,8 @@ class Commande extends CommonOrder
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = $txlocaltax1;
$this->line->localtax2_tx = $txlocaltax2;
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = $subprice;
$this->line->info_bits = $info_bits;

View File

@ -3136,8 +3136,8 @@ class Facture extends CommonInvoice
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
$this->line->localtax1_type = isset($localtaxes_type[0]) ? $localtaxes_type[0] : '';
$this->line->localtax2_type = isset($localtaxes_type[2]) ? $localtaxes_type[2] : '';
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
$this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ttc) : $total_ttc); // For credit note and if qty is negative, total is negative
@ -3375,8 +3375,8 @@ class Facture extends CommonInvoice
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = $txlocaltax1;
$this->line->localtax2_tx = $txlocaltax2;
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ?-abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise

View File

@ -1714,8 +1714,8 @@ class CommandeFournisseur extends CommonOrder
$multicurrency_total_ttc = $tabprice[18];
$pu_ht_devise = $tabprice[19];
$localtax1_type = $localtaxes_type[0];
$localtax2_type = $localtaxes_type[2];
$localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$rangmax = $this->line_max();
$rang = $rangmax + 1;
@ -1734,8 +1734,8 @@ class CommandeFournisseur extends CommonOrder
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = $localtax1_type;
$this->line->localtax2_type = $localtax2_type;
$this->line->fk_product = $fk_product;
$this->line->product_type = $product_type;
$this->line->remise_percent = $remise_percent;
@ -2594,8 +2594,8 @@ class CommandeFournisseur extends CommonOrder
$multicurrency_total_ttc = $tabprice[18];
$pu_ht_devise = $tabprice[19];
$localtax1_type = $localtaxes_type[0];
$localtax2_type = $localtaxes_type[2];
$localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
//Fetch current line from the database and then clone the object and set it in $oldline property
$this->line = new CommandeFournisseurLigne($this->db);
@ -2633,8 +2633,8 @@ class CommandeFournisseur extends CommonOrder
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = $txlocaltax1;
$this->line->localtax2_tx = $txlocaltax2;
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->remise_percent = $remise_percent;
$this->line->subprice = $pu_ht;
$this->line->rang = $this->rang;

View File

@ -1765,8 +1765,8 @@ class FactureFournisseur extends CommonInvoice
$this->line->tva_tx = $txtva;
$this->line->localtax1_tx = ($total_localtax1 ? $localtaxes_type[1] : 0);
$this->line->localtax2_tx = ($total_localtax2 ? $localtaxes_type[3] : 0);
$this->line->localtax1_type = $localtaxes_type[0];
$this->line->localtax2_type = $localtaxes_type[2];
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
$this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva);
@ -1952,8 +1952,8 @@ class FactureFournisseur extends CommonInvoice
$line->tva_tx = $vatrate;
$line->localtax1_tx = $txlocaltax1;
$line->localtax2_tx = $txlocaltax2;
$line->localtax1_type = $localtaxes_type[0];
$line->localtax2_type = $localtaxes_type[2];
$line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
$line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
$line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_ht) : $total_ht);
$line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ?-abs($total_tva) : $total_tva);
$line->total_localtax1 = $total_localtax1;