From 210e0511d0fdf95e78efb4ecef2e2bf5ee0d6098 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:45:16 +0100 Subject: [PATCH 1/9] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 34da3336bcc..66dd6338c9d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -193,6 +193,7 @@ else } print "\n"; +print ''; print '
'; @@ -221,6 +222,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); + if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0 + { + $page = 0; + $offset = 0; + } } $sql.= $db->plimit($limit+1, $offset); @@ -236,11 +242,12 @@ if ($resql) if($socid) $param .= '&socid='.urlencode($socid); if($option) $param .= "&option=".urlencode($option); - if(! empty($page) && $num <= $nbtotalofrecords) $page = 0; - print '
'; print ''; - print ''; + print ''; + if (! empty($limit)) { + print ''; + } print_barre_liste($langs->trans("InvoiceWaitingWithdraw"), $page, $_SERVER['PHP_SELF'], $param, '', '', '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit); @@ -300,6 +307,7 @@ if ($resql) } else print ''.$langs->trans("None").''; print ""; + print ''; print "
"; print "
\n"; } From 5ad5578f4059d0952fe6672c18a00c67a5ab384c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:47:00 +0100 Subject: [PATCH 2/9] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/create.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 66dd6338c9d..eec72ee4b1e 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -307,7 +307,6 @@ if ($resql) } else print ''.$langs->trans("None").''; print ""; - print ''; print ""; print "
\n"; } From 62caf3cbfc1d6f1e72514a57ea6a11156c87c61c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Jan 2020 17:59:50 +0100 Subject: [PATCH 3/9] fix create SEPA withdraw with limit select and working pagination --- htdocs/compta/prelevement/demandes.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 6c1ea278430..da1b3663d21 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -140,8 +140,6 @@ else $newcardbutton = ''.$langs->trans("Back").''; -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); - print '
'; if ($optioncss != '') print ''; print ''; @@ -152,6 +150,7 @@ print ''; print ''; print ''; +print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_generic', 0, $newcardbutton, '', $limit); print ''; From 1f18c93b9f79fd1542b68e5da02de4e97b28432f Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 12:06:22 +0100 Subject: [PATCH 4/9] FIX : thirdparty alias name desappeared if we change country with THIRDPARTY_SUGGEST_ALSO_ADDRESS_CREATION conf --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From f5395fa859bf6423e46faaa06e4db60cc1f4def1 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 14:28:08 +0100 Subject: [PATCH 5/9] fix lost name_alias on country selection --- htdocs/societe/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 3f7b97fee73..d277632c348 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -950,6 +950,7 @@ else if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || (GETPOST("type")=='' && ! empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)))) { $object->fournisseur=1; } $object->name = GETPOST('name', 'alpha'); + $object->name_alias = GETPOST('name_alias', 'alpha'); $object->firstname = GETPOST('firstname', 'alpha'); $object->particulier = $private; $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); From f63893a90cf4600b5436e17cf71def45e9bbd647 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 24 Jan 2020 15:10:57 +0100 Subject: [PATCH 6/9] FIX date filter not used if no operator --- htdocs/contrat/services_list.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 07b5cceee1a..93c09d7f256 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -242,9 +242,17 @@ if ($search_contract) $sql.= " AND c.ref LIKE '%".$db->escape($search_contract). if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; $filter_dateouvertureprevue=dol_mktime(0, 0, 0, $opouvertureprevuemonth, $opouvertureprevueday, $opouvertureprevueyear); +if ($filter_dateouvertureprevue != '' && $filter_opouvertureprevue == -1) $filter_opouvertureprevue = '='; + $filter_date1=dol_mktime(0, 0, 0, $op1month, $op1day, $op1year); +if ($filter_date1 != '' && $filter_op1 == -1) $filter_op1 = '='; + $filter_date2=dol_mktime(0, 0, 0, $op2month, $op2day, $op2year); +if ($filter_date2 != '' && $filter_op2 == -1) $filter_op2 = '='; + $filter_datecloture=dol_mktime(0, 0, 0, $opcloturemonth, $opclotureday, $opclotureyear); +if ($filter_datecloture != '' && $filter_opcloture == -1) $filter_opcloture = '='; + if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; @@ -253,6 +261,8 @@ if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $sql .= $db->order($sortfield, $sortorder); +//print $sql; + $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { From 4222639702d0bab73fd1a0f2576caa2a06af7a89 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 24 Jan 2020 15:32:59 +0100 Subject: [PATCH 7/9] FIX : Extrafield position in export field list must respect "pos" field --- htdocs/core/extrafieldsinexport.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 78dbba9934e..e9d10138d1e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -8,7 +8,7 @@ if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra)) } // Add extra fields -$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.')'; +$sql="SELECT name, label, type, param, fieldcomputed, fielddefault FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = '".$keyforselect."' AND type != 'separate' AND entity IN (0, ".$conf->entity.') ORDER BY pos ASC'; //print $sql; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) From c64acb1a9c414c577fc275e2382174b0ec5a8438 Mon Sep 17 00:00:00 2001 From: Pierre Ardoin <32256817+mapiolca@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:19:46 +0100 Subject: [PATCH 8/9] Permissions Issue fixes an issue that displayed the "restricted area" banner despite user permissions. --- htdocs/compta/tva/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 8e4962a6351..8ea2de95efa 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -49,7 +49,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'tax', $id, 'vat', 'charges'); +$result = restrictedArea($user, 'tax', '', 'vat', 'charges'); // Get parameters From ecaacc9543d023babf437bfdd4c0918f5dd8b6c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 Jan 2020 23:27:47 +0100 Subject: [PATCH 9/9] FIX #12875 --- htdocs/fourn/ajax/getSupplierPrices.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php index 85b0ed37155..495337ade14 100644 --- a/htdocs/fourn/ajax/getSupplierPrices.php +++ b/htdocs/fourn/ajax/getSupplierPrices.php @@ -84,16 +84,16 @@ if ($idprod > 0) } } - // Add price for costprice - $price=$producttmp->cost_price; - $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() - if(!empty($conf->stock->enabled)) { // Add price for pmp $price=$producttmp->pmp; $prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } + + // Add price for costprice + $price=$producttmp->cost_price; + $prices[] = array("id" => 'costprice', "price" => price2num($price), "label" => $langs->trans("CostPrice").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price, 0, $langs, 0, 0, -1, $conf->currency)); // For price field, we must use price2num(), for label or title, price() } echo json_encode($prices);