From 76cb9f60c7b74e31f059db19dc2f3574a6b3b139 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 29 Aug 2018 14:12:17 +0200 Subject: [PATCH 01/28] NEW hook on dispatch order fourn --- htdocs/fourn/commande/dispatch.php | 79 +++++++++++++++++------------- 1 file changed, 46 insertions(+), 33 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 04c039cfbb1..e53ef59304f 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -62,6 +62,10 @@ if (empty($conf->stock->enabled)) { accessforbidden(); } + +$hookmanager->initHooks(array('dispatch')); + + // Recuperation de l'id de projet $projectid = 0; if ($_GET["projectid"]) @@ -502,9 +506,12 @@ if ($id > 0 || ! empty($ref)) { print ''; print '' . $langs->trans("Description") . ''; - print ''; - print ''; - print ''; + if (!empty($conf->productbatch->enabled)) + { + print ''.$langs->trans("batch_number").''; + print ''.$langs->trans("EatByDate").''; + print ''.$langs->trans("SellByDate").''; + } print '' . $langs->trans("QtyOrdered") . ''; print '' . $langs->trans("QtyDispatchedShort") . ''; print '' . $langs->trans("QtyToDispatchShort") . ''; @@ -512,15 +519,9 @@ if ($id > 0 || ! empty($ref)) { print '' . $langs->trans("Warehouse") . ''; print "\n"; - if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print '' . $langs->trans("batch_number") . ''; - print '' . $langs->trans("EatByDate") . ''; - print '' . $langs->trans("SellByDate") . ''; - print ' '; - print "\n"; - } + + + } $nbfreeproduct = 0; // Nb of lins of free products/services @@ -559,16 +560,21 @@ if ($id > 0 || ! empty($ref)) { if (! empty($conf->productbatch->enabled)) { if ($objp->tobatch) { - print ''; + print ''; print $linktoprod; print ""; + print ''; + print ''; + print ''; } else { print ''; print $linktoprod; print ""; - print ''; + print ''; print $langs->trans("ProductDoesNotUseBatchSerial"); print ''; + print ''; + print ''; } } else { print ''; @@ -614,7 +620,7 @@ if ($id > 0 || ! empty($ref)) { print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -627,6 +633,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ' '; // Qty ordered + qty already dispatached } else { + $type = 'dispatch'; print ''; print ''; // Qty to dispatch @@ -701,21 +708,27 @@ if ($id > 0 || ! empty($ref)) { if ($nbproduct) { - $checkboxlabel=$langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); + $checkboxlabel = $langs->trans("CloseReceivedSupplierOrdersAutomatically", $langs->transnoentitiesnoconv($object->statuts[5])); print '
'; - print $langs->trans("Comment") . ' : '; - print 'trans("DispatchSupplierOrder", $object->ref); - // print ' / '.$object->ref_supplier; // Not yet available - print '" class="flat">
'; + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + // modified by hook + if (empty($reshook)) + { + print $langs->trans("Comment").' : '; + print 'trans("DispatchSupplierOrder", $object->ref); + // print ' / '.$object->ref_supplier; // Not yet available + print '" class="flat">
'; - print ' '.$checkboxlabel; + print ' '.$checkboxlabel; - print '
'; + print '
'; + } print '
'; } @@ -755,14 +768,14 @@ if ($id > 0 || ! empty($ref)) { print load_fiche_titre($langs->trans("ReceivingForSameOrder")); print '
'; - print ''; + print '
'; print ''; print ''; if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } print ''; print ''; @@ -784,9 +797,9 @@ if ($id > 0 || ! empty($ref)) { print "\n"; if (! empty($conf->productbatch->enabled)) { - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; } // Qty From 88044a3d75088b4907cbc41ae7bc8f8cf2880eda Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 20:42:19 +0200 Subject: [PATCH 02/28] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index e53ef59304f..1f6f86d57ae 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -620,7 +620,7 @@ if ($id > 0 || ! empty($ref)) { print ''; - print ''; print '
' . $langs->trans("Product") . '' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . $langs->trans("SellByDate") . '' . $langs->trans("QtyDispatched") . '' . $objp->batch . '' . dol_print_date($db->jdate($objp->eatby), 'day') . '' . dol_print_date($db->jdate($objp->sellby), 'day') . '' . $objp->batch . '' . dol_print_date($db->jdate($objp->eatby), 'day') . '' . dol_print_date($db->jdate($objp->sellby), 'day') . ''; + print ''; print ''; print ''; From 6ca9854a343fa96bc056caf5adde3c7240998148 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 21:07:00 +0200 Subject: [PATCH 03/28] Fix to avoid fetch when no accounting account defined --- htdocs/admin/stock.php | 21 +++++++++++---------- htdocs/product/card.php | 36 ++++++++++++++++++++++++------------ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index e1098ef262d..cdfaf928cf4 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -160,7 +160,7 @@ print '
'; print ''; print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; $found=0; @@ -262,7 +262,7 @@ print '
'; print '
".$langs->trans("RuleForStockManagementDecrease")."  
'; print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; $found=0; @@ -341,7 +341,7 @@ print '
'; print '
".$langs->trans("RuleForStockManagementIncrease")."  
'; print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; @@ -373,7 +373,7 @@ if($conf->invoice->enabled) print "\n"; } -if($conf->order->enabled) +if($conf->order->enabled) { print ''; print ''; @@ -388,7 +388,7 @@ if($conf->order->enabled) print "\n"; } -if($conf->expedition->enabled) +if($conf->expedition->enabled) { print ''; print ''; @@ -416,7 +416,7 @@ if ($virtualdiffersfromphysical) print '
".$langs->trans("RuleForStockAvailability")."  
'.$langs->trans("StockMustBeEnoughForOrder").'
'.$langs->trans("StockMustBeEnoughForShipment").'
'; print ''; print " \n"; - print " \n"; + print " \n"; print ''."\n"; print ''; @@ -439,12 +439,12 @@ print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help',$langs->trans("VirtualDiffersFromPhysical"))."  
'; print ''; print " \n"; -print " \n"; +print " \n"; print ''."\n"; print ''; print ''; -print '\n"; print ''; print ''; +print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); +print ''; print ''; print ''."\n"; print ''; - print ''."\n"; + print ''."\n"; // Example with a yes / no select print ''; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 39a5697ad72..1fe43240305 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1679,10 +1679,13 @@ else print ''; print ''; } + else + { + print ''; + print ''; + print ''; + } print ''; print ''; print ''; print ''; print ''; print "\n"; - - - - } $nbfreeproduct = 0; // Nb of lins of free products/services From eaa49e773da178001ddf9893ea94bbaef0005503 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 29 Aug 2018 17:25:37 +0200 Subject: [PATCH 05/28] fix deletion of stripe customer --- htdocs/core/triggers/interface_80_modStripe_Stripe.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 79ef62675e9..37906501d40 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -173,6 +173,11 @@ class InterfaceStripe if ($customer) { $customer->delete(); } + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account"; + $sql.= " WHERE site='stripe' AND fk_soc = " . $object->id; + $this->db->query($sql); + } // If payment mode is linked to Strip, we update/delete Stripe too From f146572b8122d59a3708a7c5a8d58e579a1bc722 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 21:17:18 +0200 Subject: [PATCH 06/28] ident --- .../interface_80_modStripe_Stripe.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index 37906501d40..0e8147ce458 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -134,7 +134,7 @@ class InterfaceStripe $servicestatus = 1; } - // If customer is linked to Strip, we update/delete Stripe too + // If customer is linked to Stripe, we update/delete Stripe too if ($action == 'COMPANY_MODIFY') { dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); @@ -170,17 +170,17 @@ class InterfaceStripe $stripeacc = $stripe->getStripeAccount($service); // No need of network access for this $customer = $stripe->customerStripe($object, $stripeacc, $servicestatus); - if ($customer) { + if ($customer) + { $customer->delete(); } - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account"; + + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account"; $sql.= " WHERE site='stripe' AND fk_soc = " . $object->id; - $this->db->query($sql); - + $this->db->query($sql); } - // If payment mode is linked to Strip, we update/delete Stripe too + // If payment mode is linked to Stripee, we update/delete Stripe too if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') { // For creation of credit card, we do not create in Stripe automatically From 285e231ea1115599a7f62cea94d694e47d4fe41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Aug 2018 23:08:13 +0200 Subject: [PATCH 07/28] Update blockedlog.lang --- htdocs/langs/en_US/blockedlog.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index 9f6a49a5146..7f71a6cbfc0 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -50,4 +50,4 @@ BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs modu BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log). OnlyNonValid=Non valid TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters. -RestrictYearToExport=Restrict year to export \ No newline at end of file +RestrictYearToExport=Restrict year to export From f8fef6107555ac6ad45976da8222a658357fb235 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 30 Aug 2018 09:19:44 +0200 Subject: [PATCH 08/28] remove useless db begin --- htdocs/product/class/product.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 0b40f815816..f33029d368a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4456,8 +4456,6 @@ class Product extends CommonObject $langs->load('products'); - $this->db->begin(); - $label_type = 'label'; if ($type == 'short') From 4d22c4f9f98a64c5d1777f1fe4f525ca02454673 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Aug 2018 11:37:06 +0200 Subject: [PATCH 09/28] Typo --- htdocs/langs/en_US/agenda.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 9c1a0a35837..4a7ab99ca77 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -100,7 +100,7 @@ AgendaUrlOptions3=logina=%s to restrict output to actions owned by a user AgendaUrlOptionsNotAdmin=logina=!%s to restrict output to actions not owned by user %s. AgendaUrlOptions4=logint=%s to restrict output to actions assigned to user %s (owner and others). AgendaUrlOptionsProject=project=__PROJECT_ID__ to restrict output to actions linked to project __PROJECT_ID__. -AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic event. +AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic events. AgendaShowBirthdayEvents=Show birthdays of contacts AgendaHideBirthdayEvents=Hide birthdays of contacts Busy=Busy From 151d84405a1058421347dd226843389724cf3438 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Aug 2018 17:01:22 +0200 Subject: [PATCH 10/28] FIX trans on null object --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index e7eb9eb259d..41ff14b011a 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1770,7 +1770,7 @@ function getSoapParams() */ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') { - global $db,$conf; + global $db, $conf, $langs; $ret=''; From 8dc208c961c51b03343972da59024b5a90e24cfb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Aug 2018 19:19:43 +0200 Subject: [PATCH 11/28] Fix missing legal ids in source address --- htdocs/core/lib/pdf.lib.php | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index c596e1c8ae0..a96fee522b3 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -392,6 +392,48 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Web if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url); } + // Intra VAT + if (! empty($conf->global->MAIN_TVAINTRA_IN_SOURCE_ADDRESS)) + { + if ($sourcecompany->tva_intra) $stringaddress.=($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($sourcecompany->tva_intra); + } + // Professionnal Ids + if (! empty($conf->global->MAIN_PROFID1_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof1)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId1",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof1); + } + if (! empty($conf->global->MAIN_PROFID2_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof2)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId2",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof2); + } + if (! empty($conf->global->MAIN_PROFID3_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof3)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId3",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof3); + } + if (! empty($conf->global->MAIN_PROFID4_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof4)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId4",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof4); + } + if (! empty($conf->global->MAIN_PROFID5_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof5)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId5",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof5); + } + if (! empty($conf->global->MAIN_PROFID6_IN_SOURCE_ADDRESS) && ! empty($sourcecompany->idprof6)) + { + $tmp=$outputlangs->transcountrynoentities("ProfId6",$sourcecompany->country_code); + if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; + $stringaddress.=($stringaddress ? "\n" : '' ).$tmp.': '.$outputlangs->convToOutputCharset($sourcecompany->idprof6); + } } if ($mode == 'target' || preg_match('/targetwithdetails/',$mode)) From 9c44f80746a075e37326eb9e0d23f759ec50c444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:03:03 +0200 Subject: [PATCH 12/28] Update card.php --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index ffe84da6cf0..0284155ddc1 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -212,7 +212,7 @@ if (empty($reshook)) } else { - setEventMessages($object->errors, $object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } From f61450ffa86102bb99e1af6d294c389a840903ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:04:32 +0200 Subject: [PATCH 13/28] Update ldap.php --- htdocs/adherents/ldap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index ff0bad063bd..1f9f348d564 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -75,7 +75,7 @@ if ($action == 'dolibarr2ldap') setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs'); } else { - setEventMessages($ldap->errors, $ldap->error, 'errors'); + setEventMessages($ldap->error, $ldap->errors, 'errors'); } } From 2eade6ea6861c60451da7faec00d6fd7a616380a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 30 Aug 2018 23:22:06 +0200 Subject: [PATCH 14/28] Update modSociete.class.php --- htdocs/core/modules/modSociete.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index c41c2d391cc..0498e37bdfc 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -291,7 +291,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : ''; + $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : ''; } $this->export_sql_end[$r] .=')'; } @@ -328,7 +328,7 @@ class modSociete extends DolibarrModules $this->export_sql_end[$r] .=' AND (sc.fk_user = '.$user->id.' '; if (! empty($conf->global->SOCIETE_EXPORT_SUBORDINATES_CHILDS)) { $subordinatesids = $user->getAllChildIds(); - $this->export_sql_end[$r] .=count($subronidatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subronidatesids).')' : ''; + $this->export_sql_end[$r] .=count($subordinatesids)>0 ? ' OR (sc.fk_user IN ('.implode(',',$subordinatesids).')' : ''; } $this->export_sql_end[$r] .=')'; } From bdbe2c02edbbbeda33dd2fc2263dfc0fa72f2fcd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 10:51:32 +0200 Subject: [PATCH 15/28] Sample --- .../triggers/interface_99_modMyModule_MyModuleTriggers.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php index cfe49c8a737..b325f2f7443 100644 --- a/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php +++ b/htdocs/modulebuilder/template/core/triggers/interface_99_modMyModule_MyModuleTriggers.class.php @@ -181,6 +181,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers //case 'LINEORDER_SUPPLIER_DISPATCH': //case 'LINEORDER_SUPPLIER_CREATE': //case 'LINEORDER_SUPPLIER_UPDATE': + //case 'LINEORDER_SUPPLIER_DELETE': // Proposals //case 'PROPAL_CREATE': From 07d5bd143afb698c7974771eb59c0839e9ed3856 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 11:26:53 +0200 Subject: [PATCH 16/28] Fix entity --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1cf2f33980e..acb33f83c26 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1351,7 +1351,7 @@ class Societe extends CommonObject // Generation requete recherche $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; - $sql.= " WHERE entity IN (".getEntity('category').")"; + $sql.= " WHERE entity IN (".getEntity('societe').")"; if (! empty($type)) { if ($type == 1 || $type == 2) From b08971b03b83eea28812b72285bd1d0953ff3fdf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 14:52:34 +0200 Subject: [PATCH 17/28] FIX vat rate code not return by get_product_vat_for_country --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 10dab38f8e2..236ceaa1a62 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4955,7 +4955,7 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi * * @param int $idprod Id of product or 0 if not a predefined product * @param Societe $thirdparty_seller Thirdparty with a ->country_code defined (FR, US, IT, ...) - * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" order/invoice) + * @param int $idprodfournprice Id product_fournisseur_price (for "supplier" proposal/order/invoice) * @return float|string Vat rate to use with format 5.0 or '5.0 (XXX)' * @see get_product_localtax_for_country */ @@ -4976,7 +4976,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if ($mysoc->country_code == $thirdparty_seller->country_code) // If selling country is ours { - if ($idprodfournprice > 0) // We want vat for product for a "supplier" order or invoice + if ($idprodfournprice > 0) // We want vat for product for a "supplier" object { $product->get_buyprice($idprodfournprice,0,0,0); $ret=$product->vatrate_supplier; @@ -5001,7 +5001,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) { // If vat of product for the country not found or not defined, we return the first higher vat of country. - $sql = "SELECT taux as vat_rate"; + $sql = "SELECT c.taux as vat_rate, c.code as default_vat_code"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; @@ -5014,6 +5014,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if ($obj) { $ret=$obj->vat_rate; + if ($obj->default_vat_code) $ret.=' ('.$obj->default_vat_code.')'; } $db->free($sql); } From 6af8f8f4750fd3cc12312896f036c83cf1fafef0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 16:57:50 +0200 Subject: [PATCH 18/28] Fix trans --- htdocs/compta/sociales/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 101a934a524..4fc9eb00bcd 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -40,7 +40,7 @@ if (! empty($conf->accounting->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('compta', 'bills')); +$langs->loadLangs(array('compta', 'bills', 'banks')); $id=GETPOST('id','int'); $action=GETPOST('action','aZ09'); From ca2e9f20f644a0a4247eb09bf22311595576ec0a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Aug 2018 18:39:13 +0200 Subject: [PATCH 19/28] Fix missing extrafield table --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 14c4f2b6672..f5520b6f232 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -284,6 +284,13 @@ CREATE TABLE llx_ticket_extrafields import_key varchar(14) )ENGINE=innodb; +create table llx_facture_rec_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, + import_key varchar(14) +) ENGINE=innodb; -- Create dictionaries tables for ticket From 66d64359cf20af00da8242b5785a83b259fff099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 20:23:26 +0200 Subject: [PATCH 20/28] FIX get_product_vat_for_country functions.lib.php --- 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 236ceaa1a62..77d64406d3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5001,7 +5001,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) { // If vat of product for the country not found or not defined, we return the first higher vat of country. - $sql = "SELECT c.taux as vat_rate, c.code as default_vat_code"; + $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; From f0fc99ee4cb7803f75e2e82897270a0aa398f335 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 12:01:01 +0200 Subject: [PATCH 21/28] FIX Force stripe api version to avoid trouble if we update stripe api --- htdocs/stripe/config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index c61de994874..defbc620cc8 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -55,3 +55,4 @@ else \Stripe\Stripe::setApiKey($stripearrayofkeys['secret_key']); \Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From 81c4e6a7647b4b536b3ebfbda708c791e41935e2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 12:01:01 +0200 Subject: [PATCH 22/28] FIX Force stripe api version to avoid trouble if we update stripe api Conflicts: htdocs/stripe/config.php --- htdocs/stripe/config.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/stripe/config.php b/htdocs/stripe/config.php index 9f5f0e4de96..be7109b0165 100644 --- a/htdocs/stripe/config.php +++ b/htdocs/stripe/config.php @@ -52,3 +52,5 @@ require_once DOL_DOCUMENT_ROOT."/includes/stripe/lib/Stripe.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; \Stripe\Stripe::setApiKey($stripe['secret_key']); +\Stripe\Stripe::setAppInfo("Stripe", DOL_VERSION, "https://www.dolibarr.org"); // add dolibarr version +\Stripe\Stripe::setApiVersion("2018-07-27"); // force version API From c30b1c274d28f2d78dd28df3df0f2b42e23fc62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Aug 2018 23:05:09 +0200 Subject: [PATCH 23/28] Update config --- .tx/config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.tx/config b/.tx/config index db380163540..27327f033ea 100644 --- a/.tx/config +++ b/.tx/config @@ -38,6 +38,12 @@ source_file = htdocs/langs/en_US/bills.lang source_lang = en_US type = MOZILLAPROPERTIES +[dolibarr.blockedlog] +file_filter = htdocs/langs//blockedlog.lang +source_file = htdocs/langs/en_US/blockedlog.lang +source_lang = en_US +type = MOZILLAPROPERTIES + [dolibarr.bookmarks] file_filter = htdocs/langs//bookmarks.lang source_file = htdocs/langs/en_US/bookmarks.lang From ae36469166ae5d6a54a204fddfbbfce7ecaaeab6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 12:28:36 +0200 Subject: [PATCH 24/28] FIX #9337 --- htdocs/public/payment/newpayment.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a189781c8c1..7fe3c835f18 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -31,9 +31,8 @@ define("NOLOGIN",1); // This means this output page does not require to be logg define("NOCSRFCHECK",1); // We accept to go on this page from external web site. // For MultiCompany module. -// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retreive from object ref and not from url. -$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : (! empty($_GET['e']) ? (int) $_GET['e'] : (! empty($_POST['e']) ? (int) $_POST['e'] : 1)))); if (is_numeric($entity)) define("DOLENTITY", $entity); require '../../main.inc.php'; From 79ee31df5c450ff2aca33ac54ab3d07a679b3870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 30 Aug 2018 18:12:02 +0200 Subject: [PATCH 25/28] Fix: undefined rights_class on modules When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''. --- htdocs/core/modules/DolibarrModules.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 562f9eed374..bcd3c995c46 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2018 Josep Lluís Amador * * 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 @@ -1326,7 +1327,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // Search if boxes def already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; if ($class) $sql.= " AND classesname = '".$this->db->escape($class)."'"; if ($objectname) $sql.= " AND objectname = '".$this->db->escape($objectname)."'"; if ($method) $sql.= " AND methodename = '".$this->db->escape($method)."'"; @@ -1352,7 +1353,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if(is_int($status)){ $sql.= ' status,'; } $sql.= " entity, test)"; $sql.= " VALUES ("; - $sql.= "'".$this->db->escape($this->rights_class)."', "; + $sql.= "'".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->escape($label)."', "; @@ -1414,7 +1415,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (is_array($this->cronjobs)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG); @@ -1792,7 +1793,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def"; - $sql.= " WHERE module = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_permissions", LOG_DEBUG); if (! $this->db->query($sql)) @@ -1830,7 +1831,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $menu->menu_handler='all'; //$menu->module=strtolower($this->name); TODO When right_class will be same than module name - $menu->module=$this->rights_class; + $menu->module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; if (! $this->menu[$key]['fk_menu']) { @@ -1926,7 +1927,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; //$module=strtolower($this->name); TODO When right_class will be same than module name - $module=$this->rights_class; + $module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE module = '".$this->db->escape($module)."'"; From bfaf7ae473b86dd01de244ce4623a126358260ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 30 Aug 2018 18:12:02 +0200 Subject: [PATCH 26/28] Fix: undefined rights_class on modules When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''. --- htdocs/core/modules/DolibarrModules.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index ef129a421ce..0140f850e34 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014 Raphaël Doursenaud + * Copyright (C) 2018 Josep Lluís Amador * * 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 @@ -1330,7 +1331,7 @@ class DolibarrModules // Can not be abstract, because we need to insta // Search if boxes def already present $sql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; if ($class) $sql.= " AND classesname = '".$this->db->escape($class)."'"; if ($objectname) $sql.= " AND objectname = '".$this->db->escape($objectname)."'"; if ($method) $sql.= " AND methodename = '".$this->db->escape($method)."'"; @@ -1357,7 +1358,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if(is_int($status)){ $sql.= ' status,'; } $sql.= " entity, test)"; $sql.= " VALUES ("; - $sql.= "'".$this->db->escape($this->rights_class)."', "; + $sql.= "'".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->idate($now)."', "; $sql.= "'".$this->db->escape($label)."', "; @@ -1420,7 +1421,7 @@ class DolibarrModules // Can not be abstract, because we need to insta if (is_array($this->cronjobs)) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."cronjob"; - $sql.= " WHERE module_name = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module_name = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_cronjobs", LOG_DEBUG); @@ -1783,7 +1784,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."rights_def"; - $sql.= " WHERE module = '".$this->db->escape($this->rights_class)."'"; + $sql.= " WHERE module = '".$this->db->escape(empty($this->rights_class)?strtolower($this->name):$this->rights_class)."'"; $sql.= " AND entity = ".$conf->entity; dol_syslog(get_class($this)."::delete_permissions", LOG_DEBUG); if (! $this->db->query($sql)) @@ -1819,7 +1820,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $menu->menu_handler='all'; //$menu->module=strtolower($this->name); TODO When right_class will be same than module name - $menu->module=$this->rights_class; + $menu->module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; if (! $this->menu[$key]['fk_menu']) { @@ -1915,7 +1916,7 @@ class DolibarrModules // Can not be abstract, because we need to insta $err=0; //$module=strtolower($this->name); TODO When right_class will be same than module name - $module=$this->rights_class; + $module=empty($this->rights_class)?strtolower($this->name):$this->rights_class; $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; $sql.= " WHERE module = '".$this->db->escape($module)."'"; From dee9442720e4af73019114ce1354b45359f5818f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 13:12:09 +0200 Subject: [PATCH 27/28] Fix regression --- 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 236ceaa1a62..77d64406d3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5001,7 +5001,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) { // If vat of product for the country not found or not defined, we return the first higher vat of country. - $sql = "SELECT c.taux as vat_rate, c.code as default_vat_code"; + $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC"; From 2b5407c31de7ebd37c423d5fe3d61b673083ab1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Aug 2018 08:29:51 +0200 Subject: [PATCH 28/28] Update export.php --- htdocs/accountancy/admin/export.php | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 79588db5ac1..0308df2f400 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -5,7 +5,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2017 Frédéric France + * Copyright (C) 2017-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 @@ -50,11 +50,11 @@ $main_option = array ( $configuration = AccountancyExport::getTypeConfig(); -$listparam = $configuration[param]; +$listparam = $configuration['param']; -$listformat = $configuration[format]; +$listformat = $configuration['format']; -$listcr = $configuration[cr]; +$listcr = $configuration['cr']; $model_option = array ( @@ -117,7 +117,7 @@ if ($action == 'update') { if (! $error) { // reload $configuration = AccountancyExport::getTypeConfig(); - $listparam = $configuration[param]; + $listparam = $configuration['param']; setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -142,27 +142,27 @@ print ' {'."\n"; foreach ($listparam as $key => $param) { print ' if (jQuery("#ACCOUNTING_EXPORT_MODELCSV").val()=="'.$key.'")'."\n"; print ' {'."\n"; - print ' //console.log("'.$param[label].'");'."\n"; - if (empty($param[ACCOUNTING_EXPORT_FORMAT])) { + print ' //console.log("'.$param['label'].'");'."\n"; + if (empty($param['ACCOUNTING_EXPORT_FORMAT'])) { print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$conf->global->ACCOUNTING_EXPORT_FORMAT.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").prop("disabled", true);'."\n"; } else { - print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param[ACCOUNTING_EXPORT_FORMAT].'");'."\n"; + print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").val("'.$param['ACCOUNTING_EXPORT_FORMAT'].'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_FORMAT").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_SEPARATORCSV])) { + if (empty($param['ACCOUNTING_EXPORT_SEPARATORCSV'])) { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").val("'.$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV.'");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_SEPARATORCSV").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_ENDLINE])) { + if (empty($param['ACCOUNTING_EXPORT_ENDLINE'])) { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").prop("disabled", true);'."\n"; } else { print ' jQuery("#ACCOUNTING_EXPORT_ENDLINE").removeAttr("disabled");'."\n"; } - if (empty($param[ACCOUNTING_EXPORT_DATE])) { + if (empty($param['ACCOUNTING_EXPORT_DATE'])) { print ' jQuery("#ACCOUNTING_EXPORT_DATE").val("");'."\n"; print ' jQuery("#ACCOUNTING_EXPORT_DATE").prop("disabled", true);'."\n"; } else { @@ -257,15 +257,15 @@ if ($num2) { print ''; // Param - $label = $key[label]; + $label = $key['label']; print ''; // Value print '';
".$langs->trans("Other")."  
'.$langs->trans("UserWarehouseAutoCreate").''; +print ''; print "
"; print ''; print ""; @@ -456,7 +456,8 @@ print "
'; -print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")).''; print ""; print ''; @@ -502,7 +503,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print '
'.$langs->trans("Inventory").'   
'; if (! empty($conf->accounting->enabled)) { - $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('',$object->accountancy_code_sell,1); + if (! empty($object->accountancy_code_sell)) + { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch('',$object->accountancy_code_sell,1); - print $accountingaccount->getNomUrl(0,1,1,'',1); + print $accountingaccount->getNomUrl(0,1,1,'',1); + } } else { print $object->accountancy_code_sell; } @@ -1698,10 +1701,13 @@ else print ''; if (! empty($conf->accounting->enabled)) { - $accountingaccount2 = new AccountingAccount($db); - $accountingaccount2->fetch('',$object->accountancy_code_sell_intra,1); + if (! empty($object->accountancy_code_sell_intra)) + { + $accountingaccount2 = new AccountingAccount($db); + $accountingaccount2->fetch('',$object->accountancy_code_sell_intra,1); - print $accountingaccount2->getNomUrl(0,1,1,'',1); + print $accountingaccount2->getNomUrl(0,1,1,'',1); + } } else { print $object->accountancy_code_sell_intra; } @@ -1714,10 +1720,13 @@ else print ''; if (! empty($conf->accounting->enabled)) { - $accountingaccount3 = new AccountingAccount($db); - $accountingaccount3->fetch('',$object->accountancy_code_sell_export,1); + if (! empty($object->accountancy_code_sell_export)) + { + $accountingaccount3 = new AccountingAccount($db); + $accountingaccount3->fetch('',$object->accountancy_code_sell_export,1); - print $accountingaccount3->getNomUrl(0,1,1,'',1); + print $accountingaccount3->getNomUrl(0,1,1,'',1); + } } else { print $object->accountancy_code_sell_export; } @@ -1730,10 +1739,13 @@ else print ''; if (! empty($conf->accounting->enabled)) { - $accountingaccount4 = new AccountingAccount($db); - $accountingaccount4->fetch('',$object->accountancy_code_buy,1); + if (! empty($object->accountancy_code_buy)) + { + $accountingaccount4 = new AccountingAccount($db); + $accountingaccount4->fetch('',$object->accountancy_code_buy,1); - print $accountingaccount4->getNomUrl(0,1,1,'',1); + print $accountingaccount4->getNomUrl(0,1,1,'',1); + } } else { print $object->accountancy_code_buy; } From 7211aff01681b774a815f0690bca09324814ae78 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Aug 2018 21:11:28 +0200 Subject: [PATCH 04/28] Update dispatch.php --- htdocs/fourn/commande/dispatch.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 15e42ac089b..761cce030f7 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -517,16 +517,18 @@ if ($id > 0 || ! empty($ref)) { print ''.$langs->trans("EatByDate").''.$langs->trans("SellByDate").'' . $langs->trans("QtyOrdered") . '' . $langs->trans("QtyDispatchedShort") . '' . $langs->trans("QtyToDispatchShort") . '' . $langs->trans("Warehouse") . '
' . $langs->trans($label) . ''; - if (is_array($key[param])) { - print $form->selectarray($label, $key[param], $conf->global->$label, 0); + if (is_array($key['param'])) { + print $form->selectarray($label, $key['param'], $conf->global->$label, 0); } else { - print ''; + print ''; } print '