mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
bug fixes
This commit is contained in:
parent
ac917c2b51
commit
bb3a7b9d1c
@ -43,11 +43,11 @@ class SendRecurringInvoices extends Command {
|
|||||||
$invoice->amount = $recurInvoice->amount;
|
$invoice->amount = $recurInvoice->amount;
|
||||||
$invoice->balance = $recurInvoice->amount;
|
$invoice->balance = $recurInvoice->amount;
|
||||||
$invoice->currency_id = $recurInvoice->currency_id;
|
$invoice->currency_id = $recurInvoice->currency_id;
|
||||||
$invoice->invoice_date = date_create();
|
$invoice->invoice_date = date_create()->format('Y-m-d');
|
||||||
|
|
||||||
if ($invoice->client->payment_terms)
|
if ($invoice->client->payment_terms)
|
||||||
{
|
{
|
||||||
$invoice->due_date = date_create()->modify($invoice->client->payment_terms . ' day');
|
$invoice->due_date = date_create()->modify($invoice->client->payment_terms . ' day')->format('Y-m-d');
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoice->save();
|
$invoice->save();
|
||||||
@ -71,7 +71,7 @@ class SendRecurringInvoices extends Command {
|
|||||||
$invoice->invitations()->save($invitation);
|
$invoice->invitations()->save($invitation);
|
||||||
}
|
}
|
||||||
|
|
||||||
$recurInvoice->last_sent_date = new DateTime();
|
$recurInvoice->last_sent_date = Carbon::now()->toDateTimeString();
|
||||||
$recurInvoice->save();
|
$recurInvoice->save();
|
||||||
|
|
||||||
$this->mailer->sendInvoice($invoice);
|
$this->mailer->sendInvoice($invoice);
|
||||||
|
@ -105,13 +105,13 @@ class Account extends Eloquent
|
|||||||
|
|
||||||
public function getNextInvoiceNumber()
|
public function getNextInvoiceNumber()
|
||||||
{
|
{
|
||||||
$orders = Invoice::withTrashed()->scope(false, $this->id)->get();
|
$invoices = Invoice::withTrashed()->scope(false, $this->id)->get();
|
||||||
|
|
||||||
$max = 0;
|
$max = 0;
|
||||||
|
|
||||||
foreach ($orders as $order)
|
foreach ($invoices as $invoice)
|
||||||
{
|
{
|
||||||
$number = intval(preg_replace("/[^0-9]/", "", $order->invoice_number));
|
$number = intval(preg_replace("/[^0-9]/", "", $invoice->invoice_number));
|
||||||
$max = max($max, $number);
|
$max = max($max, $number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user