diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index bfa428bb13b..f8a99d51d40 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -244,6 +244,7 @@ class doc_generic_bom_odt extends ModelePDFBom $object->fetch_thirdparty(); $object->fetch_product(); + $object->calculateCosts(); $dir = $conf->bom->multidir_output[isset($object->entity) ? $object->entity : 1]; $objectref = dol_sanitizeFileName($object->ref); @@ -260,13 +261,13 @@ class doc_generic_bom_odt extends ModelePDFBom } if (file_exists($dir)) { - //print "srctemplatepath=".$srctemplatepath; // Src filename + // print "srctemplatepath=".$srctemplatepath; // Src filename $newfile = basename($srctemplatepath); $newfiletmp = preg_replace('/\.od[ts]/i', '', $newfile); $newfiletmp = preg_replace('/template_/i', '', $newfiletmp); $newfiletmp = preg_replace('/modele_/i', '', $newfiletmp); $newfiletmp = $objectref . '_' . $newfiletmp; - //$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; + // $file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt'; // Get extension (ods or odt) $newfileformat = substr($newfile, strrpos($newfile, '.') + 1); if (getDolGlobalString('MAIN_DOC_USE_TIMING')) { @@ -279,10 +280,6 @@ class doc_generic_bom_odt extends ModelePDFBom $filename = $newfiletmp . '.' . $newfileformat; } $file = $dir . '/' . $filename; - //print "newdir=".$dir; - //print "newfile=".$newfile; - //print "file=".$file; - //print "conf->societe->dir_temp=".$conf->societe->dir_temp; dol_mkdir($conf->bom->dir_temp); if (!is_writable($conf->bom->dir_temp)) { @@ -454,7 +451,6 @@ class doc_generic_bom_odt extends ModelePDFBom } // Call the beforeODTSave hook - $parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray); $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 96c88e5e9cc..7adab19fb1a 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -116,7 +116,7 @@ parameters: - '#Call to function array_key_exists.. with .error. .* will always evaluate to false.#' - '#function dolGetButtonAction expects array\{confirm\?: array.*confirm: true} given.#' - '#(?:make_substitutions expects array,) string given\.#' - - '# (Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#' + - '# (DolibarrApiAccess|Documents|Login|Setup|Workstation|WorkstationResource|WorkstationUserGroup|Zapier)::.* has no value type specified in iterable type array\.#' internalErrorsCountLimit: 50 cache: