From 0b6c7d2d63892a6568a95aa941d817712e64422b Mon Sep 17 00:00:00 2001 From: atm-arnaud Date: Thu, 4 Apr 2019 11:17:44 +0200 Subject: [PATCH 1/8] FIX shipping default warehouse if only one warehouse --- htdocs/expedition/shipment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index bbf990f2ec6..c92962357b2 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -894,7 +894,7 @@ if ($id > 0 || ! empty($ref)) print $langs->trans("WarehouseSource"); //print ''; //print ''; - print $formproduct->selectWarehouses(! empty($object->warehouse_id)?$object->warehouse_id:-1, 'entrepot_id', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200'); + print $formproduct->selectWarehouses(! empty($object->warehouse_id)?$object->warehouse_id:'ifone', 'entrepot_id', '', 1, 0, 0, '', 0, 0, array(), 'minwidth200'); if (count($formproduct->cache_warehouses) <= 0) { print '   '.$langs->trans("WarehouseSourceNotDefined").' '.$langs->trans("AddOne").''; From ba34b601b314a45abc5666d485ff59ac099a781b Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 4 Apr 2019 16:44:36 +0200 Subject: [PATCH 2/8] FIX: MultiEntity in lettering functionality --- htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php | 1 + htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php index 3fdda686eab..1d370176613 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_customer.php @@ -150,6 +150,7 @@ if (dol_strlen($search_year)) { $sql .= " AND ( bk.doc_date BETWEEN '" . $db->idate($date_start) . "' AND '" . $db->idate($date_end) . "' )"; } +$sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')'; $sql .= $db->order($sortfield, $sortorder); $debit = 0; diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php index 8cd51847b1e..1d80bda7710 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettering_supplier.php @@ -149,6 +149,7 @@ if (dol_strlen($search_year)) { $sql .= " AND ( bk.doc_date BETWEEN '".$db->idate($date_start)."' AND '".$db->idate($date_end)."' )"; } +$sql.= ' AND bk.entity IN ('.getEntity('accountingbookkeeping').')'; $sql.= $db->order($sortfield,$sortorder); $debit = 0; From ea87b2ddb682378d19cb4d2892690080482a19f5 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 5 Apr 2019 11:26:11 +0200 Subject: [PATCH 3/8] Fix no init hook on timesheet --- htdocs/projet/activity/perday.php | 2 ++ htdocs/projet/activity/perweek.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 164a7462e83..79a52bcd87f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -36,6 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $langs->loadLangs(array('projects','users','companies')); +$hookmanager->initHooks(array('perdaycard')); + $action=GETPOST('action','aZ09'); $mode=GETPOST("mode",'alpha'); $id=GETPOST('id','int'); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index 97574fa555f..ff5b1ad0d6c 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -36,6 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $langs->loadLangs(array('projects','users','companies')); +$hookmanager->initHooks(array('perweekcard')); + $action=GETPOST('action','aZ09'); $mode=GETPOST("mode",'alpha'); $id=GETPOST('id','int'); From 66142cef7623ff0b1afe7fd981621580edb877f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2019 18:40:37 +0200 Subject: [PATCH 4/8] Prepare 9.0.2 --- ChangeLog | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/ChangeLog b/ChangeLog index cbba717e6a8..be49258c986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,58 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 9.0.2 compared to 9.0.1 ***** +FIX: #10822 +FIX: Accountancy - Format EBP import +FIX: A page of a site replaced with another when switching in edit mode +FIX: Autodetect buy price for invoices autogenerated with templates. +FIX: Avoid error 500 when extension php-intl not loaded +FIX: bad check on type of expense report (mandatory status not working) +FIX: Bad label of status for members (must be short version in list) +FIX: better method +FIX: Can not create contract with numbering module without autogen rule +FIX: Can't insert if there is extrafields mandatory on another entity. +FIX: Can't set default value of extrafield of type varchar +FIX: check only if invoice module is enabled (bank is check after) +FIX: counter of permissions in badge was wrong +FIX: default value of language of thirdparty +FIX: Don't show accountingjournal:getNomUrl without data +FIX: Don't show journal:getNomUrl without data +FIX: Duplicate executeHook function +FIX: Edit of personalized groups +FIX: Error with various & salary payment on project +FIX: extrafields always visible on view mode +FIX: function not found +FIX: If we build one invoice for several orders, we must put the ref of +FIX: in fact expensereport must be in $check array +FIX: missing entity filter and wrong var name +FIX: Missing field "In sale" in list +FIX: missing hook completeTabsHead in margins module +FIX: missing hook in agenda export +FIX: missing vat_src_code when inserting an expense report line +FIX: More complete auto setup of barcode module +FIX: need to round with 2 decimals to avoid movements not correctly balanced +FIX: no need to test anything to display documents tabs on expense report +FIX: old export models was not visible +FIX: Param keepn must be 1 when dol_escape_htmltag used for textarea +FIX: possibility to set up payment mode when invoice module is disabled +FIX: problem with sign of various payment in project preview +FIX: Remane of project +FIX: setup of module export +FIX: several hooks in shipping/delivery cards +FIX: supplier discount was not retrieved when choosing a product +FIX: The minimum amount filter does not work in the VAT report per customer +FIX: The minimum amount filter does not work in VAT report by customer +FIX: Tooltip on click was ko on smartphone +FIX: translation +FIX: useless join +FIX: Vat src code lost after editing expense report line +FIX: we need to keep originline special_code +FIX: when 2 extra fields are mandatory in 2 different entities +FIX: when we create deposit with multi tva, we mustn't add line if a… +FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line) +FIX: wrong redirect link on holiday refuse +NEW: Add more complete error messages in log on stripe payments ***** ChangeLog for 9.0.1 compared to 9.0.0 ***** FIX: #10381 From 81ccf4d1f09a31a5b0bcb494ee9868b40079888b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Apr 2019 18:43:30 +0200 Subject: [PATCH 5/8] Update doc --- ChangeLog | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index be49258c986..4be15921a53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,22 +10,20 @@ FIX: Autodetect buy price for invoices autogenerated with templates. FIX: Avoid error 500 when extension php-intl not loaded FIX: bad check on type of expense report (mandatory status not working) FIX: Bad label of status for members (must be short version in list) -FIX: better method FIX: Can not create contract with numbering module without autogen rule -FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar FIX: check only if invoice module is enabled (bank is check after) FIX: counter of permissions in badge was wrong FIX: default value of language of thirdparty FIX: Don't show accountingjournal:getNomUrl without data -FIX: Don't show journal:getNomUrl without data FIX: Duplicate executeHook function FIX: Edit of personalized groups FIX: Error with various & salary payment on project FIX: extrafields always visible on view mode FIX: function not found FIX: If we build one invoice for several orders, we must put the ref of -FIX: in fact expensereport must be in $check array + orders on lines. +FIX: expensereport must be in $check array FIX: missing entity filter and wrong var name FIX: Missing field "In sale" in list FIX: missing hook completeTabsHead in margins module @@ -43,14 +41,13 @@ FIX: setup of module export FIX: several hooks in shipping/delivery cards FIX: supplier discount was not retrieved when choosing a product FIX: The minimum amount filter does not work in the VAT report per customer -FIX: The minimum amount filter does not work in VAT report by customer FIX: Tooltip on click was ko on smartphone FIX: translation FIX: useless join FIX: Vat src code lost after editing expense report line FIX: we need to keep originline special_code -FIX: when 2 extra fields are mandatory in 2 different entities -FIX: when we create deposit with multi tva, we mustn't add line if a… +FIX: Can't insert if there is extrafields mandatory on another entity. +FIX: error in create object when 2 extra fields are mandatory in 2 different entities FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line) FIX: wrong redirect link on holiday refuse NEW: Add more complete error messages in log on stripe payments From b23f74eab1fade18196d79819679cd43684a5b2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Apr 2019 12:17:57 +0200 Subject: [PATCH 6/8] FIX Status of opportunity should never be -1 --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 1 + htdocs/projet/class/project.class.php | 2 +- htdocs/projet/list.php | 9 ++++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index d1cc00f403f..2d45d94aafd 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -285,5 +285,6 @@ DELETE from llx_accounting_account where rowid in (select minid from tmp_llx_acc ALTER TABLE llx_accounting_account DROP INDEX uk_accounting_account; ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version); +UPDATE llx_projet SET fk_opp_status = NULL WHERE fk_opp_status = -1; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b2642542770..4e749f4575d 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -226,7 +226,7 @@ class Project extends CommonObject $sql.= ", " . ($this->socid > 0 ? $this->socid : "null"); $sql.= ", " . $user->id; $sql.= ", ".(is_numeric($this->statut) ? $this->statut : '0'); - $sql.= ", ".(is_numeric($this->opp_status) ? $this->opp_status : 'NULL'); + $sql.= ", ".((is_numeric($this->opp_status) && $this->opp_status > 0) ? $this->opp_status : 'NULL'); $sql.= ", ".(is_numeric($this->opp_percent) ? $this->opp_percent : 'NULL'); $sql.= ", " . ($this->public ? 1 : 0); $sql.= ", '".$this->db->idate($now)."'"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index ba45a5b0b32..181e3f36f88 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -276,7 +276,6 @@ if ($resql) else dol_print_error($db); if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid sql syntax error if not found - $distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once. $sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat"; $sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; @@ -350,10 +349,10 @@ if ($search_status >= 0) if ($search_opp_status) { if (is_numeric($search_opp_status) && $search_opp_status > 0) $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status); - if ($search_opp_status == 'all') $sql .= " AND p.fk_opp_status IS NOT NULL"; - if ($search_opp_status == 'openedopp') $sql .= " AND p.fk_opp_status IS NOT NULL AND p.fk_opp_status NOT IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_lead_status WHERE code IN ('WON','LOST'))"; - if ($search_opp_status == 'notopenedopp') $sql .= " AND (p.fk_opp_status IS NULL OR p.fk_opp_status IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_lead_status WHERE code IN ('WON')))"; - if ($search_opp_status == 'none') $sql .= " AND p.fk_opp_status IS NULL"; + if ($search_opp_status == 'all') $sql .= " AND (p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1)"; + if ($search_opp_status == 'openedopp') $sql .= " AND p.fk_opp_status IS NOT NULL AND p.fk_opp_status <> -1 AND p.fk_opp_status NOT IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_lead_status WHERE code IN ('WON','LOST'))"; + if ($search_opp_status == 'notopenedopp') $sql .= " AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1 OR p.fk_opp_status IN (SELECT rowid FROM ".MAIN_DB_PREFIX."c_lead_status WHERE code IN ('WON')))"; + if ($search_opp_status == 'none') $sql .= " AND (p.fk_opp_status IS NULL OR p.fk_opp_status = -1)"; } if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public); // For external user, no check is done on company permission because readability is managed by public status of project and assignement. From 153e563c9f9ef38aa82b46c529a763aefac28f38 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Apr 2019 13:49:05 +0200 Subject: [PATCH 7/8] Update perday.php --- htdocs/projet/activity/perday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 79a52bcd87f..d894512a951 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $langs->loadLangs(array('projects','users','companies')); -$hookmanager->initHooks(array('perdaycard')); +$hookmanager->initHooks(array('timesheetperdaycard')); $action=GETPOST('action','aZ09'); $mode=GETPOST("mode",'alpha'); From c1f08260056a79db8deab4d2c6c3d4c1304845b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Apr 2019 13:49:16 +0200 Subject: [PATCH 8/8] Update perweek.php --- htdocs/projet/activity/perweek.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index ff5b1ad0d6c..c3405d1ef5f 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; $langs->loadLangs(array('projects','users','companies')); -$hookmanager->initHooks(array('perweekcard')); +$hookmanager->initHooks(array('timesheetperweekcard')); $action=GETPOST('action','aZ09'); $mode=GETPOST("mode",'alpha');