From f3460eae482ca6c8a382b85704463336fd52fc3e Mon Sep 17 00:00:00 2001 From: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com> Date: Tue, 21 May 2024 20:01:36 +0200 Subject: [PATCH 1/8] FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710) --- htdocs/product/stock/replenish.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 66ad0889b31..e3f27476488 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -273,6 +273,7 @@ if ($action == 'order' && GETPOST('valid')) { } else { $id = $result; } + $i++; } else { $order->socid = $suppliersid[$i]; $order->fetch_thirdparty(); From 26e09f85d2c0ac57ec4a6344a040ab43e1ca0d32 Mon Sep 17 00:00:00 2001 From: Yannis Hoareau <93135242+YannisHoareau@users.noreply.github.com> Date: Tue, 4 Jun 2024 10:52:29 +0200 Subject: [PATCH 2/8] FIX: Unsigned propal having signing date (#29825) * FIX propal dates: setting sign date only if signed * FIX propal dates: clearing sign date when reopenning a propal * FIX propal dates: reworked + not clearing sign date Not clearing the sign date anymore because of 17.0 configuration that allow the user to choose if he wants to keep the previous sign date or the current date. * FIX propal dates: move comma to fix sql syntax error * FIX propal dates: add SQL request to update database This SQL request is meant to set the sign date and the signing user to null to match the fix * Update 15.0.0-16.0.0.sql --------- Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 29987531925..a33d0864a6c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2629,7 +2629,10 @@ class Propal extends CommonObject $newprivatenote = dol_concatdesc($this->note_private, $note); $sql = "UPDATE ".MAIN_DB_PREFIX."propal"; - $sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id; + $sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."'"; + if ($status == self::STATUS_SIGNED) { + $sql .= ", date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id; + } $sql .= " WHERE rowid = ".((int) $this->id); $resql = $this->db->query($sql); From a3e7151633a0d098e0263b4b68cb25cff8647daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= <85104766+Kazimir42@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:20:25 +0200 Subject: [PATCH 3/8] fix restrictedArea on selectobject (#29882) --- htdocs/core/ajax/selectobject.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index c8c3e13ea3d..c4010731ccb 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -84,7 +84,11 @@ if (!is_object($objecttmp)) { $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlname && GETPOST($htmlname, 'alpha')) ? GETPOST($htmlname, 'alpha') : '')); // Add a security test to avoid to get content of all tables -restrictedArea($user, $objecttmp->element, $id); +if (!empty($objecttmp->module)) { + restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); +}else { + restrictedArea($user, $objecttmp->element, $id); +} $arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1); From 72a2a96063dae6a50e2ee56516f6716d43e341fd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Jun 2024 23:46:21 +0200 Subject: [PATCH 4/8] Fix travis --- htdocs/core/ajax/selectobject.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index c4010731ccb..37a0e6e32e3 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -85,9 +85,9 @@ $searchkey = (($id && GETPOST($id, 'alpha')) ? GETPOST($id, 'alpha') : (($htmlna // Add a security test to avoid to get content of all tables if (!empty($objecttmp->module)) { - restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); -}else { - restrictedArea($user, $objecttmp->element, $id); + restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element); +} else { + restrictedArea($user, $objecttmp->element, $id); } $arrayresult = $form->selectForFormsList($objecttmp, $htmlname, '', 0, $searchkey, '', '', '', 0, 1); From 040e9083da39a03bcbb0eddbc74ae78ebbf64866 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 7 Jun 2024 23:56:14 +0200 Subject: [PATCH 5/8] Fix : expense report reapproval email, wrong date format + missing parameter (#29874) --- htdocs/expensereport/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 0201dfdd7f6..44cd66ff0c5 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -502,8 +502,7 @@ if (empty($reshook)) { // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $link = ''.$link.''; - $dateRefusEx = explode(" ", $object->date_refuse); - $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", $dateRefusEx[0], $object->detail_refuse, $expediteur->getFullName($langs), $link); + $message = $langs->transnoentities("ExpenseReportWaitingForReApprovalMessage", dol_print_date($object->date_refuse, 'day'), $object->detail_refuse, $expediteur->getFullName($langs), get_date_range($object->date_debut, $object->date_fin, '', $langs), $link); // Rebuild pdf /* From b0e825c1230827e8462c89cc4c408c73d9324f2e Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:01:22 +0200 Subject: [PATCH 6/8] FIX: PHP 8 warning on output of successful cronjob (#29922) --- htdocs/cron/class/cronjob.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index b89d7ea3cb7..569364a4dfd 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1275,7 +1275,7 @@ class Cronjob extends CommonObject $error++; } else { dol_syslog(get_class($this)."::run_jobs END"); - $this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n").$errmsg, 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1); + $this->lastoutput = dol_substr((empty($object->output) ? "" : $object->output."\n"), 0, $this::MAXIMUM_LENGTH_FOR_LASTOUTPUT_FIELD, 'UTF-8', 1); $this->lastresult = var_export($result, true); $retval = $this->lastresult; } From 956d1b025a4a4096e143ba226c7f943058d5b749 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 8 Jun 2024 23:35:01 +0200 Subject: [PATCH 7/8] Fix : product price by quantity was removing default price (#29899) --- htdocs/product/price.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index d93fdbe9b17..8ef9398cefe 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -503,7 +503,9 @@ if (empty($reshook)) { if ($action == 'activate_price_by_qty') { // Activating product price by quantity add a new price line with price_by_qty set to 1 $level = GETPOST('level', 'int'); - $ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 1); + $basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc; + $basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc; + $ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 1); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -513,7 +515,9 @@ if (empty($reshook)) { if ($action == 'disable_price_by_qty') { // Disabling product price by quantity add a new price line with price_by_qty set to 0 $level = GETPOST('level', 'int'); - $ret = $object->updatePrice(0, $object->price_base_type, $user, $object->tva_tx, 0, $level, $object->tva_npr, 0); + $basePrice = ($object->price_base_type == 'HT') ? $object->price : $object->price_ttc; + $basePriceMin = ($object->price_base_type == 'HT') ? $object->price_min : $object->price_min_ttc; + $ret = $object->updatePrice($basePrice, $object->price_base_type, $user, $object->tva_tx, $basePriceMin, $level, $object->tva_npr, 0); if ($ret < 0) { setEventMessages($object->error, $object->errors, 'errors'); From c5bb1856c2f0806d7da4a9f7ea44a71e29a3b831 Mon Sep 17 00:00:00 2001 From: lvessiller-opendsi Date: Sat, 15 Jun 2024 15:02:19 +0200 Subject: [PATCH 8/8] FIX modification date from label in accounting bookkeeping list (#30038) --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 0ec53018a21..56a9a0916cf 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -919,7 +919,7 @@ if (!empty($arrayfields['t.tms']['checked'])) { print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print ''; print '
'; - print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print ''; }