mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Fixes for reminders
This commit is contained in:
parent
4ce093ff8b
commit
887bc3d4a6
@ -53,7 +53,11 @@ class ReminderJob implements ShouldQueue
|
||||
|
||||
private function processReminders()
|
||||
{
|
||||
Invoice::whereDate('next_send_date', '<=', now())->with('invitations')->cursor()->each(function ($invoice) {
|
||||
Invoice::whereDate('next_send_date', '<=', now())
|
||||
->where('is_deleted', 0)
|
||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||
->where('balance', '>', 0)
|
||||
->with('invitations')->cursor()->each(function ($invoice) {
|
||||
|
||||
if ($invoice->isPayable()) {
|
||||
$reminder_template = $invoice->calculateTemplate('invoice');
|
||||
|
@ -392,7 +392,8 @@ class InvoiceService
|
||||
$this->invoice->reminder_last_sent = now()->format('Y-m-d');
|
||||
break;
|
||||
default:
|
||||
// code...
|
||||
$this->invoice->reminder1_sent = now()->format('Y-m-d');
|
||||
$this->invoice->reminder_last_sent = now()->format('Y-m-d');
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,10 @@ class UpdateReminder extends AbstractService
|
||||
$date_collection->push($reminder_date);
|
||||
}
|
||||
|
||||
if($date_collection->count() >=1)
|
||||
$this->invoice->next_send_date = $date_collection->sort()->first();
|
||||
else
|
||||
$this->invoice->next_send_date = null;
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user