mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Constrain recurring / reminders if the client is archived / deleted
This commit is contained in:
parent
9b81521fa1
commit
7556b68b1f
@ -48,6 +48,10 @@ class RecurringInvoicesCron
|
|||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||||
->where('remaining_cycles', '!=', '0')
|
->where('remaining_cycles', '!=', '0')
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0)
|
||||||
|
->where('deleted_at', NULL);
|
||||||
|
})
|
||||||
->with('company')
|
->with('company')
|
||||||
->cursor();
|
->cursor();
|
||||||
|
|
||||||
@ -70,6 +74,10 @@ class RecurringInvoicesCron
|
|||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||||
->where('remaining_cycles', '!=', '0')
|
->where('remaining_cycles', '!=', '0')
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0)
|
||||||
|
->where('deleted_at', NULL);
|
||||||
|
})
|
||||||
->with('company')
|
->with('company')
|
||||||
->cursor();
|
->cursor();
|
||||||
|
|
||||||
|
@ -62,6 +62,10 @@ class ReminderJob implements ShouldQueue
|
|||||||
->where('is_deleted', 0)
|
->where('is_deleted', 0)
|
||||||
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
|
->whereHas('client', function ($query) {
|
||||||
|
$query->where('is_deleted',0)
|
||||||
|
->where('deleted_at', NULL);
|
||||||
|
})
|
||||||
->with('invitations')->cursor()->each(function ($invoice) {
|
->with('invitations')->cursor()->each(function ($invoice) {
|
||||||
|
|
||||||
if ($invoice->isPayable()) {
|
if ($invoice->isPayable()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user