From 885b767a1f8617f2508d3b79cc9d92052cb7df4e Mon Sep 17 00:00:00 2001 From: Gilles Lengy Date: Wed, 22 Mar 2023 20:26:19 +0100 Subject: [PATCH 01/12] FIX|Fix #24298 No error or 0.00 instead of NULL in database anymore when emptying an extrafield of type price on a propal card --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b36415f5b15..7c5ab1d210e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1393,7 +1393,7 @@ if (empty($reshook)) { $error++; } if (!$error) { - $result = $object->updateExtraField(GETPOST('attribute', 'restricthtml'), 'PROPAL_MODIFY', $user); + $result = $object->insertExtraFields('PROPAL_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; From 723cdcea19726a733674e5e5d089a749bfd41b51 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Mon, 27 Mar 2023 12:24:33 +0200 Subject: [PATCH 02/12] FIX : Add bookmark with search fields that are arrays (backport 4157263cb898f1847cfcfc22dee6007c01b13a4d) --- htdocs/bookmarks/bookmarks.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 26d834fb5d9..cc33e46f03f 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -65,7 +65,13 @@ function printDropdownBookmarksList() if ((preg_match('/^search_/', $key) || in_array($key, $authorized_var)) && $val != '' && !array_key_exists($key, $url_param)) { - $url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); + if (is_array($val)) { + foreach ($val as $tmpsubval) { + $url_param[] = http_build_query(array(dol_escape_htmltag($key).'[]' => dol_escape_htmltag($tmpsubval))); + } + } elseif ($val != '') { + $url_param[$key] = http_build_query(array(dol_escape_htmltag($key) => dol_escape_htmltag($val))); + } } } } From 99cb5098e7cb7fde9dd6c2718eb5803be78ec85c Mon Sep 17 00:00:00 2001 From: priojk Date: Tue, 28 Mar 2023 17:25:07 +0200 Subject: [PATCH 03/12] extend preg match to alternative action names --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c9553be4638..9c308f5cde2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -588,7 +588,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null } } if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { - if (!empty($_GET['action']) && (preg_match('/^create/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) { + if (!empty($_GET['action']) && (preg_match('/^create|^add|^make/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) { // Now search in setup to overwrite default values if (!empty($user->default_values)) { // $user->default_values defined from menu 'Setup - Default values' if (isset($user->default_values[$relativepathstring]['createform'])) { From 63b0e65797ed6082753430ea3aa8a811e607e399 Mon Sep 17 00:00:00 2001 From: priojk Date: Tue, 28 Mar 2023 23:05:29 +0200 Subject: [PATCH 04/12] adjusted fix --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9c308f5cde2..a5303555f71 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -588,7 +588,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null } } if (!empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { - if (!empty($_GET['action']) && (preg_match('/^create|^add|^make/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) { + if (!empty($_GET['action']) && (preg_match('/^create|^add_price|^make/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && !isset($_GET[$paramname]) && !isset($_POST[$paramname])) { // Now search in setup to overwrite default values if (!empty($user->default_values)) { // $user->default_values defined from menu 'Setup - Default values' if (isset($user->default_values[$relativepathstring]['createform'])) { From dbc12cb1696f7aa4c70d87a2b09a684b0aa19f70 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 29 Mar 2023 12:27:29 +0200 Subject: [PATCH 05/12] FIX can not show all csv fields (a reason for that ?) --- htdocs/imports/import.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a6982bd0a4e..62059231f2d 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -1079,9 +1079,9 @@ if ($step == 4 && $datatoimport) { $valforsourcefieldnb[$lefti] = $key; $lefti++; - if ($lefti > count($fieldstarget)) { + /*if ($lefti > count($fieldstarget)) { break; // Other fields are in the not imported area - } + }*/ } //var_dump($valforsourcefieldnb); @@ -1134,9 +1134,9 @@ if ($step == 4 && $datatoimport) { print ''; foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file. - if ($i == $minpos) { + /*if ($i == $minpos) { break; - } + }*/ print ''; $entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]); From 0579c3f2f3e8b4551304ca154ce24da61b695bd0 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 29 Mar 2023 14:48:47 +0200 Subject: [PATCH 06/12] FIX PDF Espadon Expedition : notes and tracking number --- .../expedition/doc/pdf_espadon.modules.php | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index 5280c2b7a1e..a62398b4f9e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -368,11 +368,15 @@ class pdf_espadon extends ModelePdfExpedition if (!empty($notetoshow) || !empty($object->tracking_number)) { $tab_top -= 2; + $tab_topbeforetrackingnumber = $tab_top; // Tracking number if (!empty($object->tracking_number)) { + + $height_trackingnumber = 4; + $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L'); + $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber") . " : " . $object->tracking_number, 0, 1, false, true, 'L'); $tab_top_alt = $pdf->GetY(); $object->getUrlTrackingStatus($object->tracking_number); @@ -390,8 +394,10 @@ class pdf_espadon extends ModelePdfExpedition $label .= " : "; $label .= $object->tracking_url; } + + $height_trackingnumber += 6; $pdf->SetFont('', 'B', $default_font_size - 2); - $pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L'); + $pdf->writeHTMLCell(60, $height_trackingnumber, $this->posxdesc - 1, $tab_top_alt, $label, 0, 1, false, true, 'L'); $tab_top = $pdf->GetY(); } @@ -401,7 +407,7 @@ class pdf_espadon extends ModelePdfExpedition // Notes $pagenb = $pdf->getPage(); - if (!empty($notetoshow)) { + if (!empty($notetoshow) || !empty($object->tracking_number)) { $tab_top -= 2; $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite; @@ -465,10 +471,22 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetDrawColor(128, 128, 128); // Draw note frame if ($i > $pageposbeforenote) { - $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); + if(empty($height_trackingnumber)) { + $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); + } + else { + $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1; + $tab_top_newpage = $tab_topbeforetrackingnumber; + } $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); } else { - $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); + if(empty($height_trackingnumber)) { + $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); + } + else { + $height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1; + $tab_top = $tab_topbeforetrackingnumber; + } $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); } @@ -489,7 +507,13 @@ class pdf_espadon extends ModelePdfExpedition { $pdf->commitTransaction(); $posyafter = $pdf->GetY(); - $height_note = $posyafter - $tab_top; + if(empty($height_trackingnumber)) { + $height_note = $posyafter - $tab_top + 1; + } + else { + $height_note = $posyafter - $tab_top + $height_trackingnumber + 1; + $tab_top = $tab_topbeforetrackingnumber; + } $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1); From 507abd4cc2c467db74b46fd82b78a862a1e79e9b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 29 Mar 2023 12:56:47 +0000 Subject: [PATCH 07/12] Fixing style errors. --- .../expedition/doc/pdf_espadon.modules.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index a62398b4f9e..12f20d74d7e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -372,7 +372,6 @@ class pdf_espadon extends ModelePdfExpedition // Tracking number if (!empty($object->tracking_number)) { - $height_trackingnumber = 4; $pdf->SetFont('', 'B', $default_font_size - 2); @@ -471,19 +470,17 @@ class pdf_espadon extends ModelePdfExpedition $pdf->SetDrawColor(128, 128, 128); // Draw note frame if ($i > $pageposbeforenote) { - if(empty($height_trackingnumber)) { + if (empty($height_trackingnumber)) { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter); - } - else { + } else { $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter) + $height_trackingnumber + 1; $tab_top_newpage = $tab_topbeforetrackingnumber; } $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1); } else { - if(empty($height_trackingnumber)) { + if (empty($height_trackingnumber)) { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter); - } - else { + } else { $height_note = $this->page_hauteur - ($tab_top + $heightforfooter)+ $height_trackingnumber + 1; $tab_top = $tab_topbeforetrackingnumber; } @@ -507,10 +504,9 @@ class pdf_espadon extends ModelePdfExpedition { $pdf->commitTransaction(); $posyafter = $pdf->GetY(); - if(empty($height_trackingnumber)) { + if (empty($height_trackingnumber)) { $height_note = $posyafter - $tab_top + 1; - } - else { + } else { $height_note = $posyafter - $tab_top + $height_trackingnumber + 1; $tab_top = $tab_topbeforetrackingnumber; } From 12735f23f6ce4bf3f3008f1b0169e92c48e26d84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Mar 2023 12:55:17 +0200 Subject: [PATCH 08/12] Fix doc comment --- htdocs/compta/facture/class/facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 22fa0a79b50..2419050cafc 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5425,10 +5425,10 @@ class Facture extends CommonInvoice /** - * Send reminders by emails for ivoices that are due + * Send reminders by emails for invoices that are due * CAN BE A CRON TASK * - * @param int $nbdays Delay after due date (or before if delay is negative) + * @param int $nbdays Delay before due date (or after if delay is negative) * @param string $paymentmode '' or 'all' by default (no filter), or 'LIQ', 'CHQ', CB', ... * @param int|string $template Name (or id) of email template (Must be a template of type 'facture_send') * @param string $forcerecipient Force email of recipient (for example to send the email to an accountant supervisor instead of the customer) From 1c1e93bb3783e80bcc730f0fcd8af941e13e3a54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Mar 2023 16:35:07 +0200 Subject: [PATCH 09/12] Fix use MT rounding for cost price and margin on list of invoice --- htdocs/compta/facture/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index c22d551be04..702cc057568 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1916,8 +1916,8 @@ if ($resql) { // Action column - if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } } // Total margin if (!empty($arrayfields['total_margin']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } @@ -2528,7 +2528,7 @@ if ($resql) { // Action column (Show the massaction button only when this page is not opend from the Extended POS) - if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { + if (!getDolGlobalInt('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; + print ''; } // Supplier From 28f4bea8a3b6d61f81cea2b64a82b6bf0ae475f4 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Wed, 29 Mar 2023 16:46:06 +0200 Subject: [PATCH 11/12] forceduedate is an option of the function --- htdocs/compta/facture/class/facture.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 2419050cafc..3d37de709c1 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -586,8 +586,6 @@ class Facture extends CommonInvoice // We do not add link to template invoice or next invoice will be linked to all generated invoices //$this->linked_objects['facturerec'][0] = $this->fac_rec; - $forceduedate = $this->calculate_date_lim_reglement(); - // For recurring invoices, update date and number of last generation of recurring template invoice, before inserting new invoice if ($_facrec->frequency > 0) { dol_syslog("This is a recurring invoice so we set date_last_gen and next date_when"); From a30f9331f30a74fc0f4170ffbc77ef16aa5ef6f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Mar 2023 01:36:20 +0200 Subject: [PATCH 12/12] Debug v17 --- htdocs/compta/facture/class/facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3d37de709c1..af8caa73b12 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -569,6 +569,7 @@ class Facture extends CommonInvoice $this->type = self::TYPE_STANDARD; } $this->ref_client = trim($this->ref_client); + $this->ref_customer = trim($this->ref_customer); $this->note_public = trim($this->note_public); $this->note_private = trim($this->note_private); $this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->ref));
'; + if (getDolGlobalInt('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($obj->id, $arrayofselected)) { @@ -2407,14 +2407,14 @@ if ($resql) { // Total buying or cost price if (!empty($arrayfields['total_pa']['checked'])) { - print ''.price($marginInfo['pa_total']).''.price($marginInfo['pa_total'], 0, $langs, 1, -1, 'MT').''.price($marginInfo['total_margin']).''.price($marginInfo['total_margin'], 0, $langs, 1, -1, 'MT').''; if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; From 230759ca1448a6d1c0449e125bfed1b50a3c3f81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Mar 2023 01:14:48 +0200 Subject: [PATCH 10/12] Fix #24391 --- htdocs/product/fournisseurs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 0604ec6a6d0..a6922471bd1 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -1106,7 +1106,7 @@ END; // Date from if (!empty($arrayfields['pfp.datec']['checked'])) { - print ''.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour').''.dol_print_date(($productfourn->fourn_date_creation ? $productfourn->fourn_date_creation : $productfourn->date_creation), 'dayhour', 'tzuserrel').'