diff --git a/ChangeLog b/ChangeLog index d8d87f2a6c8..d3274e1048d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,6 @@ during migration. Upgrading to any other version or any other database system is abolutely required BEFORE trying make a Dolibarr upgrade. - ***** ChangeLog for 3.9.3 compared to 3.9.2 ***** FIX: #4383 $userid not defined FIX: #4448 $filebonprev is not used, $this->filename now @@ -311,7 +310,68 @@ This is list of hooks modified: - Remove deprecated Product::hidden property - + +***** ChangeLog for 3.8.5 compared to 3.8.4 ***** +FIX: #3815 Call to undefined function local_by_date(). +FIX: #4424 Missing email of user popup in supplier orders area +FIX: #4442 Missing translation in Banks menu +FIX: #4448 $filebonprev is not used, $this->filename now +FIX: #4455 +FIX: #4737 Bank transacion type selector translation is cropped +FIX: #4742 Able to delete a supplier invoice with a registered payment +FIX: #4743 UI glitch in project summary page +FIX: #4747 Missing UI background when registering a supplier invoice payment +FIX: #4748 Supplier invoice payment confirmation amount is not translated +FIX: #4749 +FIX: #4756 +FIX: #4766 VAT not shown in supplier invoice popup +FIX: #4809 - Duplicate functions with different content +FIX: #4851 Project selector in supplier invoices shows the project label twice +FIX: #4870 +FIX: #5008 SQL error when editing the reference of a supplier invoice that already exists +FIX: #5048 Product supplier list display only one produc +FIX: #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option +FIX: #5203 +FIX: #5207 +FIX: #5338 use of not initialized var $aphour, $apmin, etc +FIX: #5380 +FIX: #5383 bad object id on don delete +FIX: #5474 Country_id of "Don" object is still empty +FIX: Accountancy - 3.8 - Chart of accounts are limited on only one country +FIX: Bad include and param for project numbering module call +FIX: Box disabled because bugged +FIX: bug on email template +FIX: Can correct stock of lot using eatby or sell by date +FIX: Can make a movement on "out of sell" products +FIX: Can't create thirdparty or validate invoice if profid is mandatory and profid does not exists for other countries +FIX: can't fetch by siret or siren because of first "if" +FIX: Check stock of product by warehouse if $entrepot_id defined on shippings +FIX: correct display of minimum buying price +FIX: Creation of thumb image for size "small" was not done. +FIX: Direction of movement lost if an error occurs +FIX: dont retrieve new buying price on margin display +FIX: Duplicate records into export +FIX: Email templates not compatible with Multicompany +FIX: end of select when no fournprice +FIX: finished parameters not used +FIX: hook on group card called but not initialized +FIX: It doesn't check if there is enough stock to update the lines of orders/invoices +FIX: large expense note +FIX: missing column when module was installed before standard integration +FIX: Missing database escaping on supplier price insert/update +FIX: Not filtering correctly when come from dashboard +FIX: PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH +FIX: real min buying price +FIX: receiving link never works +FIX: same page added several times on mergepropal option +FIX: search on date into supplier invoice list dont work because of status -1 +FIX: Search supplier ref on contract +FIX: SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty +FIX: systematic rounding causes prices to be updated without reason +FIX: task ODT company object not correctly retrieved +FIX: Template email must take care of positino column +FIX: VAT rate can be negative. Example spain selling to morroco. + ***** ChangeLog for 3.8.4 compared to 3.8.3 ***** FIX: #3694 FIX: #3798 #2519 Cron jobs would never be executed diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 131efda6e34..9a569a46f7c 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2016 Ferran Marcet * * 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 @@ -919,7 +919,7 @@ class BonPrelevement extends CommonObject $dir=$conf->prelevement->dir_output.'/receipts'; if (! is_dir($dir)) dol_mkdir($dir); - $this->filename = $dir.'/receipts/'.$ref.'.xml'; + $this->filename = $dir.'/'.$ref.'.xml'; // Create withdraw receipt in database $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons ("; diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index c2316578130..25ae7c52c50 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -141,7 +141,7 @@ if ($prev_id) print price($row[0]); print ''; - print round($row[0]/$bon->amount*100,2)." %"; + if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %"; print ''; print "\n"; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5804ab4cf9f..a38b4cf59d9 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -430,7 +430,7 @@ abstract class CommonDocGenerator 'line_fulldesc'=>doc_getlinedesc($line,$outputlangs), 'line_product_ref'=>$line->product_ref, 'line_product_label'=>$line->product_label, - 'line_product_type'=>$line->product_type, + 'line_product_type'=>$line->product_type, 'line_desc'=>$line->desc, 'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits), 'line_up'=>price2num($line->subprice), @@ -444,9 +444,9 @@ abstract class CommonDocGenerator 'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs), 'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs), 'line_date_start'=>$line->date_start, - 'line_date_start_rfc'=>dol_print_date($line->date_start,'rfc'), + 'line_date_start_rfc'=>dol_print_date($line->date_start,'dayrfc'), 'line_date_end'=>$line->date_end, - 'line_date_end_rfc'=>dol_print_date($line->date_end,'rfc') + 'line_date_end_rfc'=>dol_print_date($line->date_end,'dayrfc') ); // Retrieve extrafields diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index e2de6e61c86..3f3fbb4f409 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -167,7 +167,8 @@ class HookManager 'printObjectLine', 'printObjectSubLine', 'createDictionaryFieldList', - 'editDictionaryFieldlist' + 'editDictionaryFieldlist', + 'getFormMail' ) )) $hooktype='addreplace'; // Deprecated hook types ('returnvalue') diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 4d02acc9925..0baea91412f 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -1012,6 +1012,9 @@ function getParameterByName(name, valueifnotfound) } })(); +// Another solution, easier, to build a javascript rounding function +function dolroundjs(number, decimals) { return +(Math.round(number + "e+" + decimals) + "e-" + decimals); } + /** * Function similar to PHP price2num() @@ -1024,7 +1027,7 @@ function price2numjs(amount) { if (amount == '') return ''; transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") { $dec = $langs->transnoentitiesnoconv("SeparatorDecimal"); @@ -1032,6 +1035,7 @@ function price2numjs(amount) { if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") { $thousand = $langs->transnoentitiesnoconv("SeparatorThousand"); } + if ($thousand == 'Space') $thousand=' '; print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript ?> @@ -1050,11 +1054,15 @@ function price2numjs(amount) { if (nbdec > rounding) rounding = nbdec; // If rounding higher than max shown if (rounding > main_max_dec_shown) rounding = main_max_dec_shown; - if (thousand != ',' && thousand != '.') amount = amount.replace(',', '.'); amount = amount.replace(' ', ''); // To avoid spaces amount = amount.replace(thousand, ''); // Replace of thousand before replace of dec to avoid pb if thousand is . amount = amount.replace(dec, '.'); - - return Math.round10(amount, rounding); + //console.log("amount before="+amount+" rouding="+rounding) + var res = Math.round10(amount, - rounding); + // Other solution is + // var res = dolroundjs(amount, rounding) + console.log("res="+res) + return res; } + diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 974bbac1a3e..ea9ece5229c 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -100,7 +100,8 @@ class pdf_merou extends ModelePdfExpedition $outputlangs->load("propal"); $outputlangs->load("deliveries"); $outputlangs->load("sendings"); - + $outputlangs->load("productbatch"); + if ($conf->expedition->dir_output) { $object->fetch_thirdparty(); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 6cc965c5c4f..db1be5f46e1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -110,7 +110,8 @@ class pdf_rouget extends ModelePdfExpedition $outputlangs->load("propal"); $outputlangs->load("deliveries"); $outputlangs->load("sendings"); - + $outputlangs->load("productbatch"); + $nblignes = count($object->lines); // Loop on each lines to detect if there is at least one image to show diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a2fa413b9e8..ff8a73c527d 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -167,7 +167,7 @@ class pdf_crabe extends ModelePDFFactures function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { global $user,$langs,$conf,$mysoc,$db,$hookmanager; - + if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; @@ -252,7 +252,7 @@ class pdf_crabe extends ModelePDFFactures // Set nblignes with the new facture lines content after hook $nblignes = count($object->lines); - + // Create pdf instance $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance @@ -337,6 +337,11 @@ class pdf_crabe extends ModelePDFFactures $height_incoterms = 0; if ($conf->incoterm->enabled) { + if (is_object($object->thirdparty)) + { + $object->fk_incoterms=$object->thirdparty->fk_incoterms; + $object->location_incoterms=$object->thirdparty->location_incoterms; + } $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { @@ -550,7 +555,7 @@ class pdf_crabe extends ModelePDFFactures } else { $tvaligne = $sign * $object->lines[$i]->total_tva; } - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -1557,7 +1562,7 @@ class pdf_crabe extends ModelePDFFactures $posy=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; - + $hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40; $widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82; diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 5557104c7f6..7eefc6ebd94 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -69,7 +69,7 @@ class modProductBatch extends DolibarrModules $this->config_page_url = array(); // Dependencies - $this->depends = array("modProduct","modStock","modExpedition","modSupplier"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order). + $this->depends = array("modProduct","modStock","modExpedition","modFournisseur"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order). $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->phpmin = array(5,0); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 8a40c85b191..0dd6d1d8a29 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -712,7 +712,7 @@ if (! empty($id) && $action != 'edit') print ''; } - if (($object->statut == 0 || $object->statut == 1) && $remaintopay == 0 && $object->paye == 0) + if (($object->statut == 0 || $object->statut == 1) && $remaintopay == 0 && $object->paid == 0) { print '"; } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 57824abe795..14dd1f0e318 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.3'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.4'); if (! defined('EURO')) define('EURO',chr(128)); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 05d3886ffd0..7c0e278398e 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -296,6 +296,7 @@ if ($resql) print ''; print ''; + print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"fac.ref,fac.rowid","",$param,"",$sortfield,$sortorder); if (empty($conf->global->SUPPLIER_INVOICE_HIDE_REF_SUPPLIER)) print_liste_field_titre($langs->trans("RefSupplier"),$_SERVER["PHP_SELF"],"ref_supplier","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fac.datef,fac.rowid","",$param,'align="center"',$sortfield,$sortorder); diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 5488b4dab1f..8a561c0e53e 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -7,6 +7,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cedric Salvador + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -109,7 +110,7 @@ if ($action == 'setModuleOptions') } } -if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') > 0) +if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') >= 0) { $res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity); } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e9b77836d3c..3282d8a9eba 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1936,11 +1936,10 @@ class Societe extends CommonObject { global $langs; - $contact_emails = $this->contact_property_array('email'); + $contact_emails = $this->contact_property_array('email',1); if ($this->email && $addthirdparty) { if (empty($this->name)) $this->name=$this->nom; - // TODO: Tester si email non deja present dans tableau contact $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; } return $contact_emails; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 7c44d8a9e29..e9b98ad7164 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -5,7 +5,6 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2015 Florian Henry - * Copyright (C) 2016 Juanjo Menent * * 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 @@ -353,17 +352,16 @@ $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as ef on (s.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays) "; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent) "; $sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st"; -if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " , ".MAIN_DB_PREFIX."societe_extrafields as ef "; // We'll need this table joined to the select in order to filter by sale if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_".($type=='f'?"fournisseur":"societe")." as cs"; $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; -if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " AND s.rowid = ef.fk_object"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale