From b8f3264f60b7174674746b3ea9499e64d7c14162 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 29 Mar 2016 11:37:35 +0200 Subject: [PATCH 01/25] FIX: dont retrieve new buying price on margin display --- htdocs/margin/lib/margins.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/lib/margins.lib.php b/htdocs/margin/lib/margins.lib.php index 1f904c44f2d..fa33db181ec 100644 --- a/htdocs/margin/lib/margins.lib.php +++ b/htdocs/margin/lib/margins.lib.php @@ -104,7 +104,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta $marge_tx_ret=''; $marque_tx_ret=''; - if ($fk_pa > 0) { + if ($fk_pa > 0 && empty($paht)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $product = new ProductFournisseur($db); if ($product->fetch_product_fournisseur_price($fk_pa)) From 024f55d46182eb5d10035161fb396d687d2d0376 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Tue, 29 Mar 2016 12:02:36 +0200 Subject: [PATCH 02/25] FIX: systematic rounding causes prices to be updated without reason --- htdocs/core/tpl/objectline_create.tpl.php | 6 ------ htdocs/core/tpl/objectline_edit.tpl.php | 6 ------ 2 files changed, 12 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 108fb8e1339..feeb61a11e4 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -320,18 +320,12 @@ if (! empty($usemargins) && $user->rights->margins->creer) jQuery(document).ready(function() { global->DISPLAY_MARGIN_RATES)) { ?> - $('#addline').click(function (e) { - return checkFreeLine(e, "np_marginRate"); - }); $("input[name='np_marginRate']:first").blur(function(e) { return checkFreeLine(e, "np_marginRate"); }); global->DISPLAY_MARK_RATES)) { ?> - $('#addline').click(function (e) { - return checkFreeLine(e, "np_markRate"); - }); $("input[name='np_markRate']:first").blur(function(e) { return checkFreeLine(e, "np_markRate"); }); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index bb75b007524..a9f86f3123c 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -247,9 +247,6 @@ if (! empty($conf->margin->enabled)) if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?> - $('#savelinebutton').click(function (e) { - return checkEditLine(e, "np_marginRate"); - }); $("input[name='np_marginRate']:first").blur(function(e) { return checkEditLine(e, "np_marginRate"); }); @@ -258,9 +255,6 @@ if (! empty($conf->margin->enabled)) if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?> - $('#savelinebutton').click(function (e) { - return checkEditLine(e, "np_markRate"); - }); $("input[name='np_markRate']:first").blur(function(e) { return checkEditLine(e, "np_markRate"); }); From 1f723cb8d0b15e922e36532cedf164ed5b6a655d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 7 Apr 2016 14:16:10 +0200 Subject: [PATCH 03/25] FIX : Template email must take care of positino column --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a815875dc52..97a7434fd02 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -859,13 +859,13 @@ class FormMail extends Form { $ret=array(); - $sql = "SELECT rowid, label, topic, content, lang"; + $sql = "SELECT rowid, label, topic, content, lang, position"; $sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates'; $sql.= " WHERE type_template='".$this->db->escape($type_template)."'"; $sql.= " AND entity IN (".getEntity("c_email_templates").")"; $sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")"; if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; - $sql.= $this->db->order("lang,label","ASC"); + $sql.= $this->db->order("position,lang,label","ASC"); //print $sql; $resql = $this->db->query($sql); From 9d6efde9357d5025745206730651797fb4615862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 7 Apr 2016 17:12:06 +0200 Subject: [PATCH 04/25] Prevent sentry logging error with 3.9 update Since we don't ship the required libraries anymore, if the module had been enabled before upgrade, the code was failing making Dolibarr totally unusable. Mitigated the issue by disabling sentry logging if the required libraries are unavailable. --- htdocs/core/modules/syslog/mod_syslog_sentry.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/modules/syslog/mod_syslog_sentry.php b/htdocs/core/modules/syslog/mod_syslog_sentry.php index afea1a36375..a159a5edf2f 100644 --- a/htdocs/core/modules/syslog/mod_syslog_sentry.php +++ b/htdocs/core/modules/syslog/mod_syslog_sentry.php @@ -145,6 +145,10 @@ class mod_syslog_sentry extends LogHandler implements LogHandlerInterface */ public function export($content) { + if (! $this->isActive()) { + return; + } + global $conf; $dsn = $conf->global->SYSLOG_SENTRY_DSN; $client = new Raven_Client( From eb7bba956805d9b3e582e96fc688c056a1472050 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Apr 2016 15:41:01 +0200 Subject: [PATCH 05/25] Fix translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e621d98641c..069ced7854e 100755 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1494,7 +1494,7 @@ FCKeditorForProduct=WYSIWIG creation/edition of products/services description an FCKeditorForProductDetails=WYSIWIG creation/edition of products details lines for all entities (proposals, orders, invoices, etc...). Warning: Using this option for this case is seriously not recommended as it can create problems with special characters and page formating when building PDF files. FCKeditorForMailing= WYSIWIG creation/edition for mass eMailings (Tools->eMailing) FCKeditorForUserSignature=WYSIWIG creation/edition of user signature -FCKeditorForMail=WYSIWIG creation/edition for all mail (except Outils->eMailing) +FCKeditorForMail=WYSIWIG creation/edition for all mail (except Tools->eMailing) ##### OSCommerce 1 ##### OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database (Key %s not found in table %s). OSCommerceTestOk=Connection to server '%s' on database '%s' with user '%s' successfull. From 5753f217451b33a589feab210322e81f81cc9f56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Apr 2016 11:42:02 +0200 Subject: [PATCH 06/25] Missing translations --- htdocs/langs/en_US/agenda.lang | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index cb7959a0901..d8747b74fe6 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -62,6 +62,9 @@ SupplierInvoiceSentByEMail=Supplier invoice %s sent by EMail ShippingSentByEMail=Shipment %s sent by EMail ShippingValidated= Shipment %s validated InterventionSentByEMail=Intervention %s sent by EMail +ProposalDeleted=Proposal deleted +OrderDeleted=Order deleted +InvoiceDeleted=Invoice deleted NewCompanyToDolibarr= Third party created DateActionPlannedStart= Planned start date DateActionPlannedEnd= Planned end date From 80caf58866d5de31f39d99d46d3b3155cea65134 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Apr 2016 19:16:40 +0200 Subject: [PATCH 07/25] FIX Default vat is not set correctly when an error occured and we use VAT identified by a code. --- htdocs/core/class/html.form.class.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c925a587b33..9a4fb17fa9c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4013,11 +4013,18 @@ class Form $return=''; - // Define defaultnpr and defaultttx + // Define defaultnpr, defaultttx and defaultcode $defaultnpr=($info_bits & 0x01); $defaultnpr=(preg_match('/\*/',$selectedrate) ? 1 : $defaultnpr); $defaulttx=str_replace('*','',$selectedrate); - + $defaultcode=''; + if (preg_match('/\s*\((.*)\)/', $defaulttx, $reg)) + { + $defaultcode=$reg[1]; + $defaulttx=preg_replace('/\s*\(.*\)/','',$defaulttx); + } + //var_dump($defaulttx.'-'.$defaultnpr.'-'.$defaultcode); + // Check parameters if (is_object($societe_vendeuse) && ! $societe_vendeuse->country_code) { @@ -4113,9 +4120,13 @@ class Form $return.= $rate['nprtva'] ? '*': ''; if ($addcode && $rate['code']) $return.=' ('.$rate['code'].')'; $return.= '"'; - if ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr) + if ($defaultcode) { - $return.= ' selected'; + if ($defaultcode == $rate['code']) $return.= ' selected'; + } + elseif ($rate['txtva'] == $defaulttx && $rate['nprtva'] == $defaultnpr) + { + $return.= ' selected'; } $return.= '>'.vatrate($rate['libtva']); //$return.=($rate['code']?' '.$rate['code']:''); From daa1aed3633ead45c650d16bfade6ca30075f21c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Apr 2016 19:31:18 +0200 Subject: [PATCH 08/25] Bad placeholder --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 52f30317a3e..cb4f65abeed 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1885,7 +1885,7 @@ else 'name' => 'soc_origin', 'label' => $langs->trans('MergeOriginThirdparty'), 'type' => 'other', - 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 1, 0, 0, array(), 0, 'minwidth200') + 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 'SelectThirdParty', 0, 0, array(), 0, 'minwidth200') ) ); From f90cffd74ab07245968688514f0e7fd63040a71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 9 Apr 2016 15:42:53 +0200 Subject: [PATCH 09/25] Update nusoap.php re-establish user-agent --- htdocs/includes/nusoap/lib/nusoap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 403d74b13e9..6defe0e6004 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base { } $this->use_curl = $use_curl; preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); - if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')'); + $this->setHeader('User-Agent', $this->title.'/'.$this->version.(isset($rev[1])?' ('.$rev[1].')':'')); } /** From 9169adf4ceab98ad04a180653f205b4b928b7cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 22:34:55 +0200 Subject: [PATCH 10/25] FIX #4766 VAT not shown in supplier invoice popup Close #4766 --- htdocs/compta/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 5fb1d638a88..5c93c1e62db 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -5,6 +5,7 @@ * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2016 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 @@ -230,7 +231,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) */ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { - $sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type"; + $sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type"; $sql.= ", s.nom as name"; $sql.= ", s.rowid as socid"; $sql.= ", s.code_fournisseur"; From b2f922291fefb66eb845ae7fce78ef536bcf60ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 22:38:58 +0200 Subject: [PATCH 11/25] FIX #4851 Project selector in supplier invoices shows the project label twice Close #4851 --- htdocs/core/class/html.formprojet.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 2b7f76dedf9..4c094061ee4 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -180,7 +180,7 @@ class FormProjets continue; } - $labeltoshow=dol_trunc($obj->ref,18).' - '.$obj->title; + $labeltoshow=dol_trunc($obj->ref,18); //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')'; $labeltoshow.=' '.dol_trunc($obj->title,$maxlength); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 890772326ea..42418184c4f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1474,7 +1474,7 @@ class FactureFournisseur extends CommonInvoice if (! empty($this->total_ht)) $label.= '
' . $langs->trans('AmountHT') . ': ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_tva)) - $label.= '
' . $langs->trans('TVA') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + $label.= '
' . $langs->trans('VAT') . ': ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); if (! empty($this->total_ttc)) $label.= '
' . $langs->trans('AmountTTC') . ': ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); From 1026484da1ec129a47cc84d4ec16e3d4863189df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 22:48:42 +0200 Subject: [PATCH 12/25] FIX #4748 Supplier invoice payment confirmation amount is not translated Close #4748 --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 81fe1d6b345..d69c2df9a94 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -432,7 +432,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $preselectedchoice=$addwarning?'no':'yes'; print '
'; - $text=$langs->trans('ConfirmSupplierPayment',$totalpayment,$langs->trans("Currency".$conf->currency)); + $text=$langs->trans('ConfirmSupplierPayment', price($totalpayment),$langs->trans("Currency".$conf->currency)); if (GETPOST('closepaidinvoices')) { $text.='
'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed"); From 7cc1288bb2c4c9b86802f761664ff5903ff1b8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 22:54:13 +0200 Subject: [PATCH 13/25] FIX #4743 UI glitch in project summary page Close #4743 --- htdocs/projet/element.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 1be43fe94dd..c475dcbcae0 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -344,8 +344,7 @@ $langs->load("orders"); $langs->load("proposals"); $langs->load("margins"); -//print load_fiche_titre($langs->trans("Profit"),'','title_accountancy'); -print '
'.img_picto("", "title_accountancy").' '.$langs->trans("Profit").'

'; +print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy'); print ''; print ''; From 3135cf720d8ccfc8ff09b821e664fd4be3a66edb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 22:56:45 +0200 Subject: [PATCH 14/25] FIX #4737 Bank transacion type selector translation is cropped Close #4737 --- htdocs/compta/bank/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php index 80befe3d433..d4f4b82a96b 100644 --- a/htdocs/compta/bank/search.php +++ b/htdocs/compta/bank/search.php @@ -210,7 +210,7 @@ if ($resql) print ''; print ''; print ''; print ''; print ''; print "\n"; From af473df2143a275a4d1704a2ac2dfaaefa5dfa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 23:27:42 +0200 Subject: [PATCH 17/25] FIX #4742 Able to delete a supplier invoice with a registered payment Close #4742 --- htdocs/fourn/facture/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index c2b2c587736..7887e8cc6ed 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2270,7 +2270,11 @@ else // Delete if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer) { - print ''.$langs->trans('Delete').''; + if ($object->getSommePaiement()) { + print ''; + } else { + print ''.$langs->trans('Delete').''; + } } print ''; print '
'; From 15d927375132469cd89c7fcf834be5ccc9886495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 Apr 2016 00:30:31 +0200 Subject: [PATCH 18/25] FIX #4747 Missing UI background when registering a supplier invoice payment Close #4747 --- htdocs/fourn/facture/paiement.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 758885cef58..dcaabd160f8 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -281,9 +281,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; + dol_fiche_head(); + print '
  '; - $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8); + $form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1); print ''; From b9de3d5852d59d0ca9ca0f73852ffdb431e29fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 23:03:00 +0200 Subject: [PATCH 15/25] FIX #4442 Missing translation in Banks menu Close #4442 --- htdocs/core/menus/standard/eldy.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 8d6882c26c2..b6a98b1c2d3 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -970,6 +970,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $langs->load("withdrawals"); $langs->load("banks"); $langs->load("bills"); + $langs->load('categories'); // Bank-Caisse if (! empty($conf->banque->enabled)) From 865f9defff1b2ca8b23684c59e44f03b94bd0d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 9 Apr 2016 23:08:47 +0200 Subject: [PATCH 16/25] FIX #4424 Missing email of user popup in supplier orders area Close #4424 --- htdocs/fourn/commande/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index c877589851d..510ca2755be 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -245,7 +245,7 @@ if (! empty($conf->fournisseur->enabled)) /* * List of users allowed */ -$sql = "SELECT u.rowid, u.lastname, u.firstname"; +$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u,"; $sql.= " ".MAIN_DB_PREFIX."user_rights as ur"; $sql.= ", ".MAIN_DB_PREFIX."rights_def as rd"; @@ -278,6 +278,7 @@ if ($resql) $userstatic->id=$obj->rowid; $userstatic->lastname=$obj->lastname; $userstatic->firstname=$obj->firstname; + $userstatic->email=$obj->email; print $userstatic->getNomUrl(1); print '
'; - print ''; print '
'.$langs->trans('Payment').'
'.$langs->trans('Company').''; $supplierstatic->id=$obj->socid; $supplierstatic->name=$obj->name; @@ -311,6 +312,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print '
'; + dol_fiche_end(); $parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -337,7 +339,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $i = 0; print '
'; - print $langs->trans('Invoices').'
'; if(!empty($conf->global->FAC_AUTO_FILLJS)){ //Add js for AutoFill From 7acbf1dd92112dfbdfdc6228ac4e8f0660531a90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 Apr 2016 01:00:27 +0200 Subject: [PATCH 19/25] FIX #4874 SQL error when listing users Close #4874 --- htdocs/user/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 8710dc87e04..3d787762a8c 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 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 @@ -201,7 +202,9 @@ if ($search_login != '') $sql.= natural_search("u.login", $search_login); if ($search_lastname != '') $sql.= natural_search("u.lastname", $search_lastname); if ($search_firstname != '') $sql.= natural_search("u.firstname", $search_firstname); if ($search_gender != '' && $search_gender != '-1') $sql.= " AND u.gender = '".$search_gender."'"; -if ($search_employee >= 0) $sql.= natural_search("u.employee", $search_employee); +if (is_numeric($search_employee) && $search_employee >= 0) { + $sql .= ' AND u.employee = '.(int) $search_employee; +} if ($search_accountancy_code != '') $sql.= natural_search("u.accountancy_code", $search_accountancy_code); if ($search_email != '') $sql.= natural_search("u.email", $search_email); if ($search_statut != '' && $search_statut >= 0) $sql.= " AND (u.statut=".$search_statut.")"; From b7275edfb8db5a92e19a901ac61b22a0bd107370 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 11 Apr 2016 14:24:31 +0200 Subject: [PATCH 20/25] FIX #4989 --- htdocs/admin/dict.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index bc56f13cc66..a5a3139353a 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -232,7 +232,7 @@ $tabfield[21]= "code,label"; $tabfield[22]= "code,label"; $tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[24]= "code,label"; -$tabfield[25]= "label,type_template,position,topic,content"; +$tabfield[25]= "label,type_template,private,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; $tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country"; @@ -264,7 +264,7 @@ $tabfieldvalue[21]= "code,label"; $tabfieldvalue[22]= "code,label"; $tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[24]= "code,label"; -$tabfieldvalue[25]= "label,type_template,position,topic,content"; +$tabfieldvalue[25]= "label,type_template,private,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; $tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country"; @@ -585,7 +585,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors'); } - + // Clean some parameters if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0 if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0 @@ -685,7 +685,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; - + print $sql; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); @@ -1330,7 +1330,7 @@ if ($id) if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $canbedisabled=0; $canbedisabled = 0; } $canbemodified=$iserasable; if ($obj->code == 'RECEP') $canbemodified=1; - + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&'; // Favorite From 23bb2eaf8a4e1be3fdf22db1d4b05324bf6287a3 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 11 Apr 2016 14:27:17 +0200 Subject: [PATCH 21/25] remove debug --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a5a3139353a..5e9fc895f0b 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -685,7 +685,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; - print $sql; + dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); From 8035742779d1b7f9c4afe90fb6b6fd44a3a9aa2e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 11 Apr 2016 14:52:22 +0200 Subject: [PATCH 22/25] FIX fetchAllEMailTemplate --- htdocs/core/class/html.formmail.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index bc185ef6d71..f8f6afcf1ff 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -334,7 +334,7 @@ class FormMail extends Form $out.= '   '; $out.= ''; } - + $out.= ''."\n"; @@ -894,7 +894,7 @@ class FormMail extends Form $line->id=$obj->rowid; $line->label=$obj->label; $line->topic=$obj->topic; - $line->content=$obj->lacontentbel; + $line->content=$obj->content; $line->lang=$obj->lang; $this->lines_model[]=$line; } From 791df0c9ea4e657c2d80c51d91b9c41886463551 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:27:34 +0200 Subject: [PATCH 23/25] FIX: correct display of minimum buying price --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 344fa3ffa56..50613103848 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -540,7 +540,7 @@ class ProductFournisseur extends Product { global $langs; $langs->load("suppliers"); - $out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); + $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); return $out; } From 983b2c9a210c11a56f7af7376686afaef70ba8b6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:40:47 +0200 Subject: [PATCH 24/25] FIX: real min buying price --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 89760dc66ba..10d50acebe0 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -354,7 +354,7 @@ if ($id > 0 || ! empty($ref)) else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; } } print ''; - $totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT'); + $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges), 'MT'); $total+=$totalline; print ''; if (! empty($conf->stock->enabled)) print ''; // Real stock From 292373cf8401f190ccc7269838d0e0efdff5d0c6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:43:10 +0200 Subject: [PATCH 25/25] forgot new discount field --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 10d50acebe0..6cb6424bdc4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -354,7 +354,7 @@ if ($id > 0 || ! empty($ref)) else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; } } print ''; - $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges), 'MT'); + $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT'); $total+=$totalline; print ''; if (! empty($conf->stock->enabled)) print ''; // Real stock
'.($notdefined?'':price($totalline,'','',0,0,-1,$conf->currency)).''.$langs->trans("Stock").': '.$value['stock'].''.($notdefined?'':price($totalline,'','',0,0,-1,$conf->currency)).''.$langs->trans("Stock").': '.$value['stock'].'