From ecea726323b695197955d1fd01544aa7aa26cfbb Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 7 Feb 2020 14:53:42 +0100 Subject: [PATCH 01/10] FIX CA by prod list filter --- htdocs/compta/stats/cabyprodserv.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index e7a3d4da480..a2a8b734b17 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -122,22 +122,24 @@ $year_end = $tmpe['year']; $nbofyear = ($year_end - $year_start) + 1; $commonparams=array(); -$commonparams['modecompta']=$modecompta; -$commonparams['sortorder'] = $sortorder; -$commonparams['sortfield'] = $sortfield; +if(!empty($modecompta)) $commonparams['modecompta']=$modecompta; +if(!empty($sortorder)) $commonparams['sortorder'] = $sortorder; +if(!empty($sortfield)) $commonparams['sortfield'] = $sortfield; $headerparams = array(); -$headerparams['date_startyear'] = $date_startyear; -$headerparams['date_startmonth'] = $date_startmonth; -$headerparams['date_startday'] = $date_startday; -$headerparams['date_endyear'] = $date_endyear; -$headerparams['date_endmonth'] = $date_endmonth; -$headerparams['date_endday'] = $date_endday; +if(!empty($date_startyear)) $headerparams['date_startyear'] = $date_startyear; +if(!empty($date_startmonth)) $headerparams['date_startmonth'] = $date_startmonth; +if(!empty($date_startday)) $headerparams['date_startday'] = $date_startday; +if(!empty($date_endyear)) $headerparams['date_endyear'] = $date_endyear; +if(!empty($date_endmonth)) $headerparams['date_endmonth'] = $date_endmonth; +if(!empty($date_endday)) $headerparams['date_endday'] = $date_endday; +if(!empty($year)) $headerparams['year'] = $year; +if(!empty($month)) $headerparams['month'] = $month; $headerparams['q'] = $q; $tableparams = array(); -$tableparams['search_categ'] = $selected_cat; -$tableparams['search_type'] = $selected_type; +if(!empty($selected_cat)) $tableparams['search_categ'] = $selected_cat; +if(!empty($selected_type)) $tableparams['search_type'] = $selected_type; $tableparams['subcat'] = ($subcat === true)?'yes':''; // Adding common parameters From de8660fb5581d557bbb3e920a3fb4b3165fba171 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 12 Feb 2020 12:09:03 +0100 Subject: [PATCH 02/10] FIX: situation invoice: allow excess paid to be converted to discount --- htdocs/compta/facture/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 62f5899c025..d99e26a65be 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -682,7 +682,7 @@ if (empty($reshook)) $canconvert=0; if ($object->type == Facture::TYPE_DEPOSIT && empty($discountcheck->id)) $canconvert=1; // we can convert deposit into discount if deposit is payed (completely, partially or not at all) and not already converted (see real condition into condition used to show button converttoreduc) - if (($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_STANDARD) && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and not already converted and amount of payment is 0 (see real condition into condition used to show button converttoreduc) + if (($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && $object->paye == 0 && empty($discountcheck->id)) $canconvert=1; // we can convert credit note into discount if credit note is not payed back and not already converted and amount of payment is 0 (see real condition into condition used to show button converttoreduc) if ($canconvert) { $db->begin(); @@ -3409,7 +3409,7 @@ else if ($id > 0 || ! empty($ref)) // Confirmation de la conversion de l'avoir en reduc if ($action == 'converttoreduc') { - if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived'; + if($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) $type_fac = 'ExcessReceived'; elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote'; elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit'; $text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac))); @@ -4698,7 +4698,7 @@ else if ($id > 0 || ! empty($ref)) } // Reverse back money or convert to reduction - if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD) { + if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) { // For credit note only if ($object->type == Facture::TYPE_CREDIT_NOTE && $object->statut == 1 && $object->paye == 0 && $user->rights->facture->paiement) { @@ -4713,7 +4713,7 @@ else if ($id > 0 || ! empty($ref)) } // For standard invoice with excess received - if ($object->type == Facture::TYPE_STANDARD && empty($object->paye) && ($object->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits) < 0 && $user->rights->facture->creer && empty($discount->id)) + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_SITUATION) && empty($object->paye) && $resteapayer < 0 && $user->rights->facture->creer && empty($discount->id)) { print ''; } From b1b00450a9f2ff6f3f6890f539281872e117540b Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 12 Feb 2020 12:10:48 +0100 Subject: [PATCH 03/10] FIX: situation invoice: bad amount for previous payments because of local variable overwriting a more global one --- htdocs/compta/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index d99e26a65be..16dc6e82fd0 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4133,7 +4133,7 @@ else if ($id > 0 || ! empty($ref)) $current_situation_counter = array(); foreach ($object->tab_previous_situation_invoice as $prev_invoice) { - $totalpaye = $prev_invoice->getSommePaiement(); + $totalpaye_prev = $prev_invoice->getSommePaiement(); $total_prev_ht += $prev_invoice->total_ht; $total_prev_ttc += $prev_invoice->total_ttc; $current_situation_counter[] = (($prev_invoice->type == Facture::TYPE_CREDIT_NOTE)?-1:1) * $prev_invoice->situation_counter; @@ -4144,7 +4144,7 @@ else if ($id > 0 || ! empty($ref)) if (! empty($conf->banque->enabled)) print ''; print '' . price($prev_invoice->total_ht) . ''; print '' . price($prev_invoice->total_ttc) . ''; - print '' . $prev_invoice->getLibStatut(3, $totalpaye) . ''; + print '' . $prev_invoice->getLibStatut(3, $totalpaye_prev) . ''; print ''; } } From 4f1c8e7f53ed7e9aea5baf3a4c11e2f6235084ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 12:18:26 +0100 Subject: [PATCH 04/10] FIX #10203 --- htdocs/admin/mails.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 474c6020610..5275b77fa14 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -134,9 +134,8 @@ $head = email_admin_prepare_head(); // List of sending methods $listofmethods = array(); $listofmethods['mail'] = 'PHP mail function'; -//$listofmethods['simplemail']='Simplemail class'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; -$listofmethods['swiftmailer'] = 'Swift Mailer socket library'; +if (version_compare(phpversion(), '7.0', '>=')) $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; if ($action == 'edit') From ec30938a07d257e17867731d3fe6e3a0dae04eff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 15:43:53 +0100 Subject: [PATCH 05/10] Fix phpcs --- htdocs/compta/paiement/class/paiement.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 87a8d5547ee..71c8596e00a 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -604,7 +604,6 @@ class Paiement extends CommonObject * @param string $emetteur_nom Name of transmitter * @param string $emetteur_banque Name of bank * @param int $notrigger No trigger - * @param string $num_chq Numero of cheque * @return int <0 if KO, bank_line_id if OK */ public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque, $notrigger = 0) From bb895cb1d82f242011c583946ea4ea560492b85b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:00:59 +0100 Subject: [PATCH 06/10] FIX ref_client not visible in tooltip. --- htdocs/comm/propal/list.php | 3 ++- htdocs/commande/list.php | 2 +- htdocs/compta/facture/list.php | 3 ++- htdocs/fourn/facture/list.php | 12 ++++++------ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index eee15e0a0c0..4bb794a372a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -765,6 +765,7 @@ if ($resql) $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; + $objectstatic->ref_client = $obj->ref_client; $objectstatic->note_public = $obj->note_public; $objectstatic->note_private = $obj->note_private; @@ -813,7 +814,7 @@ if ($resql) if (!empty($arrayfields['p.ref_client']['checked'])) { // Customer ref - print ''; + print ''; print $obj->ref_client; print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0f1b6e24e54..3971914304d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -941,7 +941,7 @@ if ($resql) // Ref customer if (!empty($arrayfields['c.ref_client']['checked'])) { - print ''.$obj->ref_client.''; + print ''.$obj->ref_client.''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index db1ba28c14e..6fe15241c5a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -982,6 +982,7 @@ if ($resql) $facturestatic->id = $obj->id; $facturestatic->ref = $obj->ref; + $facturestatic->ref_client = $obj->ref_client; $facturestatic->type = $obj->type; $facturestatic->total_ht = $obj->total_ht; $facturestatic->total_tva = $obj->total_vat; @@ -1071,7 +1072,7 @@ if ($resql) // Customer ref if (!empty($arrayfields['f.ref_client']['checked'])) { - print ''; + print ''; print $obj->ref_client; print ''; if (!$i) $totalarray['nbfield']++; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9b865cae3e6..6dc24c71b57 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -433,8 +433,8 @@ if ($resql) } $param = '&socid='.$socid; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); if ($search_all) $param .= '&search_all='.urlencode($search_all); if ($day) $param .= '&day='.urlencode($day); if ($month) $param .= '&month='.urlencode($month); @@ -455,9 +455,9 @@ if ($resql) if ($search_amount_no_tax) $param .= '&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param .= '&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($search_status >= 0) $param .= "&search_status=".urlencode($search_status); - if ($show_files) $param .= '&show_files='.$show_files; - if ($option) $param .= "&option=".$option; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; + if ($show_files) $param .= '&show_files='.urlencode($show_files); + if ($option) $param .= "&option=".urlencode($option); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -879,7 +879,7 @@ if ($resql) // Supplier ref if (!empty($arrayfields['f.ref_supplier']['checked'])) { - print ''; + print ''; print $obj->ref_supplier; print ''; if (!$i) $totalarray['nbfield']++; From e0dd31389ca739489ca0bb6ac95178c0318e7102 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:05:02 +0100 Subject: [PATCH 07/10] Prepare 11.0.1 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 5c854d0ecb1..a498c933d4b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE', 'Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION', '11.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO', chr(128)); From f0596b4bcfab919947f34806809ccc5936652ce3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 13 Feb 2020 18:11:48 +0100 Subject: [PATCH 08/10] Prepare 11.0.1 --- ChangeLog | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6980edf4e6f..b11910d25c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,78 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 11.0.1 compared to 11.0.0 ***** +FIX: advanced target emailing sql and ergonomy. +FIX: After import of a website template, home page was not set. +FIX: Avoid deletion of bank record if in accounting +FIX: compatibility with multicompany (avoid duplicate data) +FIX: Confusion between 'bank reconciled' and 'accounted'. Show both data. +FIX: Count of Stripe payment mode must take test/live into account +FIX: Creation of Stripe card from backoffice must return a clean message +FIX: CVE-2019–17223 +FIX: CVE-2019–17223 +FIX: CVE-2020-7994 +FIX: CVE Need permission to be able to develop modules +FIX: #13053 +FIX: Disable ticket status change if ticket closed +FIX: doc of dictionnary API +FIX: expedition ceate line new parameter is not required. +FIX: export ledger +FIX: FEC export have specific name +FIX: Filenames must not contains non ascii char or we will get non ascii +FIX: Filter on list of events were lost after "Back to list" +FIX: hasDelay for retained warranty +FIX: If we can change vendor status, we must be able to chane vendor code +FIX: links in products/services index +FIX: Log of authentication ok or ko + CVE-2020-7996 +FIX: Look and feel v11 +FIX: Mail smtps truncated if content has a line with single . +FIX: missing hook parameter +FIX: Missing include +FIX: need weight short label in shipping doc +FIX: Picture of contact not visible in tooltip +FIX: Problem with column label in subscription list +FIX: ref_client not visible in tooltip. +FIX: search filter on extrafields were not restored after "Back to list" +FIX: situation invoice: allow excess paid to be converted to discount +FIX: situation invoice: bad amount for previous payments because of local variable overwriting a more global one +FIX: situation invoice: can't convert excess received to discount & bad previous payment amount +FIX: SQL request and phpunit +FIX: Update export_files.php +FIX: Use ref into label of ticket message +FIX: use "usergroup" instead of "user" +FIX: Warning on admin/export_files +FIX: #10203 +FIX: default filtering for 'select' extrafields should use "=", not "LIKE" +FIX: #11975 When a product is split between multiple pages in a document, prices/quantity/etc appear on the last relevant page +FIX: #12760 #12763 #12755 #12765 #12751 +FIX: #12874 +FIX: #12892 +FIX: #12908 User login with credentials from self-subscription form fails +FIX: #12932 +FIX: #12966 +FIX: #12973 +FIX: #12974 +FIX: #12975 +FIX: #12978 +FIX: #12986 +FIX: #12991 +FIX: #12992 +FIX: #12995 +FIX: #13018 Extrafields Supplier invoice +FIX: #13019 +FIX: #13022 +FIX: #13028 +FIX: #13038 ExpenseReport PDF - custom category description is not correct +FIX: #13046 More complete +FIX: #13048 +FIX: #13050 +FIX: #13077 Replace left join with inner join (left join was useless) +FIX: #13085 +FIX: #13094 +FIX: #13096 +FIX: #13100 + ***** ChangeLog for 11.0.0 compared to 10.0.0 ***** For Users: From 72e59e6fe2be1ddce1261eeb278f619fa8d02719 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 14 Feb 2020 16:07:06 +0100 Subject: [PATCH 09/10] FIX: Force FEC export to txt format --- htdocs/accountancy/tpl/export_journal.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/tpl/export_journal.tpl.php b/htdocs/accountancy/tpl/export_journal.tpl.php index ca3c9c49ea0..810d95a9ca3 100644 --- a/htdocs/accountancy/tpl/export_journal.tpl.php +++ b/htdocs/accountancy/tpl/export_journal.tpl.php @@ -55,7 +55,7 @@ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "genera $endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard'); - $completefilename = $siren . "FEC" . $endaccountingperiod . "." . $format; + $completefilename = $siren . "FEC" . $endaccountingperiod . ".txt"; } else { From 3faed758b32320ff614a1fb22cfb035686500389 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Feb 2020 19:04:08 +0100 Subject: [PATCH 10/10] FIX #13110 --- htdocs/accountancy/journal/bankjournal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 3757a6ab766..8372a728cd2 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -663,7 +663,7 @@ if (! $error && $action == 'writebookkeeping') { } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"]; + $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $accountingaccount->fetch(null, $bookkeeping->numero_compte, true); $bookkeeping->label_compte = $accountingaccount->label;