From 7433501e08c321819c9563633171a2b8f708d3eb Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Mon, 2 Oct 2023 11:23:35 +0200 Subject: [PATCH 1/3] FIX: Undefined property $pa_ht in Contrat::updateline --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2ae01b2fc3a..673410067de 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1759,7 +1759,7 @@ class Contrat extends CommonObject } // if buy price not defined, define buyprice as configured in margin admin - if ($this->pa_ht == 0) { + if ($pa_ht == 0) { if (($result = $this->defineBuyPrice($pu, $remise_percent)) < 0) { return $result; } else { From 3d96b66664c47da8e483c91307dff45c0a3c280c Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Mon, 2 Oct 2023 14:22:11 +0200 Subject: [PATCH 2/3] FIX: Delete use of unassigned product_description member in ContratLigne class --- htdocs/contrat/class/contrat.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 673410067de..13c3a15aa2b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3307,7 +3307,6 @@ class ContratLigne extends CommonObjectLine $this->statut = $obj->statut; $this->product_ref = $obj->product_ref; $this->product_label = $obj->product_label; - $this->product_description = $obj->product_description; $this->product_type = $obj->product_type; $this->label = $obj->label; // deprecated. We do not use this field. Only ref and label of product, and description of contract line $this->description = $obj->description; From 3028bd37841fd2efb241ceea262b91bf3436c6ef Mon Sep 17 00:00:00 2001 From: Thomas Couacault Date: Mon, 2 Oct 2023 14:42:58 +0200 Subject: [PATCH 3/3] FIX typo $tva_tx instead of $txtva --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 13c3a15aa2b..ccd8947fdf3 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -3443,7 +3443,7 @@ class ContratLigne extends CommonObjectLine // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva. - $localtaxes_type = getLocalTaxesFromRate($this->txtva, 0, $this->thirdparty, $mysoc); + $localtaxes_type = getLocalTaxesFromRate($this->tva_tx, 0, $this->thirdparty, $mysoc); $tabprice = calcul_price_total($this->qty, $this->price_ht, $this->remise_percent, $this->tva_tx, $this->localtax1_tx, $this->localtax2_tx, 0, 'HT', 0, 1, $mysoc, $localtaxes_type); $this->total_ht = $tabprice[0];