From ebed2211b60b1dfa40ebb2b6c60852963673e31a Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 23 Aug 2023 11:24:09 +0200 Subject: [PATCH 1/2] FIX reception odt dir output path --- .../reception/doc/doc_generic_reception_odt.modules.php | 6 +++--- htdocs/reception/class/reception.class.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index 383ab491346..ecfea479c0d 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -229,7 +229,7 @@ class doc_generic_reception_odt extends ModelePdfReception $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - if ($conf->reception->dir_output."/reception") { + if ($conf->reception->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -243,7 +243,7 @@ class doc_generic_reception_odt extends ModelePdfReception $object->fetch_thirdparty(); - $dir = $conf->reception->dir_output."/reception"; + $dir = !empty($conf->reception->multidir_output[$object->entity]) ? $conf->reception->multidir_output[$object->entity] : $conf->reception->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -416,7 +416,7 @@ class doc_generic_reception_odt extends ModelePdfReception $linenumber = 0; foreach ($object->lines as $line) { $linenumber++; - $tmparray = $this->get_substitutionarray_reception_lines($line, $outputlangs); + $tmparray = $this->get_substitutionarray_lines($line, $outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); // Call the ODTSubstitutionLine hook $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray, 'line'=>$line); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 0be0ea7ba37..1fb43f226cb 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -377,7 +377,7 @@ class Reception extends CommonObject return -1; } - $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut"; + $sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_supplier, e.ref_ext, e.fk_user_author, e.fk_statut"; $sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql .= ", e.date_reception as date_reception, e.model_pdf, e.date_delivery"; $sql .= ", e.fk_shipping_method, e.tracking_number"; @@ -409,6 +409,7 @@ class Reception extends CommonObject $obj = $this->db->fetch_object($result); $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->ref; $this->socid = $obj->socid; $this->ref_supplier = $obj->ref_supplier; From 9b16c56074580016937ee9b7cc2ef084e5facb8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Aug 2023 10:05:33 +0200 Subject: [PATCH 2/2] Fix warning --- htdocs/core/lib/invoice.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index b532b9db108..81572f5b8d9 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -176,7 +176,7 @@ function invoice_admin_prepare_head() $head[$h][2] = 'attributeslinesrec'; $h++; - if ($conf->global->INVOICE_USE_SITUATION) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable + if (getDolGlobalInt('INVOICE_USE_SITUATION')) { // Warning, implementation is seriously bugged and a new one not compatible is expected to become stable $head[$h][0] = DOL_URL_ROOT.'/admin/facture_situation.php'; $head[$h][1] = $langs->trans("InvoiceSituation"); $head[$h][2] = 'situation';