Skip to content

Commit

Permalink
Fix for approved quote invoice number
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Aug 4, 2017
1 parent 99a813b commit 4a9575a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Ninja/Repositories/InvoiceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,6 @@ public function cloneInvoice(Invoice $invoice, $quotePublicId = null)
$invoiceNumber = false;
}
}
$clone->invoice_number = $invoiceNumber ?: $account->getNextNumber($clone);
$clone->invoice_date = date_create()->format('Y-m-d');
$clone->due_date = $account->defaultDueDate($invoice->client);

foreach ([
'client_id',
Expand Down Expand Up @@ -857,6 +854,9 @@ public function cloneInvoice(Invoice $invoice, $quotePublicId = null)
}
}

$clone->invoice_number = $invoiceNumber ?: $account->getNextNumber($clone);
$clone->invoice_date = date_create()->format('Y-m-d');
$clone->due_date = $account->defaultDueDate($invoice->client);
$clone->save();

if ($quotePublicId) {
Expand Down

0 comments on commit 4a9575a

Please sign in to comment.