NEW rise code tries in digeteria customer and supplier accountant code
This commit is contained in:
parent
46f41681ff
commit
ab89fe73c2
@ -207,7 +207,7 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
|
|||||||
if (!isset($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE) || !empty($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE)) {
|
if (!isset($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE) || !empty($conf->global->COMPANY_DIGITARIA_UNIQUE_CODE)) {
|
||||||
$disponibility = $this->checkIfAccountancyCodeIsAlreadyUsed($db, $this->code, $type);
|
$disponibility = $this->checkIfAccountancyCodeIsAlreadyUsed($db, $this->code, $type);
|
||||||
|
|
||||||
while ($disponibility <> 0 && $i < 100) {
|
while ($disponibility <> 0 && $i < 1000) {
|
||||||
$widthsupplier = $this->supplieraccountancycodecharacternumber;
|
$widthsupplier = $this->supplieraccountancycodecharacternumber;
|
||||||
$widthcustomer = $this->customeraccountancycodecharacternumber;
|
$widthcustomer = $this->customeraccountancycodecharacternumber;
|
||||||
|
|
||||||
@ -217,6 +217,9 @@ class mod_codecompta_digitaria extends ModeleAccountancyCode
|
|||||||
if ($i >= 10 && $i <= 99) {
|
if ($i >= 10 && $i <= 99) {
|
||||||
$a = 2;
|
$a = 2;
|
||||||
}
|
}
|
||||||
|
if ($i >= 100 && $i <= 999) {
|
||||||
|
$a = 3;
|
||||||
|
}
|
||||||
|
|
||||||
if ($type == 'supplier') {
|
if ($type == 'supplier') {
|
||||||
$this->code = $prefix.strtoupper(substr($codetouse, 0, $widthsupplier - $a)).$i;
|
$this->code = $prefix.strtoupper(substr($codetouse, 0, $widthsupplier - $a)).$i;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user