From 01e82a94b8600a090c7442ff820d85494115af1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Feb 2024 12:46:57 +0100 Subject: [PATCH] Fix phpstan --- htdocs/comm/propal/card.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/class/facture.class.php | 4 ++-- .../fourn/class/fournisseur.facture.class.php | 23 +++++++++++-------- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index bc289b36d38..02b2b91f36f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -853,7 +853,7 @@ if (empty($reshook)) { $remise_percent = $originLine->remise_percent; $date_start = $originLine->date_start; $date_end = $originLine->date_end; - $ventil = 0; + $fk_code_ventilation = 0; $info_bits = $originLine->info_bits; $fk_remise_except = $originLine->fk_remise_except; $price_base_type = 'HT'; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index e651b4e64f2..f11fb86068d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1541,7 +1541,7 @@ if (empty($reshook)) { $remise_percent = $originLine->remise_percent; $date_start = $originLine->date_start; $date_end = $originLine->date_end; - $ventil = 0; + $fk_code_ventilation = 0; $info_bits = $originLine->info_bits; $fk_remise_except = $originLine->fk_remise_except; $price_base_type = 'HT'; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c11700f6aac..35ddb2c8eac 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2912,7 +2912,7 @@ if (empty($reshook)) { $remise_percent = $originLine->remise_percent; $date_start = $originLine->date_start; $date_end = $originLine->date_end; - $ventil = 0; + $fk_code_ventilation = 0; $info_bits = $originLine->info_bits; $fk_remise_except = $originLine->fk_remise_except; $price_base_type = 'HT'; @@ -2936,7 +2936,7 @@ if (empty($reshook)) { $fk_unit = $originLine->fk_unit; $pu_ht_devise = $originLine->multicurrency_subprice; - $res = $object->addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $ventil, $info_bits, $fk_remise_except, $price_base_type, $pu_ttc, $type, $rang, $special_code, $origin, $origin_id, $fk_parent_line, $fk_fournprice, $pa_ht, $label, $array_options, $situation_percent, $fk_prev_id, $fk_unit, $pu_ht_devise); + $res = $object->addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $fk_code_ventilation, $info_bits, $fk_remise_except, $price_base_type, $pu_ttc, $type, $rang, $special_code, $origin, $origin_id, $fk_parent_line, $fk_fournprice, $pa_ht, $label, $array_options, $situation_percent, $fk_prev_id, $fk_unit, $pu_ht_devise); if ($res > 0) { $importCount++; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 524c3be0c1e..7e873aa6739 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3838,8 +3838,8 @@ class Facture extends CommonInvoice if (empty($rang)) { $rang = 0; } - if (empty($ventil)) { - $ventil = 0; + if (empty($fk_code_ventilation)) { + $fk_code_ventilation = 0; } if (empty($txtva)) { $txtva = 0; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 9f1e9965aca..03965b63211 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2046,9 +2046,9 @@ class FactureFournisseur extends CommonInvoice * @param double $qty Quantity * @param int $fk_product Product/Service ID predefined * @param double $remise_percent Percentage discount of the line - * @param integer $date_start Service start date - * @param integer $date_end Service expiry date - * @param string $ventil Accounting breakdown code + * @param int $date_start Service start date + * @param int $date_end Service expiry date + * @param int $fk_code_ventilation Accounting breakdown code * @param int $info_bits Line type bits * @param string $price_base_type HT or TTC * @param int $type Type of line (0=product, 1=service) @@ -2064,11 +2064,11 @@ class FactureFournisseur extends CommonInvoice * @param int $fk_remise_except Id discount used * @return int >0 if OK, <0 if KO */ - public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $ventil = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0) + public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product = 0, $remise_percent = 0, $date_start = '', $date_end = '', $fk_code_ventilation = 0, $info_bits = '', $price_base_type = 'HT', $type = 0, $rang = -1, $notrigger = 0, $array_options = [], $fk_unit = null, $origin_id = 0, $pu_devise = 0, $ref_supplier = '', $special_code = '', $fk_parent_line = 0, $fk_remise_except = 0) { global $langs, $mysoc, $conf; - dol_syslog(get_class($this)."::addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$ventil,$info_bits,$price_base_type,$type,$fk_unit,fk_remise_except=$fk_remise_except", LOG_DEBUG); + dol_syslog(get_class($this)."::addline $desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$date_start,$date_end,$fk_code_ventilation,$info_bits,$price_base_type,$type,$fk_unit,fk_remise_except=$fk_remise_except", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; if ($this->statut == self::STATUS_DRAFT) { @@ -2085,8 +2085,8 @@ class FactureFournisseur extends CommonInvoice if (empty($rang)) { $rang = 0; } - if (empty($ventil)) { - $ventil = 0; + if (empty($fk_code_ventilation)) { + $fk_code_ventilation = 0; } if (empty($txtva)) { $txtva = 0; @@ -2244,7 +2244,7 @@ class FactureFournisseur extends CommonInvoice $supplierinvoiceline->remise_percent = $remise_percent; $supplierinvoiceline->date_start = $date_start; $supplierinvoiceline->date_end = $date_end; - $supplierinvoiceline->fk_code_ventilation = $ventil; + $supplierinvoiceline->fk_code_ventilation = $fk_code_ventilation; $supplierinvoiceline->rang = $rang; $supplierinvoiceline->info_bits = $info_bits; $supplierinvoiceline->fk_remise_except = $fk_remise_except; @@ -3479,10 +3479,15 @@ class SupplierInvoiceLine extends CommonObjectLine public $date_start; public $date_end; + /** + * @var int + */ + public $fk_code_ventilation; + public $skip_update_total; // Skip update price total for special lines /** - * @var int Situation advance percentage + * @var int Situation progress percentage */ public $situation_percent;