mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
add additional query filter for recurring invoices
This commit is contained in:
parent
f1ece9ab6b
commit
878f00b375
@ -392,7 +392,7 @@ class InvoiceController extends BaseController
|
||||
}
|
||||
|
||||
if ($invoice->isLocked()) {
|
||||
return response()->json(['message' => ctrans('texts.locked_invoice')]);
|
||||
return response()->json(['message' => ctrans('texts.locked_invoice')], 403);
|
||||
}
|
||||
|
||||
$invoice = $this->invoice_repo->save($request->all(), $invoice);
|
||||
|
@ -45,8 +45,6 @@ class ActionInvoiceRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
$this->invoice = Invoice::find($this->decodePrimary($invoice_id));
|
||||
|
||||
if (!array_key_exists('action', $input)) {
|
||||
$this->error_msg = 'Action is a required field';
|
||||
} elseif (!$this->invoiceDeletable($this->invoice)) {
|
||||
|
@ -42,6 +42,7 @@ class RecurringInvoicesCron
|
||||
|
||||
if (! config('ninja.db.multi_db_enabled')) {
|
||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now())
|
||||
->whereNotNull('next_send_date')
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->where('remaining_cycles', '!=', '0')
|
||||
->with('company')
|
||||
@ -62,6 +63,7 @@ class RecurringInvoicesCron
|
||||
MultiDB::setDB($db);
|
||||
|
||||
$recurring_invoices = RecurringInvoice::whereDate('next_send_date', '<=', now())
|
||||
->whereNotNull('next_send_date')
|
||||
->where('status_id', RecurringInvoice::STATUS_ACTIVE)
|
||||
->where('remaining_cycles', '!=', '0')
|
||||
->with('company')
|
||||
|
Loading…
Reference in New Issue
Block a user