mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 11:31:26 +01:00
FIX numbering method when mask include {cccc}
This commit is contained in:
@@ -4012,7 +4012,7 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($addon)) {
|
if (!empty($addon)) {
|
||||||
dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->name.", type=".$soc->typent_code, LOG_DEBUG);
|
dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
|
||||||
|
|
||||||
$mybool = false;
|
$mybool = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1451,14 +1451,17 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
|
|||||||
// Now we replace the counter
|
// Now we replace the counter
|
||||||
$maskbefore = '{'.$masktri.'}';
|
$maskbefore = '{'.$masktri.'}';
|
||||||
$maskafter = str_pad($counter, dol_strlen($maskcounter), "0", STR_PAD_LEFT);
|
$maskafter = str_pad($counter, dol_strlen($maskcounter), "0", STR_PAD_LEFT);
|
||||||
//print 'x'.$maskbefore.'-'.$maskafter.'y';
|
//print 'x'.$numFinal.' - '.$maskbefore.' - '.$maskafter.'y';exit;
|
||||||
$numFinal = str_replace($maskbefore, $maskafter, $numFinal);
|
$numFinal = str_replace($maskbefore, $maskafter, $numFinal);
|
||||||
|
|
||||||
// Now we replace the refclient
|
// Now we replace the refclient
|
||||||
if ($maskrefclient) {
|
if ($maskrefclient) {
|
||||||
//print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskrefclient_clientcode=".$maskrefclient_clientcode."\n<br>";exit;
|
//print "maskrefclient=".$maskrefclient." maskrefclient_counter=".$maskrefclient_counter." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskrefclient_clientcode=".$maskrefclient_clientcode." maskrefclient_maskcounter=".$maskrefclient_maskcounter."\n<br>";exit;
|
||||||
$maskrefclient_maskbefore = '{'.$maskrefclient.'}';
|
$maskrefclient_maskbefore = '{'.$maskrefclient.'}';
|
||||||
$maskrefclient_maskafter = $maskrefclient_clientcode.str_pad($maskrefclient_counter, dol_strlen($maskrefclient_maskcounter), "0", STR_PAD_LEFT);
|
$maskrefclient_maskafter = $maskrefclient_clientcode;
|
||||||
|
if (dol_strlen($maskrefclient_maskcounter) > 0) {
|
||||||
|
$maskrefclient_maskafter .= str_pad($maskrefclient_counter, dol_strlen($maskrefclient_maskcounter), "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
$numFinal = str_replace($maskrefclient_maskbefore, $maskrefclient_maskafter, $numFinal);
|
$numFinal = str_replace($maskrefclient_maskbefore, $maskrefclient_maskafter, $numFinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user