From a249f4f35a52d5d5fc367775b3467e6ae12f1bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Mestre?= Date: Wed, 10 Feb 2021 15:03:17 -0300 Subject: [PATCH 1/4] Fix #16241 Date filter resets on Miscellaneous Payments Changed $search_date_start and $search_date_end variables to get values from search_date_start and search_date_end GET parameters if no their value is empty after checking POST parameters --- htdocs/compta/bank/various_payment/list.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index befe2fa6905..2960a27583c 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -53,6 +53,8 @@ $search_accountancy_account = GETPOST("search_accountancy_account"); if ($search_accountancy_account == - 1) $search_accountancy_account = ''; $search_accountancy_subledger = GETPOST("search_accountancy_subledger"); if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = ''; +if (empty($search_date_start)) $search_date_start = GETPOST("search_date_start", 'int'); +if (empty($search_date_end)) $search_date_end = GETPOST("search_date_end", 'int'); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); From 83f9451b43e3c4dd9cb77c20a5d014c256b4638c Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 11 Feb 2021 13:17:20 +0100 Subject: [PATCH 2/4] FIX: Accountancy - Fix some problems on CEGID export --- htdocs/accountancy/class/accountancyexport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 60f2d5576b9..6fd3518689d 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -332,9 +332,9 @@ class AccountancyExport print length_accountg($line->numero_compte).$separator; print length_accounta($line->subledger_account).$separator; print $line->sens.$separator; - print price($line->montant).$separator; - print $line->label_operation.$separator; - print $line->doc_ref; + print price2fec(abs($line->montant)).$separator; + print dol_string_unaccent($line->label_operation).$separator; + print dol_string_unaccent($line->doc_ref); print $end_line; } } From 1b69456216d9b4bf232e2e2ba215b10c3dab5e2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Feb 2021 13:00:21 +0100 Subject: [PATCH 3/4] Complete response --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fc50c21f793..e8ba8fae64a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3044,10 +3044,10 @@ class Form // Add new entry - // "key" value of json key array is used by jQuery automatically as selected value + // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax // "label" value of json key array is used by jQuery automatically as text for combo box $out .= $opt; - array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'up'=>price2num($objp->unitprice, 'MT'), 'discount'=>$outdiscount, 'type'=>$outtype, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'disabled'=>(empty($objp->idprodfournprice) ?true:false))); + array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'price_ht'=>price2num($objp->unitprice, 'MT'), 'up'=>price2num($objp->unitprice, 'MT'), 'discount'=>$outdiscount, 'type'=>$outtype, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'disabled'=>(empty($objp->idprodfournprice) ?true:false))); // Exemple of var_dump $outarray // array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp" // ["label"]=>string(76) "ppp (fff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)" From 613284358617739b148c093b61260d3eae59646f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 15 Feb 2021 16:43:24 +0100 Subject: [PATCH 4/4] FIX Filter on date of next generation on template invoices --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index f6da540f735..d8ef32f0e17 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -274,7 +274,7 @@ if ($search_status != '' && $search_status >= -1) if ($search_status == -1) $sql .= ' AND suspended = 1'; } $sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year); -$sql .= dolSqlDateFilter('f.date_last_gen', $search_day_date_when, $search_month_date_when, $search_year_date_when); +$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when); $sql .= $db->order($sortfield, $sortorder);