mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for recurring invoices
This commit is contained in:
parent
e7a9576fd4
commit
f2f52e05c7
@ -107,7 +107,7 @@ class RecurringInvoicesCron
|
||||
SendRecurring::dispatchNow($recurring_invoice, $recurring_invoice->company->db);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
nlog("Unable to sending recurring invoice {$recurring_invoice->id}");
|
||||
nlog("Unable to sending recurring invoice {$recurring_invoice->id} ". $e->getMessage());
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -73,13 +73,14 @@ class SendRecurring implements ShouldQueue
|
||||
$invoice->date = now()->format('Y-m-d');
|
||||
$invoice->due_date = $this->recurring_invoice->calculateDueDate(now()->format('Y-m-d'));
|
||||
$invoice->recurring_id = $this->recurring_invoice->id;
|
||||
$invoice->saveQuietly();
|
||||
|
||||
if($invoice->client->getSetting('auto_email_invoice'))
|
||||
{
|
||||
$invoice = $invoice->service()
|
||||
->markSent()
|
||||
->applyNumber()
|
||||
->createInvitations() //need to only link invitations to those in the recurring invoice
|
||||
//->createInvitations() //need to only link invitations to those in the recurring invoice
|
||||
->fillDefaults()
|
||||
->save();
|
||||
|
||||
|
@ -33,7 +33,7 @@ class MarkSent extends AbstractService
|
||||
{
|
||||
|
||||
/* Return immediately if status is not draft */
|
||||
if ($this->invoice->fresh()->status_id != Invoice::STATUS_DRAFT) {
|
||||
if ($this->invoice && $this->invoice->fresh()->status_id != Invoice::STATUS_DRAFT) {
|
||||
return $this->invoice;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user