diff --git a/ChangeLog b/ChangeLog index 3e61b274398..6485000c375 100644 --- a/ChangeLog +++ b/ChangeLog @@ -189,6 +189,8 @@ Dolibarr better: ***** ChangeLog for 3.6.3 compared to 3.6.2 ***** - 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: withdrawal create error if in the same month are deleted previus withdrawals. ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index d88bc8da8ac..457209c5e76 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 * @@ -895,10 +895,11 @@ class BonPrelevement extends CommonObject { $ref = "T".substr($year,-2).$month; - $sql = "SELECT count(*)"; + $sql = "SELECT CAST(RIGHT(ref,2) AS SIGNED INTEGER)"; $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", LOG_DEBUG); $resql = $this->db->query($sql);