Fixes for stale invoice cleanup

This commit is contained in:
David Bomba 2024-06-11 09:44:31 +10:00
parent 78d465daea
commit 1e7b8e9111

View File

@ -48,6 +48,7 @@ class CleanStaleInvoiceOrder implements ShouldQueue
if (! config('ninja.db.multi_db_enabled')) { if (! config('ninja.db.multi_db_enabled')) {
Invoice::query() Invoice::query()
->withTrashed() ->withTrashed()
->where('status_id', Invoice::STATUS_SENT)
->where('is_proforma', 1) ->where('is_proforma', 1)
->where('created_at', '<', now()->subHour()) ->where('created_at', '<', now()->subHour())
->cursor() ->cursor()