From 06fe172669500d3e5b8d5fd0163695da58c35205 Mon Sep 17 00:00:00 2001 From: Philippe Date: Thu, 27 Sep 2018 20:06:00 +0200 Subject: [PATCH 01/40] FIX Product marge tabs on product card Credit note are not negative so the grand total are false --- htdocs/margin/tabs/productMargins.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 9175736d5db..f899d112a2d 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -138,9 +138,9 @@ if ($id > 0 || ! empty($ref)) $sql.= " f.datef, f.paye, f.fk_statut as statut, f.type,"; if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,"; $sql.= " sum(d.total_ht) as selling_price,"; // may be negative or positive - $sql.= " sum(d.qty) as qty,"; - $sql.= " sum(d.qty * d.buy_price_ht) as buying_price,"; // always positive - $sql.= " sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge" ; // always positive + $sql.= " IF(f.type = 2, -1, 1) * sum(d.qty) as qty,"; // not always positive in case of Credit note + $sql.= " IF(f.type = 2, -1, 1) * sum(d.qty * d.buy_price_ht) as buying_price,"; // not always positive in case of Credit note + $sql.= " IF(f.type = 2, -1, 1) * sum(abs(d.total_ht) - (d.buy_price_ht * d.qty)) as marge" ; // not always positive in case of Credit note $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; From 587766b39b835d029c5f3f1ecd12b3028d0ad9af Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 3 Oct 2018 10:38:47 +0200 Subject: [PATCH 02/40] FIX : wrong function name --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1d6c26caecd..36f1997ac85 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -440,7 +440,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 583ea055671f27eaf845b8c9b5a7061e65ef816a Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Oct 2018 12:13:53 +0200 Subject: [PATCH 03/40] fix missing letter... --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 66caf2ea23a..31c6b613e24 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -438,7 +438,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 2acd69033cf233d7716cdc1001f2b5ae9db419b0 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 3 Oct 2018 22:48:29 +0200 Subject: [PATCH 04/40] Fix minor error in dom --- 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 1797617a26d..f760dd32cc1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2806,7 +2806,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($picto == 'off') { $fakey = 'fa-square-o'; $fasize='1.3em'; } if ($picto == 'on') { $fakey = 'fa-check-square-o'; $fasize='1.3em'; } $enabledisablehtml=''; - $enabledisablehtml.=''; + $enabledisablehtml.=''; if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $enabledisablehtml.=$titlealt; $enabledisablehtml.=''; return $enabledisablehtml; From 292dab192b5f9547e86127fbcfda26b4a842fa0b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Oct 2018 09:42:11 +0200 Subject: [PATCH 05/40] FIX : #9161 --- htdocs/core/lib/company.lib.php | 40 ++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2dd4cf090f5..9440f911eeb 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1213,6 +1213,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= global $param; + dol_include_once('/comm/action/class/actioncomm.class.php'); + // Check parameters if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter'); @@ -1261,6 +1263,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'"; if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id; } + //TODO check how ot work with new table actioncomm_resources and multiple contact affectation if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id; // Condition on actioncode if (! empty($actioncode)) @@ -1297,6 +1300,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= { $obj = $db->fetch_object($resql); + $contactaction = new ActionComm($db); + $contactaction->id=$obj->id; + $result = $contactaction->fetchResources(); + if ($result<0) { + dol_print_error($db); + setEventMessage("company.lib::show_actions_done Error fetch ressource"); + } + //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; //if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))"; $tododone=''; @@ -1318,6 +1329,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= 'userphoto'=>$obj->user_photo, 'contact_id'=>$obj->fk_contact, + 'socpeopleassigned' => $contactaction->socpeopleassigned, 'lastname'=>$obj->lastname, 'firstname'=>$obj->firstname, 'fk_element'=>$obj->fk_element, @@ -1470,7 +1482,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); $out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder); $out.=getTitleFieldOfList(''); - $out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], 'a.fk_contact', '', $param, '', $sortfield, $sortorder); + $out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); $out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder); $out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch '); $out.=''; @@ -1616,11 +1628,33 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $contactstatic->lastname=$histo[$key]['lastname']; $contactstatic->firstname=$histo[$key]['firstname']; $contactstatic->id=$histo[$key]['contact_id']; + var_dump($histo[$key]['contact_id']); $out.=''.$contactstatic->getNomUrl(1,'',10).''; } - else + elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned'])>0) { - $out.=' '; + $out.=''; + foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) + { + $contact = new Contact($db); + $result = $contact->fetch($cid); + + if ($result < 0) dol_print_error($db,$contact->error); + + if ($result > 0) + { + $out.= $contact->getNomUrl(1); + if ($object->type_code == 'AC_TEL') + { + if (!empty($contact->phone_pro)) $out.= '('.dol_print_phone($contact->phone_pro).')'; + } + $out.= '
'; + } + } + $out.=''; + } + else { + $out.=' '; } // Status From 7f4f27ebfec407b419ed2e782881d4b0d05691de Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Oct 2018 09:45:12 +0200 Subject: [PATCH 06/40] indent --- htdocs/core/lib/company.lib.php | 41 +++++++++++++++------------------ 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 9440f911eeb..4dfbe47e9e3 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1305,7 +1305,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $result = $contactaction->fetchResources(); if ($result<0) { dol_print_error($db); - setEventMessage("company.lib::show_actions_done Error fetch ressource"); + setEventMessage("company.lib::show_actions_done Error fetch ressource",'errors'); } //if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))"; @@ -1630,29 +1630,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $contactstatic->id=$histo[$key]['contact_id']; var_dump($histo[$key]['contact_id']); $out.=''.$contactstatic->getNomUrl(1,'',10).''; - } - elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned'])>0) - { - $out.=''; - foreach ($histo[$key]['socpeopleassigned'] as $cid => $Tab) - { - $contact = new Contact($db); - $result = $contact->fetch($cid); + } elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) { + $out .= ''; + foreach ( $histo[$key]['socpeopleassigned'] as $cid => $Tab ) { + $contact = new Contact($db); + $result = $contact->fetch($cid); - if ($result < 0) dol_print_error($db,$contact->error); + if ($result < 0) + dol_print_error($db, $contact->error); - if ($result > 0) - { - $out.= $contact->getNomUrl(1); - if ($object->type_code == 'AC_TEL') - { - if (!empty($contact->phone_pro)) $out.= '('.dol_print_phone($contact->phone_pro).')'; - } - $out.= '
'; - } - } - $out.=''; - } + if ($result > 0) { + $out .= $contact->getNomUrl(1); + if ($object->type_code == 'AC_TEL') { + if (! empty($contact->phone_pro)) + $out .= '(' . dol_print_phone($contact->phone_pro) . ')'; + } + $out .= '
'; + } + } + $out .= ''; + } else { $out.=' '; } From e95921eb934d8d3f3d891978ad0cf489269777fc Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 4 Oct 2018 09:47:04 +0200 Subject: [PATCH 07/40] better test --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4dfbe47e9e3..02652892305 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1641,7 +1641,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= if ($result > 0) { $out .= $contact->getNomUrl(1); - if ($object->type_code == 'AC_TEL') { + if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') { if (! empty($contact->phone_pro)) $out .= '(' . dol_print_phone($contact->phone_pro) . ')'; } From c048f515624098ad0e8c19a66949cc3aa560aafc Mon Sep 17 00:00:00 2001 From: ATM-Nicolas Date: Thu, 4 Oct 2018 09:54:40 +0200 Subject: [PATCH 08/40] FIX : Wrong variable name --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 139fe355d3d..6c9822fd8a3 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -451,7 +451,7 @@ if ($search_month > 0) if ($search_year > 0 && empty($search_day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'"; else if ($search_year > 0 && ! empty($search_day)) - $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'"; + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'"; else $sql.= " AND date_format(f.datef, '%m') = '".$month."'"; } From 58d1ac427e1af794e662327b999291319e70a142 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 4 Oct 2018 10:57:22 +0200 Subject: [PATCH 09/40] Fix missing hook on sellsjournal --- htdocs/accountancy/journal/sellsjournal.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index b10e0d37c75..2c0ab7c1a2f 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -59,11 +59,15 @@ $now = dol_now(); if ($user->societe_id > 0) accessforbidden(); +$hookmanager->initHooks(array('sellsjournal')); +$parameters=array(); /* * Actions */ +$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks + // Get informations of journal $accountingjournalstatic = new AccountingJournal($db); $accountingjournalstatic->fetch($id_journal); From bfaf25ca2a0ace725b58ae45f92768dc7caded3e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 4 Oct 2018 16:55:16 +0200 Subject: [PATCH 10/40] Fix wrong value for module part and return access denied --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 890996bddce..4afde1e0ac4 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1611,7 +1611,7 @@ if ($id > 0) $var=true; - print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); + print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang); print '
'; From 68c99d01a7a545ec91965e2f717c2437d717733a Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 5 Oct 2018 10:35:32 +0200 Subject: [PATCH 11/40] OMG!!!! var_dump.... --- htdocs/core/lib/company.lib.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 02652892305..db6ef2de6cb 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1628,7 +1628,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $contactstatic->lastname=$histo[$key]['lastname']; $contactstatic->firstname=$histo[$key]['firstname']; $contactstatic->id=$histo[$key]['contact_id']; - var_dump($histo[$key]['contact_id']); $out.=''.$contactstatic->getNomUrl(1,'',10).''; } elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) { $out .= ''; From 82651cd920478b419d0677081be4a5fbd3e81b42 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 5 Oct 2018 12:12:04 +0200 Subject: [PATCH 12/40] FIX: invoice stats: situation invoices were not counted --- htdocs/compta/facture/class/facturestats.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index b6874862286..484d6447878 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -84,8 +84,8 @@ class FactureStats extends Stats $this->where.=" AND f.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid; - if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2)"; - else $this->where.= " AND f.type IN (0,1,2,3)"; + if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2,5)"; + else $this->where.= " AND f.type IN (0,1,2,3,5)"; } From 320ca3db673a9b8098ea3ffaadd1b460dc0b5780 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 6 Oct 2018 22:53:28 +0200 Subject: [PATCH 13/40] Fix request on project overview Fixes #9220 --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3263309187a..713e5ec74f1 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -291,7 +291,7 @@ $listofreferent=array( 'title'=>"ListSupplierProposalsAssociatedProject", 'class'=>'SupplierProposal', 'table'=>'supplier_proposal', - 'datefieldname'=>'date', + 'datefieldname'=>'datec', 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', From 021f9552dd91fb017d3ff403f3722d2bcc143365 Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 8 Oct 2018 15:41:31 +0200 Subject: [PATCH 14/40] FIX : when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup --- htdocs/user/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 704c04d2593..813d1e5ad05 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -194,7 +194,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; // TODO add hook if (! empty($conf->multicompany->enabled)) { if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (! empty($user->admin) && empty($user->entity)) { + if (! empty($user->admin)) { if ($conf->entity == 1) { $sql.= " WHERE u.entity IS NOT NULL"; } else { From c3f07dd2e08bd6b8cf67da2b76b1577d98de5014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 9 Oct 2018 19:28:52 +0200 Subject: [PATCH 15/40] define $code for all execution paths --- htdocs/societe/class/societe.class.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 729995a81d0..de5ce919a64 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1837,24 +1837,28 @@ class Societe extends CommonObject if (! empty($conf->global->SOCIETE_ADD_REF_IN_LIST) && (!empty($withpicto))) { + $code = ''; if (($this->client) && (! empty ( $this->code_client )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 2 ) - ) - $code = $this->code_client . ' - '; + ) { + $code .= $this->code_client . ' - '; + } if (($this->fournisseur) && (! empty ( $this->code_fournisseur )) && ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1 || $conf->global->SOCIETE_ADD_REF_IN_LIST == 3 ) - ) - $code .= $this->code_fournisseur . ' - '; + ) { + $code .= $this->code_fournisseur . ' - '; + } - if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) - $name =$code.' '.$name; - else - $name =$code; + if ($conf->global->SOCIETE_ADD_REF_IN_LIST == 1) { + $name = $code.' '.$name; + } else { + $name = $code; + } } if (!empty($this->name_alias)) $name .= ' ('.$this->name_alias.')'; From 4b32c8e100c0cf2c53f72651ba2ee11a43d9e662 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 14:24:55 +0200 Subject: [PATCH 16/40] Fix extrafield contact typed as date isn't show in the list from 'contact/address' tab of company --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index e77d0ee0eaf..855794da2d6 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp'))) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 79420593f44aa1e320847d9c8e8da9ef245fa05d Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 11 Oct 2018 17:14:22 +0200 Subject: [PATCH 17/40] Fix display 0 (as virtual stock) instead of empty string --- htdocs/product/reassort.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index ccd01e56db7..a915594c4de 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -338,7 +338,7 @@ if ($resql) // Real stock print ''; if ($objp->seuil_stock_alerte != '' && ($objp->stock_physique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $objp->stock_physique; + print $objp->stock_physique|0; print ''; // Details per warehouse From 817920f282c517ad39cbf4d0d17392c56dde16ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 17:36:49 +0200 Subject: [PATCH 18/40] Prepare 6.0.8 --- ChangeLog | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index 405aaa9ed9d..1bffab94cda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,37 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 6.0.8 compared to 6.0.7 ***** +FIX: #8762 +FIX: #9032 +FIX: case when we valid form with keyboard +FIX: clause must not be there +FIX: dol_delete_file must work in a context without db handler loaded +FIX: entity test must be on product_fourn_price table and not product table +FIX: Fetch shipping will now fetch project id +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: getEntity project and not projet +FIX: If we enable 3 steps for supplier order approbation, we must no… +FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def. +FIX: Keep supplier proposal price for supplier order +FIX: langs fr +FIX: missing filters during ordering +FIX: missing filters during reordering +FIX: need to filter on aa.entity for same accounting accounts available in several entities +FIX: page must always be 0 when we search +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: propal: correctly preset project when creating with origin/originid +FIX: pu_ht_devise was not converted to numeric so decimals were lost +FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise +FIX: remain to pay for credit note was wrong on invoice list +FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods +FIX: showOptionals: column mismatches +FIX: sometimes amounts are identical but php find them different. +FIX: test is_erasable() must be done before call function delete() +FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url +FIX: we must see number of all shared projects +FIX: wrong var name ***** ChangeLog for 6.0.7 compared to 6.0.6 ***** FIX: #8023 From afd9b4ea1a793ffcee8de396e24dc9a21a71ef4d Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Fri, 12 Oct 2018 18:19:17 +0200 Subject: [PATCH 19/40] FIX: propal pdf: missing parenthesis for customs code --- htdocs/comm/propal/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 2fdaadd1d59..c21e6ebec10 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -868,6 +868,7 @@ if (empty($reshook)) // Add custom code and origin country into description if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { + $tmptxt = '('; // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { $outputlangs = $langs; From d4b02c05524b89ecfb70c78b45be3e293fb484ff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:03:03 +0200 Subject: [PATCH 20/40] Release 6.0.8 --- 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 9ab5de809b9..41fcff97fd8 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','6.0.8'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.9'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From bb606df5e064351715196bd7b1528e3629c53e10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:12:20 +0200 Subject: [PATCH 21/40] Prepare 7.0.4 --- ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index bdbb165903d..0a74e1b6f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,63 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 7.0.4 compared to 7.0.3 ***** +FIX: #8984 button create expense report +FIX: #9032 +FIX: #9161 +FIX: #9328 +FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product +FIX: Add calls to fetchComments function +FIX: better compatibility with multicompany +FIX: case when we valid form with keyboard +FIX: character making error on bill list +FIX: check !empty exclude select element +FIX: combo into popup become crazy with IE10 +FIX: combo of stock in popup are crazy in IE +FIX: Deletion of files in migration +FIX: exclude element of the select +FIX: extrafieldkey +FIX: Fetch function will fetch comments +FIX: Fetch task will now fetch comments +FIX: filter supplier invoice list by societe name. +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: Force stripe api version to avoid trouble if we update stripe api +FIX: getEntity project and not projet +FIX: Get templates in a forced language +FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281) +FIX: Injection +FIX: invoice stats: situation invoices were not counted +FIX: keep context filter on contact list on change column displayed +FIX: Keep same project when creating shipping from order +FIX: langs fr +FIX: Lose filter on payment type or category after a sort on invoice list +FIX: Missing behavior +FIX: missing hook to edit sql +FIX: multicompany compatibility ! +FIX: need to filter on current entity on replenish +FIX: Option MAIN_DISABLE_NOTES_TAB #9611 +FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) +FIX: Pagination on related item pages +FIX: Pagination on withdraw request list +FIX: PDF address: handle when contact thirdparty different from document thirdparty +FIX: PHP warning, undefined index notnull +FIX: Product marge tabs on product card +FIX: Product margin tab and credit note +FIX: propal: correctly preset project when creating with origin/originid +FIX: remain to pay for credit note was wrong on invoice list +FIX: remove debug +FIX: Remove fetchComments from project and task fetch function +FIX: remove rowid for multicompany compatibility +FIX: Search on Ref project on order list +FIX: search on ref project on propal list +FIX: showOptionals: column mismatches +FIX: SQL Injections reported by mu shcor (ADLab of Venustech) +FIX: stock replenish with multientity +FIX: table llx_chargessociales doesn't exists +FIX: we must see number of all shared projects +FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing + ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters FIX: #8722 From bd60fe6ffda132beacb69bfd492c04f4212f9a61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 19:13:11 +0200 Subject: [PATCH 22/40] Prepare 7.0.4 --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0a74e1b6f8e..61b3f85edb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -58,6 +58,11 @@ FIX: stock replenish with multientity FIX: table llx_chargessociales doesn't exists FIX: we must see number of all shared projects FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing +FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup +FIX: wrong function name +FIX: Wrong position of firstname lastname +FIX: wrong value for module part and return access denied +FIX: Wrong variable and trigger name ***** ChangeLog for 7.0.3 compared to 7.0.2 ***** FIX: 7.0 task contact card without withproject parameters From b78932b9f7679cec79d97cf6b0046c6bdec3bde4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Oct 2018 21:11:40 +0200 Subject: [PATCH 23/40] Prepare 7.0.5 --- 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 adfe8cea7e9..dbc0e4bda8c 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','7.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From e2748953c3a7e8b0de07f504124bcc183ec90efb Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 12 Oct 2018 22:31:47 +0200 Subject: [PATCH 24/40] Fix print extrafield date in list --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 855794da2d6..6d72c63ab41 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -21,7 +21,7 @@ if (! empty($extrafieldsobjectkey)) // New method: $extrafieldsobject can be 'so if ($align) print ' align="'.$align.'"'; print '>'; $tmpkey='options_'.$key; - if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !preg_match('/^[0-9]{10}$/', $obj->$tmpkey)) + if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp')) && !is_numeric($obj->$tmpkey)) { $value = $db->jdate($obj->$tmpkey); } From 23e4cd57f33f8575f2a52912569063e091ae9c7e Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 12 Oct 2018 23:27:38 +0200 Subject: [PATCH 25/40] Fix warnings PHP7 --- htdocs/product/reassort.php | 1 + htdocs/product/reassortlot.php | 1 + htdocs/product/stock/productlot_list.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 70dce7470cd..b1b612d1a39 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -54,6 +54,7 @@ $fourn_id = GETPOST("fourn_id",'int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); +if (empty($page) || $page < 0) $page = 0; if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 490986b155e..e1b6c82c8f3 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -58,6 +58,7 @@ $fourn_id = GETPOST("fourn_id",'int'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); +if (empty($page) || $page < 0) $page = 0; if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 325ddd5f796..8e5e5d925e9 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -47,6 +47,7 @@ $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); $backtopage = GETPOST('backtopage'); $myparam = GETPOST('myparam','alpha'); +$toselect = GETPOST('toselect', 'array'); $search_entity=GETPOST('search_entity','int'); @@ -152,7 +153,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_import_key=''; $search_date_creation=''; $search_date_update=''; - $toselect=''; + $toselect=array(); $search_array_options=array(); } From 7b17b453bf38b0864cb7772effd1e1f25ef9026b Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 12 Oct 2018 23:29:35 +0200 Subject: [PATCH 26/40] Fix sort and switch page --- htdocs/product/reassort.php | 35 ++++++++++++++------------- htdocs/product/reassortlot.php | 43 +++++++++++++++++++--------------- 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index b1b612d1a39..fe087fd16a3 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -92,11 +92,15 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $sref=""; $snom=""; $sall=""; + $tosell=""; + $tobuy=""; $search_sale=""; $search_categ=""; $type=""; $catid=''; $toolowstock=''; + $fourn_id=''; + $sbarcode=''; } @@ -183,6 +187,20 @@ if ($resql) } $texte.=' ('.$langs->trans("Stocks").')'; + $param=''; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($sall) $param.="&sall=".$sall; + if ($tosell) $param.="&tosell=".$tosell; + if ($tobuy) $param.="&tobuy=".$tobuy; + if ($type) $param.="&type=".$type; + if ($fourn_id) $param.="&fourn_id=".$fourn_id; + if ($snom) $param.="&snom=".$snom; + if ($sref) $param.="&sref=".$sref; + if ($search_sale) $param.="&search_sale=".$search_sale; + if ($search_categ) $param.="&search_categ=".$search_categ; + if ($toolowstock) $param.="&toolowstock=".$toolowstock; + if ($sbarcode) $param.="&sbarcode=".$sbarcode; + if ($catid) $param.="&catid=".$catid; llxHeader("", $texte, $helpurl); @@ -193,14 +211,7 @@ if ($resql) print ''; print ''; - if ($sref || $snom || $sall || GETPOST('search')) - { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy.(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); - } - else - { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"").(!empty($search_categ) ? '&search_categ='.$search_categ : '').(!empty($toolowstock) ? '&toolowstock='.$toolowstock : ''), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); - } + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); if (! empty($catid)) { @@ -236,14 +247,6 @@ if ($resql) print '
'; } - $param=''; - if ($tosell) $param.="&tosell=".$tosell; - if ($tobuy) $param.="&tobuy=".$tobuy; - if ($type) $param.="&type=".$type; - if ($fourn_id) $param.="&fourn_id=".$fourn_id; - if ($snom) $param.="&snom=".$snom; - if ($sref) $param.="&sref=".$sref; - $formProduct = new FormProduct($db); $formProduct->loadWarehouses(); $warehouses_list = $formProduct->cache_warehouses; diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index e1b6c82c8f3..7cedbcd3981 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -89,6 +89,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $sref=""; $snom=""; $sall=""; + $tosell=""; + $tobuy=""; $search_sale=""; $search_categ=""; $type=""; @@ -96,6 +98,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $toolowstock=''; $search_batch=''; $search_warehouse=''; + $fourn_id=''; + $sbarcode=''; } @@ -194,6 +198,24 @@ if ($resql) } $texte.=' ('.$langs->trans("StocksByLotSerial").')'; + $param=''; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + if ($sall) $param.="&sall=".$sall; + if ($tosell) $param.="&tosell=".$tosell; + if ($tobuy) $param.="&tobuy=".$tobuy; + if ($type) $param.="&type=".$type; + if ($fourn_id) $param.="&fourn_id=".$fourn_id; + if ($snom) $param.="&snom=".$snom; + if ($sref) $param.="&sref=".$sref; + if ($search_batch) $param.="&search_batch=".$search_batch; + if ($sbarcode) $param.="&sbarcode=".$sbarcode; + if ($search_warehouse) $param.="&search_warehouse=".$search_warehouse; + if ($catid) $param.="&catid=".$catid; + if ($toolowstock) $param.="&toolowstock=".$toolowstock; + if ($search_sale) $param.="&search_sale=".$search_sale; + if ($search_categ) $param.="&search_categ=".$search_categ; + /*if ($eatby) $param.="&eatby=".$eatby; + if ($sellby) $param.="&sellby=".$sellby;*/ llxHeader("",$title,$helpurl,$texte); @@ -204,14 +226,8 @@ if ($resql) print ''; print ''; - if ($sref || $snom || $sall || GETPOST('search')) - { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell."&tobuy=".$tobuy, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); - } - else - { - print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); - } + print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords, 'title_products', 0, '', '', $limit); + if (! empty($catid)) { @@ -245,17 +261,6 @@ if ($resql) } - $param=''; - if ($tosell) $param.="&tosell=".$tosell; - if ($tobuy) $param.="&tobuy=".$tobuy; - if ($type) $param.="&type=".$type; - if ($fourn_id) $param.="&fourn_id=".$fourn_id; - if ($snom) $param.="&snom=".$snom; - if ($sref) $param.="&sref=".$sref; - if ($search_batch) $param.="&search_batch=".$search_batch; - /*if ($eatby) $param.="&eatby=".$eatby; - if ($sellby) $param.="&sellby=".$sellby;*/ - print '
'; print ''; From 1f1a614b47d7a0e8a37f496920a2f15f2ab8a189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 14 Oct 2018 10:21:06 +0200 Subject: [PATCH 27/40] Update import.lib.php --- htdocs/core/lib/import.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/import.lib.php b/htdocs/core/lib/import.lib.php index 89847d69c11..ea700c38845 100644 --- a/htdocs/core/lib/import.lib.php +++ b/htdocs/core/lib/import.lib.php @@ -1,8 +1,9 @@ - * Copyright (C) 2007 Rodolphe Quiedeville - * Copyright (C) 2010 Regis Houssin - * Copyright (C) 2010 Juanjo Menent +/* Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2007 Rodolphe Quiedeville + * Copyright (C) 2010 Regis Houssin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,10 +21,9 @@ */ /** - * \file htdocs/core/lib/order.lib.php - * \brief Ensemble de fonctions de base pour le module commande - * \ingroup commande - */ + * \file htdocs/core/lib/import.lib.php + * \brief Ensemble de fonctions de base pour le module import + * \ingroup import /** * Function to return list of tabs for import pages From 70a98743e807a819fc8ec01fa92e5085f2d082c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 14 Oct 2018 10:48:06 +0200 Subject: [PATCH 28/40] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9cbd8562949..cff0ef2b8ef 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13,6 +13,7 @@ * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -5975,11 +5976,12 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode= // No need to make a return $head. Var is modified as a reference if (! empty($hookmanager)) { - $parameters=array('object' => $object, 'mode' => $mode, 'head'=>$head); - $reshook=$hookmanager->executeHooks('completeTabsHead',$parameters); + $parameters=array('object' => $object, 'mode' => $mode, 'head' => $head); + $reshook=$hookmanager->executeHooks('completeTabsHead', $parameters); if ($reshook > 0) { $head = $hookmanager->resArray; + $h = count($head); } } } From 787658ac98fcab578d70b69a2a64aff20f4f8015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 14 Oct 2018 10:56:03 +0200 Subject: [PATCH 29/40] reduce complexity of payments.lib.php --- htdocs/core/lib/payments.lib.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index ffb0aba36ca..bd460f8d53e 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -1,6 +1,7 @@ + * Copyright (C) 2013 Marcos García + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -136,7 +137,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } } - if ($type == 'order') + elseif ($type == 'order') { $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=order&ref='.($mode?'':''); if ($mode == 1) $out.='order_ref'; @@ -154,7 +155,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } - if ($type == 'invoice') + elseif ($type == 'invoice') { $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=invoice&ref='.($mode?'':''); if ($mode == 1) $out.='invoice_ref'; @@ -172,7 +173,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } - if ($type == 'contractline') + elseif ($type == 'contractline') { $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=contractline&ref='.($mode?'':''); if ($mode == 1) $out.='contractline_ref'; @@ -190,7 +191,7 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } - if ($type == 'membersubscription') + elseif ($type == 'membersubscription') { $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode?'':''); if ($mode == 1) $out.='member_ref'; @@ -289,14 +290,14 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0,$suf $parammessageform='ONLINE_PAYMENT_MESSAGE_FORM_'.$suffix; if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); - else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); + elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORM)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORM); // Add other message if VAT exists if ($object->total_vat != 0 || $object->total_tva != 0) { $parammessageform='ONLINE_PAYMENT_MESSAGE_FORMIFVAT_'.$suffix; if (! empty($conf->global->$parammessageform)) print $langs->transnoentities($conf->global->$parammessageform); - else if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); + elseif (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT)) print $langs->transnoentities($conf->global->ONLINE_PAYMENT_MESSAGE_FORMIFVAT); } } From af813f82145befb310c35973efac5ab97ff213ea Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 14 Oct 2018 19:55:25 +0200 Subject: [PATCH 30/40] Fix missing status_batch var on product lists #9606 --- htdocs/product/index.php | 3 ++- htdocs/product/list.php | 1 + htdocs/product/reassortlot.php | 1 + htdocs/product/stock/productlot_list.php | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 6eebc4d85e2..b998bdc3148 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -273,7 +273,7 @@ print '
'; */ $max=15; $sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell, p.tobuy, p.fk_price_expression,"; -$sql.= " p.entity,"; +$sql.= " p.entity, p.tobatch,"; $sql.= " p.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity IN (".getEntity($product_static->element, 1).")"; @@ -337,6 +337,7 @@ if ($result) $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity = $objp->entity; + $product_static->status_batch = $objp->tobatch; print $product_static->getNomUrl(1,'',16); print "\n"; print '
'; diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 178432addbc..071080edc58 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -700,6 +700,7 @@ else $product_static->status = $obj->tosell; $product_static->entity = $obj->entity; $product_static->pmp = $obj->pmp; + $product_static->status_batch = $obj->tobatch; if ((! empty($conf->stock->enabled) && $user->rights->stock->lire && $search_type != 1) || ! empty($conf->global->STOCK_DISABLE_OPTIM_LOAD)) // To optimize call of load_stock { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index fc2632fe5e2..d737ecf8bb3 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -337,6 +337,7 @@ if ($resql) $product_static->label = $objp->label; $product_static->type=$objp->fk_product_type; $product_static->entity=$objp->entity; + $product_static->status_batch=$objp->tobatch; $product_lot_static->batch=$objp->batch; $product_lot_static->product_id=$objp->rowid; diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 5934e8dff55..02260c8bf8b 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -216,7 +216,8 @@ $sql.= " t.fk_user_modif,"; $sql.= " t.import_key,"; $sql.= " p.fk_product_type as product_type,"; $sql.= " p.ref as product_ref,"; -$sql.= " p.label as product_label"; +$sql.= " p.label as product_label,"; +$sql.= " p.tobatch"; // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) $sql.=",ef.".$key.' as options_'.$key; // Add fields from hooks @@ -430,6 +431,7 @@ if ($resql) $productstatic->type=$obj->product_type; $productstatic->ref=$obj->product_ref; $productstatic->label=$obj->product_label; + $productstatic->status_batch = $obj->tobatch; print ''; if (! $i) $totalarray['nbfield']++; } From 4d6d3afbea46a3873f37fd0972888c2a7c0f7cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 15 Oct 2018 08:39:46 +0200 Subject: [PATCH 31/40] code comment --- htdocs/accountancy/class/accountancycategory.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index a7bab16b30d..db148cbac67 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2016-2017 Alexandre Spangaro + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -539,9 +540,9 @@ class AccountancyCategory /** * get cpts of category * - * @param int $cat_id Id accounting account category + * @param int $cat_id Id accounting account category * - * @return array Result in table + * @return array|int Result in table or -1 if error */ public function getCptsCat($cat_id) { global $mysoc; From 06477b40a093f57a3e41d180f97604a7e4bb1b9e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 15 Oct 2018 12:34:14 +0200 Subject: [PATCH 32/40] modify parenting before task deletion --- htdocs/core/actions_massactions.inc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 32d80bef672..b7bbc402b09 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -598,6 +598,17 @@ if (! $error && $massaction == 'delete' && $permtodelete) $result=$objecttmp->fetch($toselectid); if ($result > 0) { + if ($objectclass == "Task" && $objecttmp->hasChildren() > 0) { + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id; + $res = $db->query($sql); + + if (!$res) + { + setEventMessage('ErrorRecordParentingNotModified', 'errors'); + $error++; + } + } + if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); else $result = $objecttmp->delete($user); if ($result <= 0) From dfe239bf8df84e079d938dd823890a02442133cd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 15 Oct 2018 16:58:53 +0200 Subject: [PATCH 33/40] Fix refused proposals were counted in totals in project overview --- htdocs/projet/element.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 713e5ec74f1..130a0ad711e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -609,6 +609,10 @@ foreach ($listofreferent as $key => $value) { if (! empty($element->close_code) && $element->close_code == 'replaced') $qualifiedfortotal=false; // Replacement invoice, do not include into total } + if ($key == 'propal') + { + if ($element->statut == Propal::STATUS_NOTSIGNED) $qualifiedfortotal=false; // Refused proposal must not be included in total + } if ($qualifiedfortotal) $total_ht = $total_ht + $total_ht_by_line; From 72dd182b1fed79a2fc8ad126c976e00b745a6a9c Mon Sep 17 00:00:00 2001 From: atm-ph Date: Tue, 16 Oct 2018 18:22:43 +0200 Subject: [PATCH 34/40] Fix list from 'Contacts/Addresses' on company may show duplicate value for extrafields --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b99c2f8ccd8..32a528c27dc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4459,6 +4459,7 @@ abstract class CommonObject $resql=$this->db->query($sql); if ($resql) { + $this->array_options = array(); $numrows=$this->db->num_rows($resql); if ($numrows) { From b462e7b2170e7de3114a4e12548f1f89ae17c2ca Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 17 Oct 2018 10:01:02 +0200 Subject: [PATCH 35/40] FIX When delete a product, llx_product_association rows are not deleted --- htdocs/product/class/product.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f33029d368a..56227bc5266 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2014 Henry Florian * Copyright (C) 2014-2016 Philippe Grand * Copyright (C) 2014 Ion agorria - * Copyright (C) 2016-2017 Ferran Marcet + * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro * * This program is free software; you can redistribute it and/or modify @@ -1114,6 +1114,19 @@ class Product extends CommonObject } } + // Delete from product_association + if (!$error){ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; + $sql.= " WHERE fk_product_pere = ".$this->rowid." OR fk_product_fils = ".$this->rowid; + dol_syslog(get_class($this).'::delete', LOG_DEBUG); + $result = $this->db->query($sql); + if (! $result) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } + // Delete product if (! $error) { From bdae4e1c4dae0369ef3d0051cf5e8c53572bf7c3 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 17 Oct 2018 10:04:42 +0200 Subject: [PATCH 36/40] FIX When delete a product, llx_product_association rows are not deleted --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 56227bc5266..9a52722a3c9 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1117,7 +1117,7 @@ class Product extends CommonObject // Delete from product_association if (!$error){ $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = ".$this->rowid." OR fk_product_fils = ".$this->rowid; + $sql.= " WHERE fk_product_pere = ".$this->id." OR fk_product_fils = ".$this->id; dol_syslog(get_class($this).'::delete', LOG_DEBUG); $result = $this->db->query($sql); if (! $result) From ffde3534419f28f37f57028405074b7b3a7fb5c2 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 17 Oct 2018 10:06:06 +0200 Subject: [PATCH 37/40] FIX When delete a product, llx_product_association rows are not deleted --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9a52722a3c9..ce3658c9a72 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1117,7 +1117,7 @@ class Product extends CommonObject // Delete from product_association if (!$error){ $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = ".$this->id." OR fk_product_fils = ".$this->id; + $sql.= " WHERE fk_product_pere = ".$id." OR fk_product_fils = ".$id; dol_syslog(get_class($this).'::delete', LOG_DEBUG); $result = $this->db->query($sql); if (! $result) From aea7299970f6bd48b101474074868f8f9c611e45 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 17 Oct 2018 15:49:08 +0200 Subject: [PATCH 38/40] FIX : use discount with multicurrency --- htdocs/compta/facture/card.php | 6 ++++++ htdocs/compta/facture/class/facture.class.php | 6 +++--- htdocs/core/class/discount.class.php | 4 +++- htdocs/societe/class/societe.class.php | 6 +++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 1d22d21d574..c92a182124e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -693,6 +693,9 @@ if (empty($reshook)) $amount_ht[$line->tva_tx] += $line->total_ht; $amount_tva[$line->tva_tx] += $line->total_tva; $amount_ttc[$line->tva_tx] += $line->total_ttc; + $multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht; + $multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva; + $multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc; $i ++; } } @@ -748,6 +751,9 @@ if (empty($reshook)) $discount->amount_ht = abs($amount_ht[$tva_tx]); $discount->amount_tva = abs($amount_tva[$tva_tx]); $discount->amount_ttc = abs($amount_ttc[$tva_tx]); + $discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]); + $discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]); + $discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]); $discount->tva_tx = abs($tva_tx); $result = $discount->create($user); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9bf6d4b876c..f0601ba37af 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1700,9 +1700,9 @@ class Facture extends CommonInvoice $facligne->total_ttc = -$remise->amount_ttc; $facligne->multicurrency_subprice = -$remise->multicurrency_subprice; - $facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht; - $facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva; - $facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc; + $facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht; + $facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva; + $facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc; $lineid=$facligne->insert(); if ($lineid > 0) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 37dedea8b6b..e1796c38421 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -103,7 +103,7 @@ class DiscountAbsolute $this->amount_tva = $obj->amount_tva; $this->amount_ttc = $obj->amount_ttc; - $this->multicurrency_amount_ht = $obj->multicurrency_amount_ht; + $this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht; $this->multicurrency_amount_tva = $obj->multicurrency_amount_tva; $this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc; @@ -161,10 +161,12 @@ class DiscountAbsolute $sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except"; $sql.= " (entity, datec, fk_soc, fk_user, description,"; $sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,"; + $sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,"; $sql.= " fk_facture_source"; $sql.= ")"; $sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',"; $sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.","; + $sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", "; $sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null"); $sql.= ")"; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 843803abca8..2a488aacf44 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1680,9 +1680,9 @@ class Societe extends CommonObject $discount = new DiscountAbsolute($this->db); $discount->fk_soc=$this->id; - $discount->amount_ht=price2num($remise,'MT'); - $discount->amount_tva=price2num($remise*$tva_tx/100,'MT'); - $discount->amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT'); + $discount->amount_ht=$discount->multicurrency_amount_ht=price2num($remise,'MT'); + $discount->amount_tva=$discount->multicurrency_amount_tva=price2num($remise*$tva_tx/100,'MT'); + $discount->amount_ttc=$discount->multicurrency_amount_ttc=price2num($discount->amount_ht+$discount->amount_tva,'MT'); $discount->tva_tx=price2num($tva_tx,'MT'); $discount->description=$desc; $result=$discount->create($user); From 47abbd3eb2865907d098e97ac1d68adc707d49a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Oct 2018 14:23:36 +0200 Subject: [PATCH 39/40] Fix bad merge --- htdocs/core/actions_massactions.inc.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index cb77489d397..696e1135ca9 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1017,16 +1017,6 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == } } - if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); - if ($result <= 0) - { - setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); - $error++; - break; - } - else $nbok++; - if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); else $result = $objecttmp->delete($user); From 57ad200ae50f28f95cf9e615543e6ada7e20c570 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Oct 2018 14:43:10 +0200 Subject: [PATCH 40/40] Fix regression in creating discount --- htdocs/core/class/discount.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index e1796c38421..b174848cadf 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -147,8 +147,17 @@ class DiscountAbsolute $this->amount_ht=price2num($this->amount_ht); $this->amount_tva=price2num($this->amount_tva); $this->amount_ttc=price2num($this->amount_ttc); + $this->tva_tx=price2num($this->tva_tx); + $this->multicurrency_amount_ht=price2num($this->multicurrency_amount_ht); + $this->multicurrency_amount_tva=price2num($this->multicurrency_amount_tva); + $this->multicurrency_amount_ttc=price2num($this->multicurrency_amount_ttc); + + if (empty($this->multicurrency_amount_ht)) $this->multicurrency_amount_ht=0; + if (empty($this->multicurrency_amount_tva)) $this->multicurrency_amount_tva=0; + if (empty($this->multicurrency_amount_ttc)) $this->multicurrency_amount_ttc=0; + // Check parameters if (empty($this->description)) {
'.dol_trunc($objp->label,32).''.$productstatic->getNomUrl(1).'