diff --git a/ChangeLog b/ChangeLog index ebdd392622d..1cf62269654 100644 --- a/ChangeLog +++ b/ChangeLog @@ -351,25 +351,94 @@ Dolibarr better: to make difference between creation from contact or not. - Function get_exdir require now 6 parameters. This is to prepare a future feature. + ***** 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 @@ -590,9 +659,43 @@ Dolibarr better: warehouse module and your Point Of Sale module setup if you use one. - Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it. + ***** 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/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 03f6b817101..f0c91693a70 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -1,4 +1,4 @@ - * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2015 Alexandre Spangaro @@ -19,7 +19,7 @@ /** * \file htdocs/accountancy/customer/card.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Card customer ventilation */ @@ -88,7 +88,6 @@ if (! empty($id)) { $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; - if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")"; } diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 31df2c38899..c03afd3bcde 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -21,7 +21,7 @@ /** * \file htdocs/accountancy/customer/list.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Ventilation page from customers invoices */ require '../../main.inc.php'; @@ -165,16 +165,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) { * Customer Invoice lines */ -$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,"; -$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, p.tva_tx as tva_tx_prod"; -$sql .= " , aa.rowid as aarowid"; -$sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line"; +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { + $limit = $conf->liste_limit; +} else { + $limit = $conf->liste_limit; +} + +$offset = $limit * $page; + +$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,"; +$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, p.tva_tx as tva_tx_prod,"; +$sql .= " aa.rowid as aarowid"; $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f"; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture"; $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 ='')"; // Add search filter like diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 36c8cd09d65..9070bf72e6f 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -23,7 +23,7 @@ */ /** * \file htdocs/accountancy/supplier/card.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Card supplier ventilation */ @@ -88,7 +88,6 @@ if (! empty($id)) { $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; - if (! empty($conf->multicompany->enabled)) { $sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")"; } diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index b6e06209da1..e261dfff350 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -21,7 +21,7 @@ /** * \file htdocs/accountancy/supplier/list.php - * \ingroup Accounting Expert + * \ingroup Accountancy * \brief Ventilation page from suppliers invoices */ require '../../main.inc.php'; @@ -171,19 +171,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) { * */ -$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.tva_tx as tva_tx_line, "; +if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) { + $limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION; +} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) { + $limit = $conf->liste_limit; +} else { + $limit = $conf->liste_limit; +} + +$offset = $limit * $page; + +$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, "; $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, p.tva_tx as tva_tx_prod"; $sql .= " , aa.rowid as aarowid"; -$sql .= " , f.datef"; -$sql .= " , l.product_type as type_l"; $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 .= " AND product_type <= 2"; $sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')"; - // Add search filter like if (strlen(trim($search_invoice))) { $sql .= " AND (f.ref like '%" . $search_invoice . "%')"; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8748b283abe..8f3e09d0505 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1239,8 +1239,10 @@ if ($action == 'create' && $user->rights->commande->creer) if ($socid > 0) $res = $soc->fetch($socid); - if (! empty($origin) && ! empty($originid)) - { + $projectid = 0; + $remise_absolue = 0; + + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { @@ -1250,6 +1252,20 @@ if ($action == 'create' && $user->rights->commande->creer) if ($element == 'project') { $projectid = $originid; + + 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 (!$dateorder) { + // Do not set 0 here (0 for a date is 1970) + $dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder); + } } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1510,9 +1526,23 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; print ''; - $newclassname = $classname; - if ($newclassname == 'Propal') - $newclassname = 'CommercialProposal'; + switch ($classname) { + case 'Propal': + $newclassname = 'CommercialProposal'; + break; + case 'Commande': + $newclassname = 'Order'; + break; + case 'Expedition': + $newclassname = 'Sending'; + break; + case 'Contrat': + $newclassname = 'Contract'; + break; + default: + $newclassname = $classname; + } + print '' . $langs->trans($newclassname) . '' . $objectsrc->getNomUrl(1) . ''; print '' . $langs->trans('TotalHT') . '' . price($objectsrc->total_ht) . ''; print '' . $langs->trans('TotalVAT') . '' . price($objectsrc->total_tva) . ""; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6b499f98da6..3afe428b9f8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1188,7 +1188,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, fk_unit=$fk_unit", 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, fk_unit=$fk_unit", LOG_DEBUG); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index 38f6b94952e..cbdb769789f 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -2,6 +2,7 @@ /* Copyright (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 ""; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index fb6548c3e87..518c31e38e0 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1841,6 +1841,8 @@ if ($action == 'create') $res = $soc->fetch($socid); // Load objectsrc + $remise_absolue = 0; + if (! empty($origin) && ! empty($originid)) { // Parse element/subelement (ex: project_task) @@ -1852,6 +1854,20 @@ if ($action == 'create') if ($element == 'project') { $projectid = $originid; + + 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); + } } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1896,7 +1912,6 @@ if ($action == 'create') $objectsrc->fetch_optionals($originid); $object->array_options = $objectsrc->array_options; } - $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : ''; // Dot not set 0 here (0 for a date is 1970) } else { @@ -1907,6 +1922,7 @@ if ($action == 'create') $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) } + $absolute_discount = $soc->getAvailableDiscounts(); if (! empty($conf->use_javascript_ajax)) diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 308bcac6dc9..47622a47d0e 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 diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 505e8b8e665..73de2784427 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-2015 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 @@ -1113,6 +1114,9 @@ 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); diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 84b869cd813..08dc77c94b4 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 @@ -49,7 +50,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','askpricesupplier','ficheinter','contract','project','project_task','expensereport'))) { - $savingdocmask=$object->ref.'-__file__'; + $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; } /*if (in_array($modulepart,array('member'))) { 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; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 2693847ee40..b685a2c8ec4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -34,7 +34,7 @@ if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propa if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; - + /** * Class to manage shipments */ diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3cb613934b9..bd0387d392f 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -113,6 +113,7 @@ if (empty($reshook)) if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->ficheinter->creer) { $result = $object->setValid($user); + if ($result >= 0) { // Define output language