diff --git a/ChangeLog b/ChangeLog index fd82ace0c20..832ba002dce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ English Dolibarr ChangeLog - Fix: ref_ext was not saved when recording a customer order from web service - Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid. - Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php +- Fix: withdrawal create error if in the same month are deleted previus withdrawals. +- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules +- Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database +- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. @@ -164,6 +168,7 @@ Fix: Paypal link were broken dur to SSL v3 closed. Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H Fix: [ bug #1757 ] Sorting breaks product/service statistics +Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 3a83d9c3dba..7f0b693391e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2014 Juanjo Menent + * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2014 Ferran Marcet * @@ -890,30 +890,31 @@ class BonPrelevement extends CommonObject */ if (!$error) { - $ref = "T".substr($year,-2).$month; + $ref = substr($year,-2).$month; + + $sql = "SELECT substring(ref from char_length(ref) - 1)"; + $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; + $sql.= " WHERE ref LIKE '%".$ref."%'"; + $sql.= " AND entity = ".$conf->entity; + $sql.= " ORDER BY ref DESC LIMIT 1"; + + dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); + $resql = $this->db->query($sql); - $sql = "SELECT count(*)"; - $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; - $sql.= " WHERE ref LIKE '".$ref."%'"; - $sql.= " AND entity = ".$conf->entity; + if ($resql) + { + $row = $this->db->fetch_row($resql); + } + else + { + $error++; + dol_syslog("Erreur recherche reference"); + } - dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); - $resql = $this->db->query($sql); - - if ($resql) - { - $row = $this->db->fetch_row($resql); - } - else - { - $error++; - dol_syslog("Erreur recherche reference"); - } - - $ref = $ref . substr("00".($row[0]+1), -2); - - $filebonprev = $ref; + $ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1),2,"0",STR_PAD_LEFT); + $filebonprev = $ref; + // Create withdraw receipt in database $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons ("; $sql.= " ref, entity, datec"; diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php index eca0da0f9a5..15bef66bf8f 100644 --- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php +++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php @@ -125,7 +125,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices return 0; } - $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->datef); + //Supplier invoices take invoice date instead of creation date for the mask + $numFinal=get_next_value($db,$mask,'facture_fourn','ref','',$objsoc->code_fournisseur,$object->date); return $numFinal; } diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 0a68ca211b9..79306fb1d65 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -354,7 +354,7 @@ if (($action=="create") || ($action=="edit")) print $langs->trans('CronEvery').""; print "