From 8c71118fa8487c3bd01b962ddb223f2b52109591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:04:03 +0200 Subject: [PATCH 1/3] php V8 warning --- htdocs/fourn/commande/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 2d0fc3382df..e13801d4499 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -555,6 +555,7 @@ if (empty($reshook)) { $ref_supplier = $productsupplier->ref_supplier; // Get vat rate + $tva_npr = 0; if (!GETPOSTISSET('tva_tx')) { // If vat rate not provided from the form (the form has the priority) $tva_tx = get_default_tva($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); $tva_npr = get_default_npr($object->thirdparty, $mysoc, $productsupplier->id, GETPOST('idprodfournprice', 'alpha')); @@ -667,11 +668,10 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { - $newlang = GETPOST('lang_id', 'aZ09'); - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; + if(GETPOST('lang_id', 'aZ09')) + $newlang = GETPOST('lang_id', 'aZ09'); } if (!empty($newlang)) { $outputlangs = new Translate("", $conf); From 9ce6ed74a7d7e10f95075f00a5982f1ebb144373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?This=20Charl=C3=A8ne?= <1179011+defrance@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:05:54 +0200 Subject: [PATCH 2/3] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 73a9eb13fbe..93e89ecc583 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1957,7 +1957,7 @@ class CommandeFournisseur extends CommonOrder $this->line->total_localtax2 = $total_localtax2; $this->line->total_ttc = $total_ttc; $this->line->product_type = $type; - $this->line->special_code = $this->special_code; + $this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0); $this->line->origin = $origin; $this->line->origin_id = $origin_id; $this->line->fk_unit = $fk_unit; @@ -2856,7 +2856,7 @@ class CommandeFournisseur extends CommonOrder $this->line->total_localtax2 = $total_localtax2; $this->line->total_ttc = $total_ttc; $this->line->product_type = $type; - $this->line->special_code = $this->special_code; + $this->line->special_code = (!empty($this->special_code) ? $this->special_code : 0); $this->line->origin = $this->origin; $this->line->fk_unit = $fk_unit; From e4b7fbe1aca3f1b70a9801be15976f9c8476b220 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 23 Aug 2022 10:10:39 +0000 Subject: [PATCH 3/3] Fixing style errors. --- htdocs/fourn/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e13801d4499..26bbe5c42e4 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -670,7 +670,7 @@ if (empty($reshook)) { $newlang = ''; if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $object->thirdparty->default_lang; - if(GETPOST('lang_id', 'aZ09')) + if (GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); } if (!empty($newlang)) {