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/5] 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/5] 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/5] 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)) { From ff342f79f23917a93e3c3513f8a24fa3e78c6e5e Mon Sep 17 00:00:00 2001 From: habot-it Date: Tue, 23 Aug 2022 16:26:52 +0200 Subject: [PATCH 4/5] Add options in function pdf_pagefoot of pdf.lib.php - Revision 2 --- htdocs/core/lib/pdf.lib.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index be89f4700b8..63d037cc2f9 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1181,6 +1181,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak } + if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak if ($line) { // Free text $pdf->SetXY($dims['lm'], -$posy); if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default @@ -1190,6 +1191,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } $posy -= $freetextheight; } + if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak $pdf->SetY(-$posy); @@ -1199,16 +1201,15 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } // Option for set top margin height of footer after freetext - if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') { - // TODO Remove this case. Height should be good automatically, only $posy-- should be required. - $posy -= getDolGlobalInt('PDF_FOOTER_TOP_MARGIN'); + if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) { + $posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN')); } else { $posy--; } - if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak + if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak $pdf->writeHTMLCell($pdf->page_largeur - $pdf->margin_left - $pdf->margin_right, $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0)); - if (getDolGlobalString('PDF_FOOTER_DISABLE_PAGEBREAK') === '1') { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak + if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak $posy -= $mycustomfooterheight - 3; } else { @@ -1224,6 +1225,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak } + if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(0, 0); } // Option for disable auto pagebreak if ($line) { // Free text $pdf->SetXY($dims['lm'], -$posy); if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default @@ -1233,6 +1235,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } $posy -= $freetextheight; } + if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { $pdf->SetAutoPageBreak(1, 0); } // Restore pagebreak $pdf->SetY(-$posy); @@ -1242,9 +1245,8 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } // Option for set top margin height of footer after freetext - if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalString('PDF_FOOTER_TOP_MARGIN') === '0') { - // TODO Remove this case. Height should be good automatically, only $posy-- should be required. - $posy -= getDolGlobalString('PDF_FOOTER_TOP_MARGIN'); + if (getDolGlobalString('PDF_FOOTER_TOP_MARGIN') || getDolGlobalInt('PDF_FOOTER_TOP_MARGIN') === 0) { + $posy -= floatval(getDolGlobalString('PDF_FOOTER_TOP_MARGIN')); } else { $posy--; } From bba532a9c50c54d2210a965717e6e4ce5b2397b2 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Thu, 25 Aug 2022 15:08:19 +0200 Subject: [PATCH 5/5] fix copy error on supplier_proposal status --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 794a4542f10..24b45c992eb 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2192,7 +2192,7 @@ class SupplierProposal extends CommonObject $this->labelStatus[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSigned"); $this->labelStatus[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosed"); $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv("SupplierProposalStatusDraftShort"); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("Opened"); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv("SupplierProposalStatusValidatedShort"); $this->labelStatusShort[self::STATUS_SIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusSignedShort"); $this->labelStatusShort[self::STATUS_NOTSIGNED] = $langs->transnoentitiesnoconv("SupplierProposalStatusNotSignedShort"); $this->labelStatusShort[self::STATUS_CLOSE] = $langs->transnoentitiesnoconv("SupplierProposalStatusClosedShort");