1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #6103 from turbo124/v5-develop

Change query parameter when querying datetimes
This commit is contained in:
David Bomba 2021-06-22 18:47:05 +10:00 committed by GitHub
commit 30a98dc011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class RecurringInvoicesCron
nlog("Sending recurring invoices ".Carbon::now()->format('Y-m-d h:i:s'));
if (! config('ninja.db.multi_db_enabled')) {
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now()->toDateTimeString())
$recurring_invoices = RecurringInvoice::where('next_send_date', '<=', now()->toDateTimeString())
->whereNotNull('next_send_date')
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
->where('remaining_cycles', '!=', '0')
@ -64,7 +64,7 @@ class RecurringInvoicesCron
foreach (MultiDB::$dbs as $db) {
MultiDB::setDB($db);
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now()->toDateTimeString())
$recurring_invoices = RecurringInvoice::where('next_send_date', '<=', now()->toDateTimeString())
->whereNotNull('next_send_date')
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
->where('remaining_cycles', '!=', '0')

View File

@ -55,7 +55,7 @@ class ReminderJob implements ShouldQueue
{
nlog("Sending invoice reminders " . now()->format('Y-m-d h:i:s'));
Invoice::whereDate('next_send_date', '<=', now()->toDateTimeString())
Invoice::where('next_send_date', '<=', now()->toDateTimeString())
->where('is_deleted', 0)
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('balance', '>', 0)