From c470629a7912347fc9d2b2eb1068c80a4537441d Mon Sep 17 00:00:00 2001 From: futurehousestore Date: Fri, 7 Feb 2025 02:07:06 +0000 Subject: [PATCH 1/5] Update list.php fix total stock quantity --- htdocs/product/stock/list.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d49bb4078d779..ed830e2cc3e88 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -679,7 +679,7 @@ // Hook fields $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (!empty($arrayfields['t.statut']['checked'])) { @@ -898,11 +898,6 @@ $i++; } -if ($totalnboflines - $offset <= $limit) { - // Show total line - include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; -} - // If no record found if ($num == 0) { $colspan = 1; @@ -916,6 +911,9 @@ $db->free($resql); +// Unconditionally show the total line (modification: totals are now displayed on every page) +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From 68ffd2b6a8011bd176b4570d41c27d4555fa3573 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 12:51:44 +0100 Subject: [PATCH 2/5] Doc --- htdocs/install/mysql/migration/repair.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 8262a3e1c98a9..dfae51fd35265 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -602,6 +602,10 @@ DELETE FROM llx_rights_def WHERE module = 'hrm' AND perms = 'employee'; -- UPDATE llx_bank as b SET b.amount_main_currency = -b.amount_main_currency WHERE b.amount IS NOT NULL AND b.amount_main_currency IS NOT NULL AND SIGN(b.amount_main_currency) <> SIGN(b.amount); +-- Sequence to fix the table llx_paiement_facture and llx_paiement for payment record on a bank account that does not exists anymore. +-- delete from llx_paiement_facture where fk_paiement in (select rowid from llx_paiement WHERE fk_bank is not null AND fk_bank not in (select rowid from llx_bank)); +-- delete from llx_paiement WHERE fk_bank is not null AND fk_bank not in (select rowid from llx_bank); + -- Delete duplicate entries into llx_c_transport_mode -- VMYSQL4.1 DELETE T1 FROM llx_c_transport_mode as T1, llx_c_transport_mode as T2 where T1.entity = T2.entity AND T1.code = T2.code and T1.rowid > T2.rowid; From 0b67bf4dad96eb0bc42c8a7b77684eb32e11fb50 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 13:00:24 +0100 Subject: [PATCH 3/5] Fix phan --- htdocs/core/modules/project/modules_project.php | 2 +- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 2 ++ .../modules/mymodule/doc/doc_generic_myobject_odt.modules.php | 1 + .../doc/doc_generic_recruitmentjobposition_odt.modules.php | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 48885f0e4c7e7..f0f8bdf6cb133 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -68,7 +68,7 @@ public static function liste_modeles($db, $maxfilenamelength = 0) /** * Function to build pdf project onto disk * - * @param Project $object Object source to build document + * @param Task $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int<-1,1> 1 if OK, <=0 if KO diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 2eb87a0189f4f..6c9f3b4386150 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -606,6 +606,8 @@ public function write_file($object, $outputlangs, $srctemplatepath = '') } } + /** var Task $object */ + // Replace tags of lines for tasks try { // Security check 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 e4f82b3a5379d..59ae7b1ec7130 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 @@ -445,6 +445,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var CommonObjectLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php index f40dcf70b41f7..637ba4f0cba20 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php @@ -437,6 +437,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '', $hidede if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var CommonObjectLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); From c01c49074c4f11a636bc38ba0044c5813e73f5ea Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 14:12:42 +0100 Subject: [PATCH 4/5] Fix phan --- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 6c9f3b4386150..e45ce84f946d0 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -606,7 +606,7 @@ public function write_file($object, $outputlangs, $srctemplatepath = '') } } - /** var Task $object */ + /** @var Task $object */ // Replace tags of lines for tasks try { From 568a7723c92584b05294b79e5a3f5df0dc7bb329 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 14:16:48 +0100 Subject: [PATCH 5/5] Fix phan --- htdocs/core/modules/project/modules_project.php | 8 ++++---- htdocs/core/modules/project/task/modules_task.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index f0f8bdf6cb133..26ffc207484b7 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -68,10 +68,10 @@ public static function liste_modeles($db, $maxfilenamelength = 0) /** * Function to build pdf project onto disk * - * @param Task $object Object source to build document - * @param Translate $outputlangs Lang output object - * @param string $srctemplatepath Full path of source filename for generator using a template file - * @return int<-1,1> 1 if OK, <=0 if KO + * @param Project $object Object source to build document + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @return int<-1,1> 1 if OK, <=0 if KO */ abstract public function write_file($object, $outputlangs, $srctemplatepath = ''); // phpcs:enable diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 4bc906f6fae29..5409b88791455 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -60,7 +60,7 @@ public static function liste_modeles($db, $maxfilenamelength = 0) /** * Function to build a document on disk using the generic odt module. * - * @param Project $object Object source to build document + * @param Task $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int<-1,1> 1 if OK, <=0 if KO