From dc58a90a486e92818cd37a5f7c1ae0c440ef85d9 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Wed, 31 Jul 2024 15:35:15 +0200 Subject: [PATCH 1/2] Fix modulebuilder MAIN_ODT_AS_PDF (#30496) --- .../modules/mymodule/doc/doc_generic_myobject_odt.modules.php | 2 +- .../core/modules/mymodule/doc/pdf_standard_myobject.modules.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php index 9baea8a2a71..e35fb604cec 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php @@ -473,7 +473,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks // Write new file - if (getDolGlobalInt('MAIN_ODT_AS_PDF')) { + if (getDolGlobalString('MAIN_ODT_AS_PDF')) { try { $odfHandler->exportAsAttachedPDF($file); } catch (Exception $e) { diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index b0e62412651..4d6d8987f62 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -944,7 +944,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); $title = $outputlangs->transnoentities("PdfTitle"); - if (getDolGlobalInt('MAIN_ODT_AS_PDF') && is_object($outputlangsbis)) { + if (getDolGlobalString('MAIN_ODT_AS_PDF') && is_object($outputlangsbis)) { $title .= ' - '; $title .= $outputlangsbis->transnoentities("PdfTitle"); } From 2c92e57fe7b81a814f67ad8064dce67f37f8118a Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:52:53 +0200 Subject: [PATCH 2/2] FIX : Display the real_PMP on inventory when its value is equal to 0 (#22291) * FIX : Display the real_PMP on inventory when its value is equal to 0 * FIX : PR Returns * FIX : PR returns --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 4719fe00ce8..0d65a78badd 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1087,7 +1087,7 @@ if ($object->id > 0) { print ''; - if (! empty($obj->pmp_real)) $pmp_real = $obj->pmp_real; + if (! empty($obj->pmp_real) || (string) $obj->pmp_real === '0') $pmp_real = $obj->pmp_real; else $pmp_real = $product_static->pmp; $pmp_valuation_real = $pmp_real * $qty_view; print '';