From 8d829dca320ca0a9c864a9052447a8d55043d483 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 6 Nov 2015 09:49:02 +0100 Subject: [PATCH 01/19] FIX : only active customer should be return into new invoice creation select list --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a69b35c9559..4e05be21c01 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1855,7 +1855,7 @@ if ($action == 'create') else { print ''; - print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1); + print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1); print ''; } print '' . "\n"; From 4d11205a01f056dd1a0dd2baf1223e35ef953d60 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Fri, 6 Nov 2015 09:51:33 +0100 Subject: [PATCH 02/19] FIX: change object statut on close shipping and remove erratic db commit --- htdocs/expedition/class/expedition.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e68b063d7d2..106befda596 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1542,8 +1542,8 @@ class Expedition extends CommonObject if ($this->db->query($sql) ) { //TODO: Option to set order billed if 100% of order is shipped + $this->statut=2; $this->billed=1; - $this->db->commit(); return 1; } else From b4c3804c911d458d575ab0ce559e2acbf521ae6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 13:21:03 +0100 Subject: [PATCH 03/19] FIX #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card --- htdocs/commande/fiche.php | 32 ++++++++++++++++++++++---------- htdocs/compta/facture.php | 23 ++++++++++++++++------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 9a844b0a5d5..78370bad2cb 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1366,6 +1366,9 @@ if ($action == 'create' && $user->rights->commande->creer) { if ($socid > 0) $res = $soc->fetch($socid); + $projectid = 0; + $remise_absolue = 0; + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; @@ -1423,17 +1426,26 @@ if ($action == 'create' && $user->rights->commande->creer) { $srccontactslist = $objectsrc->liste_contact(- 1, 'external', 1); } } - else - { - $cond_reglement_id = $soc->cond_reglement_id; - $mode_reglement_id = $soc->mode_reglement_id; - $availability_id = $soc->availability_id; - $demand_reason_id = $soc->demand_reason_id; - $remise_percent = $soc->remise_percent; - $remise_absolue = 0; - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''; - $projectid = 0; + + if (!$cond_reglement_id) { + $cond_reglement_id = $soc->cond_reglement_id; } + if (!$mode_reglement_id) { + $mode_reglement_id = $soc->mode_reglement_id; + } + if (!$availability_id) { + $availability_id = $soc->availability_id; + } + if (!$demand_reason_id) { + $demand_reason_id = $soc->demand_reason_id; + } + if (!$remise_percent) { + $remise_percent = $soc->remise_percent; + } + if (!$dateinvoice) { + $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? - 1 : ''; + } + $absolute_discount=$soc->getAvailableDiscounts(); $nbrow = 10; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index af28d80b9e9..0d06394ab69 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1860,6 +1860,8 @@ if ($action == 'create') if ($socid > 0) $res = $soc->fetch($socid); + $remise_absolue = 0; + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) @@ -1916,14 +1918,21 @@ if ($action == 'create') } $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : ''; // Dot not set 0 here (0 for a date is 1970) } - else - { - $cond_reglement_id = $soc->cond_reglement_id; - $mode_reglement_id = $soc->mode_reglement_id; - $remise_percent = $soc->remise_percent; - $remise_absolue = 0; - $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970) + + if (!$cond_reglement_id) { + $cond_reglement_id = $soc->cond_reglement_id; } + if (!$mode_reglement_id) { + $mode_reglement_id = $soc->mode_reglement_id; + } + if (!$remise_percent) { + $remise_percent = $soc->remise_percent; + } + if (!$dateinvoice) { + // Do not set 0 here (0 for a date is 1970) + $dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); + } + $absolute_discount = $soc->getAvailableDiscounts(); if (! empty($conf->use_javascript_ajax)) From 3bbedf1795c8b93527954af5fc814034b9b94800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 13:39:34 +0100 Subject: [PATCH 04/19] FIX #3707 Thirdparty bank account page table has a glitch --- htdocs/societe/rib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 55f1a111a93..6505ea24f63 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -401,7 +401,14 @@ if ($socid && $action != 'edit' && $action != "create") } if (count($rib_list) == 0) { - print ''.$langs->trans("NoBANRecord").''; + + if (! empty($conf->prelevement->enabled)) { + $colspan = 8; + } else { + $colspan = 7; + } + + print ''.$langs->trans("NoBANRecord").''; } print ''; From 728f469c1e37e9cec1f22686461f8eedf48e8d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 13:43:59 +0100 Subject: [PATCH 05/19] FIX #3890 Expected transactions bank account page, shows negative numbers --- htdocs/compta/bank/treso.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index b9274c34eb5..1b9925e761c 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -2,6 +2,7 @@ /* Copytight (C) 2005-2009 Regis Houssin * Copyright (C) 2008-2009 Laurent Destailleur (Eldy) * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2015 Marcos García "; print "".$ref.""; print "".$refcomp.""; - if ($obj->total_ttc < 0) { print "".price($total_ttc)." "; }; + if ($obj->total_ttc < 0) { print "".price(abs($total_ttc))." "; }; if ($obj->total_ttc >= 0) { print " ".price($total_ttc).""; }; print ''.price($solde).''; print ""; From 01854b32597022f0a7c595154809a9b2ba0e6930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 13:51:09 +0100 Subject: [PATCH 06/19] FIX #3679 Error when deleting a Localtax2 special payment --- htdocs/compta/localtax/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 1b16064ed9e..27990a021cb 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -1,5 +1,6 @@ + * 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 @@ -104,7 +105,7 @@ if ($_GET["action"] == 'delete') if ($result > 0) { $db->commit(); - header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php'); + header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt); exit; } else From 84a152dc2ec2c84350a7214071422ed9b3251712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 15:33:48 +0100 Subject: [PATCH 07/19] FIX #3836 Unable to upload a document to an invoice under some circunstances --- htdocs/core/lib/files.lib.php | 6 +++++- htdocs/core/tpl/document_actions_post_headers.tpl.php | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index c92d5ab4f25..b30e0494b39 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2008-2012 Laurent Destailleur * Copyright (C) 2012-2013 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 @@ -1041,10 +1042,13 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio // Define $destpath (path to file including filename) and $destfile (only filename) $destpath=$upload_dir . "/" . $_FILES[$varfiles]['name']; $destfile=$_FILES[$varfiles]['name']; + + $savingdocmask = dol_sanitizeFileName($savingdocmask); + if ($savingdocmask) { $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); - $destfile=preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); + $destfile=dol_osencode(preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask)); } $resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $destpath, $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles); diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 75d18c2b1a5..0e91a3e182d 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -1,6 +1,7 @@ * Copyright (C) 2013-2014 Laurent Destailleur + * 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 (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) //var_dump($modulepart); if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task'))) { - $savingdocmask=$object->ref.'-__file__'; + $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; } /*if (in_array($modulepart,array('member'))) { From 4a52d3c1b1a2ca4df694e222df71b6591676e5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 7 Nov 2015 15:35:00 +0100 Subject: [PATCH 08/19] Removed unwanted change --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b30e0494b39..7f6737afba2 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1048,7 +1048,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio if ($savingdocmask) { $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); - $destfile=dol_osencode(preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask)); + $destfile=preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); } $resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $destpath, $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles); From f0a3bca4c205b00d36336063b59ba389480494fe Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 8 Nov 2015 04:22:49 +0100 Subject: [PATCH 09/19] Fix: Accountancy compatibility with subtotal & jalon module --- htdocs/accountancy/customer/card.php | 12 ++++++++---- htdocs/accountancy/customer/list.php | 10 ++++++---- htdocs/accountancy/supplier/card.php | 7 ++++--- htdocs/accountancy/supplier/list.php | 11 ++++++----- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 9eb546ec89d..51190afdc98 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Florian Henry - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * * 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 @@ -19,7 +19,7 @@ /** * \file htdocs/accountancy/customer/card.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Card customer ventilation */ @@ -84,7 +84,11 @@ if (! empty($id)) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture"; - $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; + $sql .= " WHERE f.fk_statut > 0"; + $sql .= " AND l.rowid = " . $id; + if (! empty($conf->multicompany->enabled)) { + $sql .= " AND f.entity = '" . $conf->entity . "'"; + } if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 8ee5eb41eb5..dcf46fe4a44 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -21,7 +21,7 @@ /** * \file htdocs/accountancy/customer/list.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Ventilation page from customers invoices */ @@ -121,7 +121,7 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $offset = $limit * $page; -$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,"; +$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell"; $sql .= " , aa.rowid as aarowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; @@ -129,7 +129,9 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_fac $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; -$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0"; +$sql .= " WHERE f.fk_statut > 0"; +$sql. = " AND fk_code_ventilation <= 0"; +$sql. = " AND product_type <= 2"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 1acd5829c45..8e5d2135965 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2005 Simon TOSSER - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent @@ -22,7 +22,7 @@ */ /** * \file htdocs/accountancy/supplier/card.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Card supplier ventilation */ @@ -85,7 +85,8 @@ if ($_GET["id"]) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn "; - $sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id; + $sql .= " WHERE f.fk_statut > 0"; + $sql .= " AND l.rowid = " . $id; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 656afbd32cc..0ed1e1d6aa2 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Ari Elbaz (elarifr) * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Juanjo Menent s @@ -21,7 +21,7 @@ /** * \file htdocs/accountancy/supplier/list.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Ventilation page from suppliers invoices */ @@ -124,16 +124,17 @@ if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { $offset = $limit * $page; -$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, "; +$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; -$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0"; +$sql .= " WHERE f.fk_statut > 0"; +$sql .= " AND fk_code_ventilation <= 0"; +$sql. = " AND product_type <= 2"; $sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')"; - if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; } From 7a0206adceb3760f867658bff3a0f78bbcdfb3db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 14:37:50 +0100 Subject: [PATCH 10/19] FIX Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal. --- htdocs/commande/class/commande.class.php | 4 ++-- .../interface_20_modWorkflow_WorkflowManager.class.php | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f6f332d462b..5d2907041b2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1043,7 +1043,7 @@ class Commande extends CommonOrder $this->ref_client = $object->ref_client; $this->note_private = $object->note_private; $this->note_public = $object->note_public; - + $this->origin = $object->element; $this->origin_id = $object->id; @@ -1133,7 +1133,7 @@ class Commande extends CommonOrder { global $mysoc, $conf, $langs; - dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type", LOG_DEBUG); + dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index d144f365533..4d3afeb8d92 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -61,6 +61,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $newobject = new Commande($this->db); + $newobject->context['createfrompropal'] = 'createfrompropal'; + $newobject->context['origin'] = $object->element; + $newobject->context['origin_id'] = $object->id; + $ret=$newobject->createFromProposal($object); if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } return $ret; @@ -76,6 +80,10 @@ class InterfaceWorkflowManager extends DolibarrTriggers include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $newobject = new Facture($this->db); + $newobject->context['createfromorder'] = 'createfromorder'; + $newobject->context['origin'] = $object->element; + $newobject->context['origin_id'] = $object->id; + $ret=$newobject->createFromOrder($object); if ($ret < 0) { $this->error=$newobject->error; $this->errors[]=$newobject->error; } return $ret; From c639e820621cfe675cea540f443fc007f3972009 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 12:16:30 +0100 Subject: [PATCH 11/19] FIX Add a protection to not make release if ChangeLog was not generated. Conflicts: ChangeLog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 4d3b8252107..d5926b573ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection" Upgrading to any other version or database system is abolutely required BEFORE trying to make a Dolibarr upgrade. + ***** ChangeLog for 3.7.2 compared to 3.7.1 ***** FIX [ bug #2855 ] Wrong translation key in localtax report page FIX [ bug #1852 ] JS error when editing a customer order line From 9b8bb114cd1850ceaf198ed840c40beeb1c0ba6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 12:12:28 +0100 Subject: [PATCH 12/19] FIX Add a protection to not make release if ChangeLog was not generated. Prepare package 3.7.2 Conflicts: ChangeLog --- ChangeLog | 102 ++++++++++++++++++++++++++++++------- build/makepack-dolibarr.pl | 22 ++++++++ 2 files changed, 107 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5926b573ce..1248b7b1988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,24 +10,92 @@ make a Dolibarr upgrade. ***** ChangeLog for 3.7.2 compared to 3.7.1 ***** -FIX [ bug #2855 ] Wrong translation key in localtax report page -FIX [ bug #1852 ] JS error when editing a customer order line -FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form -FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image -FIX [ bug 1634 ] Error deleting a project when it had many linked objects -FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly -FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne -FIX: Not showing delivery date on rouget pdf +FIX: #2957 : missing $langs object for trigger +FIX: #2983 Load gravatar avatar images securely over HTTPS +FIX: #3009: Better filtering to prevent SQL injection +FIX: #3091 TotalHT amount in supplier order is bold unlike the rest of Dolibarr +FIX: #3262 Webservice getProductsForCategory() +FIX: #3318 +FIX: [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice +FIX: #3530 +FIX: #3630 - Wrong balance report when module salaries and donation disabled +FIX: #3679 Error when deleting a Localtax2 special payment +FIX: #3707 Thirdparty bank account page table has a glitch +FIX: #3724 Bug: Blank page after cloning proposal with changed client +FIX: #3836 Unable to upload a document to an invoice under some circunstances +FIX: #3841 creation of a task completed has not status set to finished by default +FIX: Add a protection to not make release if ChangeLog was not generated. +FIX: adjusted test for affecting supplier reference +FIX: Admin fiche inter page do not take good action +FIX: Avoid warning strict mode when hosting server do not have php5_curl installed +FIX: bad calculation for stock value +FIX: Bad condition into invoice export request making reporting too many rows. +FIX: bad stock valorisation +FIX: Bad visualization of suppliers name on Incomes-Expenses mode +FIX: Better management error into the color conversion functions +FIX: [ bug 1634 ] Error deleting a project when it had many linked objects +FIX: [ bug 1925 ] "Link to order" option in supplier invoices is not working properly +FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask +FIX: [ bug #3211 ] Error about sold to pay (Montant encours) +FIX: [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights +FIX: [ bug #3358 ] Tasks box does not work with PostgreSQL +FIX: [ bug #3383 ] Company name is overlapped with company direction in PDF models +FIX: [ bug #3426 ] Unable to create an invoice from a contract with extrafields +FIX: [ bug #3431 ] Invoice bank account is not respected +FIX: [ bug #3432 ] Spaces should be removed from IBAN when formatting it +FIX: Can create Proposal on close thridparty #3526 +FIX: change order date on clone (as everywhere else) +FIX: Close #2835 Customer prices of a product shows incorrect history order +FIX: Close #2837 Product list table column header does not match column body +FIX: Close bug #2855 Wrong translation key in localtax report page +FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0 +FIX: Close bug #2891 Category hooks do not work +FIX: Close bug #2900 Courtesy title is not stored in create thirdparty form +FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI +FIX: contact country had wrong display if the country dont have translate +FIX: Display country name instead of country id (display country id makes no sense on vcard files) +FIX: display error on extrafields on ficheinter +FIX: double db escape add too quote +FIX: Email selector contact must not include inactive contact +FIX: End log must use same level then start log. +FIX: error in SQL due to a previous fix +FIX: event's data lost on user assign update +FIX: Export of tags for contact and member +FIX: facturestat bad sql when customer view is limited +FIX: if multicompany enabled, call to undifend method _setCookie instead of setCookie +FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values) +FIX: keep filter by category or by not enough stock if we switch page +FIX: Line break display as a block +FIX: load propal langs for availability traduction +FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch +FIX: Mass Mailing activity don't display all status +FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal. +FIX: multientity warehouse management +FIX: New adherent from, always redirect on entity +FIX: No check warehouse is provided if module stock is not enabled. +FIX: no need to remove file into mail form, the temp dir will be deleted after any sending +FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE FIX: Not showing task extrafields when creating from left menu -FIX [ bug #3288 ] Tasks box is not properly drawn -FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts -FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights -FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields -FIX [ bug #3431 ] Invoice bank account is not respected -FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it -FIX [ bug #3358 ] Tasks box does not work with PostgreSQL -FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models -FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message +FIX: only active customer should be return into new invoice creation select list +FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order +FIX: WAP calculation +FIX: Save of filters into export profiles failed. +FIX: supplier rights for orderToInvoice +FIX: Syntax error in Debian Apache configuration +FIX: The hours of date filter aren't correct +FIX: tool export handle the type "select" extrafields and return the value instead of id +FIX: total amount in tpl linked object are not reset +FIX: translate Jabberid on contact page with edit view +FIX: translation for 1 word do not work if product/service module are disabled because the translation search in products.lang +FIX: update2.php test res befre assign it +FIX: When delete actioncomm also delete actioncomm_resources +FIX: when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated +FIX: when mailing is deleted, the targets list was kept in database +FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask) +FIX: When we add an user on event in create mode, we lose linked object +FIX: When we automatically creta an order from a proposal with workflow module, if some extrafields of propal don't exist in order object, insertExtraFields() function tries to insert extrafields in unexistant column of commande_extrafields table. +FIX: When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third. +FIX: XSS security using the onerror and missing escapement on type of member page. NEW: Created new ContratLigne::insert function diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 18e7092fc1b..d37c6b891aa 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -344,6 +344,28 @@ if ($nboftargetok) { print "Go to directory $SOURCE\n"; $olddir=getcwd(); chdir("$SOURCE"); + + # Test that the ChangeLog is ok + $ret=`grep "ChangeLog for $MAJOR.$MINOR\.$BUILD" "$SOURCE/ChangeLog" 2>&1`; + if (! $ret) + { + print "Error: The ChangeLogFile was not updated. Run the following command first:\n"; + if (! $BUILD) + { + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + } + else + { + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + } + print "\n"; + exit; + } + else + { + print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n"; + } + print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; if ($ret =~ /already exists/) From 04aba8ce96807bf7856d263379fc911227e7660f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 12:19:05 +0100 Subject: [PATCH 13/19] Abandon package APS. Was never used. --- build/makepack-dolibarr.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index d37c6b891aa..a47fb76d35c 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -22,7 +22,8 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; $PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; -@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages +#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages +@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages %REQUIREMENTPUBLISH=( "SF"=>"git ssh rsync", "ASSO"=>"git ssh rsync" From d4aeb8b3bcea0e212de82f2ade1070f56a262088 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 12:19:05 +0100 Subject: [PATCH 14/19] Abandon package APS. Was never used. --- build/makepack-dolibarr.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 9db6f3a4da3..c2359241ad0 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -22,7 +22,8 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; $PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; -@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages +#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages +@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages %REQUIREMENTPUBLISH=( "SF"=>"git ssh rsync", "ASSO"=>"git ssh rsync" From 722a133b314807bd08b9a0d59c0614f6b0599d7f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 12:12:28 +0100 Subject: [PATCH 15/19] FIX Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5 Conflicts: ChangeLog Conflicts: ChangeLog --- ChangeLog | 38 ++++++++++++++++++++++++++++++++++++-- build/makepack-dolibarr.pl | 22 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a59cf9b7006..bd64723725a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,43 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + ***** ChangeLog for 3.6.5 compared to 3.6.4 ***** -- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address -- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page +FIX: #2957 : missing $langs object for trigger +FIX: #2983 Load gravatar avatar images securely over HTTPS +FIX: #3009: Better filtering to prevent SQL injection +FIX: #3841 creation of a task completed has not status set to finished by default +FIX: #3890 Expected transactions bank account page, shows negative numbers +FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card +FIX: bad calculation for stock value +FIX: bad stock valo +FIX: bad stock valorisation +FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask +FIX: button create payment hide if tax amount is less than 1 +FIX: change object statut on close shipping and remove erratic db commit +FIX: change order date on clone (as everywhere else) +FIX: Close #2835 Customer prices of a product shows incorrect history order +FIX: Close #2837 Product list table column header does not match column body +FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0 +FIX: Close bug #2891 Category hooks do not work +FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI +FIX: contact country had wrong display if the country dont have translate +FIX: double db escape add too quote +FIX: End log must use same level then start log. +FIX: error in SQL due to a previous fix +FIX: event for restricted user was restricted if company null +FIX: facturestat bad sql when customer view is limited +FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values) +FIX: keep filter by category or by not enough stock if we switch page +FIX: no need to remove file into mail form, the temp dir will be deleted after any sending +FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE +FIX: pmp +FIX: send mail, copy sendto don't read the list of contact +FIX: The hours of date filter aren't correct +FIX: tool export handle the type "select" extrafields and return the value instead of id +FIX: top links menu have target attribute with wrong value +FIX: total amount in tpl linked object are not reset +FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask) ***** ChangeLog for 3.6.4 compared to 3.6.3 ***** - Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c2359241ad0..603fd0f2e7a 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -345,6 +345,28 @@ if ($nboftargetok) { print "Go to directory $SOURCE\n"; $olddir=getcwd(); chdir("$SOURCE"); + + # Test that the ChangeLog is ok + $ret=`grep "ChangeLog for $MAJOR.$MINOR\.$BUILD" "$SOURCE/ChangeLog" 2>&1`; + if (! $ret) + { + print "Error: The ChangeLogFile was not updated. Run the following command first:\n"; + if (! $BUILD) + { + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + } + else + { + print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa'; + } + print "\n"; + exit; + } + else + { + print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n"; + } + print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; if ($ret =~ /already exists/) From 350345eccaa70ac932f7ddaa94e6f217f01bef6e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Nov 2015 15:18:26 +0100 Subject: [PATCH 16/19] Prepare 3.6.5 --- build/debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/debian/changelog b/build/debian/changelog index 17fdd65230e..5d34808d3a6 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,4 +1,4 @@ -dolibarr (3.6.4-3) UNRELEASED; urgency=low +dolibarr (3.6.5-3) UNRELEASED; urgency=low [ Laurent Destailleur (eldy) ] * New upstream release. From 52bd90f950c8b684a9af8d66325edbd39bb2773a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 12 Nov 2015 14:12:56 +0100 Subject: [PATCH 17/19] Fix: wrong var name --- htdocs/fichinter/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 56287721180..033db575c4d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -119,7 +119,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; @@ -145,7 +145,7 @@ else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->fich $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs); + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->modelpdf:GETPOST('model','alpha'), $outputlangs); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; From b3be7f65cd1edd8fd99c652fa8bc53125f9c42d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Nov 2015 11:12:49 +0100 Subject: [PATCH 18/19] Fix syntax error . = instead of .= --- htdocs/accountancy/customer/list.php | 4 ++-- htdocs/accountancy/supplier/list.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index dcf46fe4a44..e36f2e480ea 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -130,8 +130,8 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " WHERE f.fk_statut > 0"; -$sql. = " AND fk_code_ventilation <= 0"; -$sql. = " AND product_type <= 2"; +$sql .= " AND fk_code_ventilation <= 0"; +$sql .= " AND product_type <= 2"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')"; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 0ed1e1d6aa2..4a592c1a3ca 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -133,7 +133,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountan $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version"; $sql .= " WHERE f.fk_statut > 0"; $sql .= " AND fk_code_ventilation <= 0"; -$sql. = " AND product_type <= 2"; +$sql .= " AND product_type <= 2"; $sql .= " AND (accsys.rowid='".$conf->global->CHARTOFACCOUNTS."' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')"; if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity = '" . $conf->entity . "'"; From bad28c6d921949da1ff7772a076d56999942e419 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 13 Nov 2015 11:44:55 +0100 Subject: [PATCH 19/19] Fi sntax error --- htdocs/commande/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 5514e34c7e6..113a976a997 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1264,7 +1264,8 @@ if ($action == 'create' && $user->rights->commande->creer) { } if (!$dateorder) { // Do not set 0 here (0 for a date is 1970) - $dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder); + $dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder); + } } else { // For compatibility if ($element == 'order' || $element == 'commande') {