mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 14:44:32 -04:00
Fixes for queries
This commit is contained in:
parent
0077df1be7
commit
685b7e25c2
@ -14,6 +14,7 @@ namespace App\Jobs\Cron;
|
||||
use App\Jobs\RecurringInvoice\SendRecurring;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\RecurringInvoice;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Carbon;
|
||||
@ -46,6 +47,9 @@ class RecurringInvoicesCron
|
||||
|
||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->whereHas('company', function(Builder $query){
|
||||
$query->where('is_disabled', false);
|
||||
})
|
||||
->cursor();
|
||||
|
||||
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count());
|
||||
@ -66,6 +70,9 @@ class RecurringInvoicesCron
|
||||
|
||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '=', now())
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->whereHas('company', function(Builder $query){
|
||||
$query->where('is_disabled', false);
|
||||
})
|
||||
->cursor();
|
||||
|
||||
Log::info(now()->format('Y-m-d') . ' Sending Recurring Invoices. Count = '.$recurring_invoices->count().' On Database # '.$db);
|
||||
|
@ -107,6 +107,7 @@ class Company extends BaseModel
|
||||
'enable_shop_api',
|
||||
'invoice_task_timelog',
|
||||
'auto_start_tasks',
|
||||
'is_disabled',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
|
@ -148,6 +148,7 @@ class CompanyTransformer extends EntityTransformer
|
||||
'enabled_item_tax_rates' => (int) $company->enabled_item_tax_rates,
|
||||
'client_can_register' => (bool) $company->client_can_register,
|
||||
'is_large' => (bool) $company->is_large,
|
||||
'is_disabled' => (bool) $company->is_disabled,
|
||||
'enable_shop_api' => (bool) $company->enable_shop_api,
|
||||
'mark_expenses_invoiceable'=> (bool) $company->mark_expenses_invoiceable,
|
||||
'mark_expenses_paid' => (bool) $company->mark_expenses_paid,
|
||||
|
Loading…
x
Reference in New Issue
Block a user