mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fix for client numbers
This commit is contained in:
parent
6ff1c79db3
commit
06d5509805
@ -43,14 +43,19 @@ trait GeneratesNumbers
|
||||
|
||||
// update the counter to be caught up
|
||||
if ($counterOffset > 1) {
|
||||
if ($entity->isType(INVOICE_TYPE_QUOTE) && !$this->share_counter) {
|
||||
$this->quote_number_counter += $counterOffset - 1;
|
||||
} else {
|
||||
$this->{$entityType.'_number_counter'} += $counterOffset - 1;
|
||||
}
|
||||
|
||||
if ($entity->isEntityType(ENTITY_CLIENT)) {
|
||||
if ($this->clientNumbersEnabled()) {
|
||||
$this->client_number_counter += $counterOffset - 1;
|
||||
$this->save();
|
||||
}
|
||||
} elseif ($entity->isType(INVOICE_TYPE_QUOTE) && !$this->share_counter) {
|
||||
$this->quote_number_counter += $counterOffset - 1;
|
||||
$this->save();
|
||||
} else {
|
||||
$this->invoice_number_counter += $counterOffset - 1;
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
if ($entity->recurring_invoice_id) {
|
||||
$number = $this->recurring_invoice_number_prefix . $number;
|
||||
|
Loading…
Reference in New Issue
Block a user