1
0
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:
Hillel Coren 2017-01-06 12:36:27 +02:00
parent 6ff1c79db3
commit 06d5509805

View File

@ -43,13 +43,18 @@ trait GeneratesNumbers
// update the counter to be caught up
if ($counterOffset > 1) {
if ($entity->isType(INVOICE_TYPE_QUOTE) && !$this->share_counter) {
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->{$entityType.'_number_counter'} += $counterOffset - 1;
$this->invoice_number_counter += $counterOffset - 1;
$this->save();
}
$this->save();
}
if ($entity->recurring_invoice_id) {