From dada8c8ff57ce95538bda83a0074b585dbe5ad1c Mon Sep 17 00:00:00 2001 From: gauthier Date: Mon, 4 Mar 2019 17:23:29 +0100 Subject: [PATCH 1/7] FIX : wrong redirect link on holiday refuse --- htdocs/holiday/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index be61223d704..b69f6fb185b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -568,7 +568,7 @@ if ($action == 'confirm_refuse') } } else { - header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&error=NoMotifRefuse'); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'&error=NoMotifRefuse'); exit; } } From 9a9fd15077dfe3eacac754f537ffeda956601747 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2019 14:10:33 +0100 Subject: [PATCH 2/7] Fix doxygen --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index d08e8efd919..3a27690e7ac 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1501,6 +1501,7 @@ class FactureFournisseur extends CommonInvoice * @param int $origin_id id origin document * @param double $pu_ht_devise Amount in currency * @param string $ref_supplier Supplier ref + * @param string $special_code Special code * @return int >0 if OK, <0 if KO */ public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false, $array_options=0, $fk_unit=null, $origin_id=0, $pu_ht_devise=0, $ref_supplier='', $special_code='') From d88fc8cf91601ddfd7276dd4bc97196cee5e1518 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2019 17:32:10 +0100 Subject: [PATCH 3/7] Fix bad link --- 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 dccc3df312f..54906249234 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -436,7 +436,7 @@ $listofreferent=array( 'table'=>'projet_task', 'datefieldname'=>'task_date', 'disableamount'=>0, - 'urlnew'=>DOL_URL_ROOT.'/projet/tasks.php?id='.$id, + 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?id='.$id, 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), From d02cec95798c54d595d64cdbd72f5f2dcc39d364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 7 Mar 2019 18:13:21 +0100 Subject: [PATCH 4/7] phpcs fix v9 --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 2f25481acd7..22d430919e3 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1555,6 +1555,7 @@ class FactureFournisseur extends CommonInvoice * @param int $origin_id id origin document * @param double $pu_ht_devise Amount in currency * @param string $ref_supplier Supplier ref + * @param string $special_code Special code * @return int >0 if OK, <0 if KO */ public function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false, $array_options=0, $fk_unit=null, $origin_id=0, $pu_ht_devise=0, $ref_supplier='', $special_code='') From 1a96a7a88f8c1286f1f009e2050b88857c59e41a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2019 11:31:12 +0100 Subject: [PATCH 5/7] FIX More complete auto setup of barcode module Add tooltip help on member setup module --- htdocs/adherents/admin/adherent.php | 4 ++++ htdocs/admin/barcode.php | 15 ++++++++++----- .../barcode/mod_barcode_product_standard.php | 7 +++++-- htdocs/langs/en_US/admin.lang | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index cb1fdfac816..b2c5dc6c0d8 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -183,6 +183,10 @@ if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! emp if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice"); print ''; print $form->selectarray('ADHERENT_BANK_USE',$arraychoices,$conf->global->ADHERENT_BANK_USE,0); +if ($conf->global->ADHERENT_BANK_USE == 'bankdirect' || $conf->global->ADHERENT_BANK_USE == 'bankviainvoice') +{ + print '
'.$langs->trans("ABankAccountMustBeDefinedOnPaymentModeSetup").'
'; +} print ''; print "\n"; diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 6cf9c84d265..e0bea2bbf52 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -44,7 +44,12 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'setbarcodeproducton') { - $res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", GETPOST('value'), 'chaine', 0, '', $conf->entity); + $barcodenumberingmodule = GETPOST('value', 'alpha'); + $res=dolibarr_set_const($db, "BARCODE_PRODUCT_ADDON_NUM", $barcodenumberingmodule, 'chaine', 0, '', $conf->entity); + if ($barcodenumberingmodule == 'mod_barcode_product_standard' && empty($conf->global->BARCODE_STANDARD_PRODUCT_MASK)) + { + $res=dolibarr_set_const($db, "BARCODE_STANDARD_PRODUCT_MASK", '020{000000000}', 'chaine', 0, '', $conf->entity); + } } elseif ($action == 'setbarcodeproductoff') { @@ -406,14 +411,14 @@ if ($conf->produit->enabled) if ($conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") { - print ''; - print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); print ''; } else { - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index 97121eebcfd..03eccad608a 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -95,8 +95,11 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode $tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("BarCode"),$langs->transnoentities("BarCode")); $tooltip.=$langs->trans("GenericMaskCodes3"); - $tooltip.=$langs->trans("GenericMaskCodes4c"); - $tooltip.=$langs->trans("GenericMaskCodes5"); + $tooltip.=''.$langs->trans("Example").':
'; + $tooltip.='020{000000000} (for internal use)
'; + $tooltip.='9771234{00000} (example of ISSN code with prefix 1234)
'; + $tooltip.='9791234{00000} (example of ISMN code with prefix 1234)
'; + //$tooltip.=$langs->trans("GenericMaskCodes5"); // Mask parameter //$texte.= ''.$langs->trans("Mask").' ('.$langs->trans("BarCodeModel").'):'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index ce912b72266..9c8c3d60854 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1854,4 +1854,5 @@ ConfirmUnactivation=Confirm module reset OnMobileOnly=On small screen (smartphone) only DisableProspectCustomerType=Disable the "Prospect + Customer" third party type (so third party must be Prospect or Customer but can't be both) MAIN_OPTIMIZEFORTEXTBROWSER=Simplify interface for blind person -MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or use application from a text browser like lynx or links. \ No newline at end of file +MAIN_OPTIMIZEFORTEXTBROWSERDesc=Enable this option if you are a blind person, or use application from a text browser like lynx or links. +ABankAccountMustBeDefinedOnPaymentModeSetup=Note: The bank account must be defined on the module of each payment mode (Paypal, Stripe, ...) to have this feature working. \ No newline at end of file From 233bd4374a3849b6cd575ecc36b78528bbd5caba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2019 19:52:26 +0100 Subject: [PATCH 6/7] Fix phpcs --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 4642c0bf753..46c50a75256 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1382,6 +1382,7 @@ class FactureFournisseur extends CommonInvoice * @param int $origin_id id origin document * @param double $pu_ht_devise Amount in currency * @param string $ref_supplier Supplier ref + * @param string $special_code Special code * @return int >0 if OK, <0 if KO * * FIXME Add field ref (that should be named ref_supplier) and label into update. For example can be filled when product line created from order. From 4022d5f5296746526ea5b6d332764bf6b9884fa2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2019 23:58:04 +0100 Subject: [PATCH 7/7] FIX Can not create contract with numbering module without autogen rule --- htdocs/contrat/class/contrat.class.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index dc94d57809f..2b9de7fc9e2 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -892,6 +892,7 @@ class Contrat extends CommonObject $sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL"); $sql.= ")"; $resql=$this->db->query($sql); + if ($resql) { $error=0; @@ -908,9 +909,8 @@ class Contrat extends CommonObject if ($result > 0) { $modCodeContract = new $module(); - - if (!empty($modCodeContract->code_auto)) { - // Mise a jour ref + if (! empty($modCodeContract->code_auto)) { + // Force the ref to a draft value if numbering module is an automatic numbering $sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id; if ($this->db->query($sql)) { @@ -919,9 +919,6 @@ class Contrat extends CommonObject $this->ref="(PROV".$this->id.")"; } } - } else { - $error++; - $this->error='Failed to get PROV number'; } } @@ -1389,7 +1386,7 @@ class Contrat extends CommonObject if (empty($remise_percent)) $remise_percent=0; $localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc); - + // Clean vat code $vat_src_code=''; if (preg_match('/\((.*)\)/', $txtva, $reg)) @@ -1397,7 +1394,7 @@ class Contrat extends CommonObject $vat_src_code = $reg[1]; $txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate. } - + // Calcul du total TTC et de la TVA pour la ligne a partir de // qty, pu, remise_percent et txtva // TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker