FIX Numbering of sepa files
This commit is contained in:
parent
fb1c770568
commit
8de9d63f7d
@ -920,7 +920,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
$sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX"
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
|
||||
$sql .= " WHERE ref LIKE '%".$this->db->escape($ref)."%'";
|
||||
$sql .= " WHERE ref LIKE '_".$this->db->escape($ref)."%'";
|
||||
$sql .= " AND entity = ".((int) $conf->entity);
|
||||
$sql .= " ORDER BY ref DESC LIMIT 1";
|
||||
|
||||
@ -931,7 +931,7 @@ class BonPrelevement extends CommonObject
|
||||
$row = $this->db->fetch_row($resql);
|
||||
|
||||
// Build the new ref
|
||||
$ref = "T".$ref.str_pad(dol_substr("00".(intval($row[0]) + 1), 0, 2), 2, "0", STR_PAD_LEFT);
|
||||
$ref = "T".$ref.sprintf("%02d", (intval($row[0]) + 1));
|
||||
|
||||
// $conf->abc->dir_output may be:
|
||||
// /home/ldestailleur/git/dolibarr_15.0/documents/abc/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user