From af062aa5f609c513c039f62bd7e12e8ed94f2e25 Mon Sep 17 00:00:00 2001 From: Eric <1468823+rycks@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:34:39 +0100 Subject: [PATCH 1/6] datenextrun is mandatory as dolibarr 16.0 (#28344) --- htdocs/core/modules/DolibarrModules.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 627a13a7844..79782383330 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2023 Eric Seigne * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaƫl Doursenaud @@ -1445,6 +1445,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $frequency = isset($this->cronjobs[$key]['frequency']) ? $this->cronjobs[$key]['frequency'] : ''; $unitfrequency = isset($this->cronjobs[$key]['unitfrequency']) ? $this->cronjobs[$key]['unitfrequency'] : ''; $priority = isset($this->cronjobs[$key]['priority']) ? $this->cronjobs[$key]['priority'] : ''; + $datenextrun = isset($this->cronjobs[$key]['datenextrun']) ? $this->cronjobs[$key]['datenextrun'] : ''; $datestart = isset($this->cronjobs[$key]['datestart']) ? $this->cronjobs[$key]['datestart'] : ''; $dateend = isset($this->cronjobs[$key]['dateend']) ? $this->cronjobs[$key]['dateend'] : ''; $status = isset($this->cronjobs[$key]['status']) ? $this->cronjobs[$key]['status'] : ''; @@ -1480,7 +1481,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $this->db->begin(); if (!$err) { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."cronjob (module_name, datec, datenextrun, datestart, dateend, label, jobtype, classesname, objectname, methodename, command, params, note,"; if (is_int($frequency)) { $sql .= ' frequency,'; } @@ -1497,6 +1498,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $sql .= " VALUES ("; $sql .= "'".$this->db->escape(empty($this->rights_class) ?strtolower($this->name) : $this->rights_class)."', "; $sql .= "'".$this->db->idate($now)."', "; + $sql .= ($datenextrun ? "'".$this->db->idate($datenextrun)."'" : "'".$this->db->idate($now)."'").", "; $sql .= ($datestart ? "'".$this->db->idate($datestart)."'" : "'".$this->db->idate($now)."'").", "; $sql .= ($dateend ? "'".$this->db->idate($dateend)."'" : "NULL").", "; $sql .= "'".$this->db->escape($label)."', "; From bb12b0c8b957e0e2e5e11061f3d731a5c423d8c6 Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Mon, 26 Feb 2024 22:59:27 +0100 Subject: [PATCH 2/6] fix: display root account according root label in balance bookkeeping (#28435) --- htdocs/accountancy/bookkeeping/balance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 01d89f1168d..af317e7a361 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -427,7 +427,7 @@ if ($action != 'export_csv') { // Show first line of a break print ''; - print ''.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').''; + print ''.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').''; print ''; $displayed_account = $root_account_number; From 700c0e3e736e220b56dd2df88d2421acd65f4b28 Mon Sep 17 00:00:00 2001 From: atm-adrien <67913809+atm-adrien@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:49:26 +0100 Subject: [PATCH 3/6] FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523) * FIX : Add new hidden conf "DISABLE_QTY_OVERWRITTEN" * FIX : Change conf name * FIX : PR returns --- htdocs/product/inventory/inventory.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 4ca3768fa11..b924b9c442c 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -1045,8 +1045,9 @@ if ($resql) { // Expected quantity = Quantity in stock when we start inventory print ''; $valuetoshow = $obj->qty_stock; + // For inventory not yet close, we overwrite with the real value in stock now - if ($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) { + if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && !getDolGlobalString('DISABLE_QTY_OVERWRITE')) { if (isModEnabled('productbatch') && $product_static->hasbatch()) { $valuetoshow = $product_static->stock_warehouse[$obj->fk_warehouse]->detail_batch[$obj->batch]->qty; } else { From 4c116e1577ff543fb15cc9b8cd1f3bc0564fb91f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 17:59:17 +0100 Subject: [PATCH 4/6] Doc --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2cb7b41316a..8bc8cb9a9c1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -8850,7 +8850,7 @@ abstract class CommonObject /** - * Function to prepare a part of the query for insert. + * Function to return the array of data key-value from the ->fields and all the ->properties of an object. * Note $this->${field} are set by the page that make the createCommon or the updateCommon. * $this->${field} should be a clean value. The page can run * From 284fb49f607b8dec04bf0234528273af3a62d04b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 19:35:34 +0100 Subject: [PATCH 5/6] Try a better fix for #28526 --- htdocs/core/class/commonobject.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8bc8cb9a9c1..ed3203848bc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -570,6 +570,19 @@ abstract class CommonObject public $user_modification_id; + /** + * @var int ID + * @deprecated Use $user_creation_id + */ + public $fk_user_creat; + + /** + * @var int ID + * @deprecated Use $user_modification_id + */ + public $fk_user_modif; + + public $next_prev_filter; /** @@ -9048,6 +9061,11 @@ abstract class CommonObject } if (array_key_exists('fk_user_creat', $fieldvalues) && !($fieldvalues['fk_user_creat'] > 0)) { $fieldvalues['fk_user_creat'] = $user->id; + $this->fk_user_creat = $user->id; + } + if (array_key_exists('user_modification_id', $fieldvalues) && !($fieldvalues['user_modification_id'] > 0)) { + $fieldvalues['user_modification_id'] = $user->id; + $this->user_modification_id = $user->id; } unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert. if (array_key_exists('ref', $fieldvalues)) { From a0fc77cd76a5ca9b229d8503cc85ddc46bd84445 Mon Sep 17 00:00:00 2001 From: thomas-Ngr Date: Thu, 29 Feb 2024 19:40:51 +0100 Subject: [PATCH 6/6] Fix Form::load_cache_vatrates() countries dict (#28528) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cd9f44130b9..e262eb163c9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6348,7 +6348,7 @@ class Form if (!empty($user) && $user->admin && preg_match('/\'(..)\'/', $country_code, $reg)) { $langs->load("errors"); $new_country_code = $reg[1]; - $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_pays', 'code', 'rowid'); + $country_id = dol_getIdFromCode($this->db, $new_country_code, 'c_country', 'code', 'rowid'); $this->error .= '
'.$langs->trans("ErrorFixThisHere", DOL_URL_ROOT.'/admin/dict.php?id=10'.($country_id > 0 ? '&countryidforinsert='.$country_id : '')); } $this->error .= '';