1
0
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:
David Bomba 2021-03-30 09:30:41 +11:00
parent f1ece9ab6b
commit 878f00b375
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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)) {

View File

@ -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')