From 7dea799a9e158bbf5bf739b3d565c763158c2bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Tue, 3 Feb 2015 15:24:15 +0100 Subject: [PATCH 1/8] FIXED Allowed 0 to be used as an account mask 0 is used by some accounting systems and software. --- htdocs/core/modules/societe/mod_codecompta_aquarium.php | 4 ++-- htdocs/societe/admin/societe.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 1cc70aa009e..65a1f6192b5 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -44,8 +44,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode function __construct() { global $conf; - if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; - if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; + if (is_null($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; + if (is_null($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; $this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; $this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 9834959273c..65728435910 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -114,7 +114,11 @@ if ($action == 'setModuleOptions') { $param=GETPOST("param".$i,'alpha'); $value=GETPOST("value".$i,'alpha'); - if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + // Use the default values if the field is not set + if ($param == '') { + $param = null; + } + $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; } } From 4a9a3ab04ba396128ed392a83fb9b9916186781b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Mar 2015 13:42:58 +0100 Subject: [PATCH 2/8] Revert "FIXED Allowed 0 to be used as an account mask" --- htdocs/core/modules/societe/mod_codecompta_aquarium.php | 4 ++-- htdocs/societe/admin/societe.php | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 65a1f6192b5..1cc70aa009e 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -44,8 +44,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode function __construct() { global $conf; - if (is_null($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; - if (is_null($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; + if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; + if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; $this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; $this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 65728435910..9834959273c 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -114,11 +114,7 @@ if ($action == 'setModuleOptions') { $param=GETPOST("param".$i,'alpha'); $value=GETPOST("value".$i,'alpha'); - // Use the default values if the field is not set - if ($param == '') { - $param = null; - } - $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); + if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; } } From 89b22be063b2c1f2b032e3e9a7b416cfa3c11859 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Mar 2015 13:44:26 +0100 Subject: [PATCH 3/8] FIXED: Allowed 0 to be used as an account mask. Required by CEGID. --- htdocs/core/modules/societe/mod_codecompta_aquarium.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index 1cc70aa009e..a4514efbce4 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -44,8 +44,8 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode function __construct() { global $conf; - if (empty($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER)) $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; - if (empty($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER)) $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; + if (! isset($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) || trim($conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER) == '') $conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER='411'; + if (! isset($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) || trim($conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER) == '') $conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER='401'; $this->prefixcustomeraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER; $this->prefixsupplieraccountancycode=$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER; } From 728b64e334dc999fa965d61e2cfe1c4e65bd8747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 12 Apr 2015 20:24:22 +0200 Subject: [PATCH 4/8] Fix Bug #2583: Unable to create a bank transfer with localized numbers --- ChangeLog | 1 + htdocs/compta/bank/virement.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31e0bad5a16..e299da9a8e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1846 ] Browser IE11 not detected +Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index bea66e6a47d..07541732bb0 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copytight (C) 2005-2009 Regis Houssin * Copytight (C) 2012 Juanjo Menent + * Copyright (C) 2015 Marcos García * * 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 @@ -48,7 +49,7 @@ if ($action == 'add') $mesg=''; $dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int')); $label = GETPOST('label','alpha'); - $amount= GETPOST('amount','int'); + $amount= GETPOST('amount'); if (! $label) { From bbd01c0c8d0f238a642e26b5078d593571670879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 12 Apr 2015 20:59:58 +0200 Subject: [PATCH 5/8] Fix: Bug #2577 Incorrect invoice status in "Linked objects" page of a project --- ChangeLog | 1 + htdocs/projet/element.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31e0bad5a16..4681b1bbd41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1846 ] Browser IE11 not detected +Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 62bbf9ae642..4d54123ae4a 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2015 Marcos García * * 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 @@ -281,7 +282,14 @@ foreach ($listofreferent as $key => $value) if (empty($value['disableamount'])) print ''.(isset($element->total_ttc)?price($element->total_ttc):' ').''; // Status - print ''.$element->getLibStatut(5).''; + print ''; + if ($element instanceof CommonInvoice) { + //This applies for Facture and FactureFournisseur + print $element->getLibStatut(5, $element->getSommePaiement()); + } else { + print $element->getLibStatut(5); + } + print ''; print ''; From 6173706531ac4a19e0c5b66d3f066e6b98cc2c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 12 Apr 2015 21:55:20 +0200 Subject: [PATCH 6/8] Fix: [ bug #1906 ] Deplacement does not allow translated decimal format --- ChangeLog | 1 + htdocs/compta/deplacement/fiche.php | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31e0bad5a16..89e358f1fcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1846 ] Browser IE11 not detected +Fix: [ bug #1906 ] Deplacement does not allow translated decimal format ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 808d9163222..65328ff6bfb 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Marcos García * * 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 @@ -123,8 +124,14 @@ else if ($action == 'add' && $user->rights->deplacement->creer) { $error=0; + $km = GETPOST('km'); + + if ($km) { + $km = price2num($km); + } + $object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); - $object->km = GETPOST('km','int'); + $object->km = $km; $object->type = GETPOST('type','alpha'); $object->socid = GETPOST('socid','int'); $object->fk_user = GETPOST('fk_user','int'); @@ -182,8 +189,14 @@ else if ($action == 'update' && $user->rights->deplacement->creer) { $result = $object->fetch($id); + $km = GETPOST('km'); + + if ($km) { + $km = price2num($km); + } + $object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); - $object->km = GETPOST('km','int'); + $object->km = $km; $object->type = GETPOST('type','alpha'); $object->socid = GETPOST('socid','int'); $object->fk_user = GETPOST('fk_user','int'); @@ -225,12 +238,6 @@ else if ($action == 'setdated' && $user->rights->deplacement->creer) $result=$object->setValueFrom('dated',$dated,'','','date'); if ($result < 0) dol_print_error($db, $object->error); } -else if ($action == 'setkm' && $user->rights->deplacement->creer) -{ - $object->fetch($id); - $result=$object->setValueFrom('km',GETPOST('km','int')); - if ($result < 0) dol_print_error($db, $object->error); -} else if ($action == 'setnote_public' && $user->rights->deplacement->creer) { $object->fetch($id); @@ -385,7 +392,7 @@ else if ($id) // Km print ''.$langs->trans("FeesKilometersOrAmout").''; - print ''; + print ''; print ''; // Where @@ -477,7 +484,7 @@ else if ($id) print ''; print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6'); print ''; - print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6'); + print $form->editfieldval("FeesKilometersOrAmout",'km',price($object->km),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6'); print ""; // Where From 8f0c41dbd21e48fa61164a6794958a7ad6c1e752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 12 Apr 2015 22:02:25 +0200 Subject: [PATCH 7/8] Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card --- ChangeLog | 1 + htdocs/compta/deplacement/fiche.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 89e358f1fcf..c80a9ecc08b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1846 ] Browser IE11 not detected Fix: [ bug #1906 ] Deplacement does not allow translated decimal format +Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 65328ff6bfb..752ffafa357 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -460,10 +460,12 @@ else if ($id) print ''; // Type + $form->load_cache_types_fees(); + print ''; print $form->editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); print ''; - print $form->editfieldval("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); + print $form->editfieldval("Type",'type', $form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); print ''; // Who From 2b8efc302a173e57138e5be6c9de2af57b9838c8 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 18 Apr 2015 11:24:55 +0200 Subject: [PATCH 8/8] Fix : shipment model selection --- htdocs/expedition/class/expedition.class.php | 2 -- htdocs/expedition/fiche.php | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e5dbb540b85..fa25c48366d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -164,8 +164,6 @@ class Expedition extends CommonObject $now=dol_now(); - if (empty($this->model_pdf)) $this->model_pdf=$conf->global->EXPEDITION_ADDON_PDF; - require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php'; $error = 0; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 4743ad5f25b..6200f2c3c5f 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -113,6 +113,7 @@ if ($action == 'add') $object->socid = $objectsrc->socid; $object->ref_customer = $objectsrc->ref_client; + $object->model_pdf = GETPOST('model'); $object->date_delivery = $date_delivery; // Date delivery planed $object->fk_delivery_address = $objectsrc->fk_delivery_address; $object->shipping_method_id = GETPOST('shipping_method_id','int'); @@ -662,6 +663,14 @@ if ($action == 'create') print ''; print ''; print "\n"; + + // Document model + print "".$langs->trans("Model").""; + print ''; + include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; + $liste = ModelePdfExpedition::liste_modeles($db); + print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF); + print "\n"; // Other attributes $parameters=array('colspan' => ' colspan="3"');