mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Restrict size and amount of jobs
This commit is contained in:
parent
08dbbade14
commit
95610fd25e
@ -237,7 +237,7 @@ class InvoiceController extends BaseController
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_UPDATED, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_UPDATED, $transaction, $invoice->company->db);
|
||||
|
||||
return $this->itemResponse($invoice);
|
||||
}
|
||||
@ -433,7 +433,7 @@ class InvoiceController extends BaseController
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_UPDATED, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_UPDATED, $transaction, $invoice->company->db);
|
||||
|
||||
return $this->itemResponse($invoice);
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ class ReminderJob implements ShouldQueue
|
||||
'metadata' => ['setLateFee'],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::CLIENT_STATUS, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::CLIENT_STATUS, $transaction, $invoice->company->db);
|
||||
|
||||
return $invoice;
|
||||
}
|
||||
|
@ -38,19 +38,23 @@ class CreateInvoicePdf implements ShouldQueue
|
||||
|
||||
if (isset($event->invoice)) {
|
||||
$event->invoice->invitations->each(function ($invitation) {
|
||||
CreateEntityPdf::dispatch($invitation->load('invoice', 'contact.client.company'));
|
||||
// CreateEntityPdf::dispatch($invitation->load('invoice', 'contact.client.company'));
|
||||
(new CreateEntityPdf($invitation->load('invoice', 'contact.client.company')))->handle();
|
||||
});
|
||||
}
|
||||
|
||||
if (isset($event->quote)) {
|
||||
$event->quote->invitations->each(function ($invitation) {
|
||||
CreateEntityPdf::dispatch($invitation->load('quote', 'contact.client.company'));
|
||||
// CreateEntityPdf::dispatch($invitation->load('quote', 'contact.client.company'));
|
||||
(new CreateEntityPdf($invitation->load('invoice', 'contact.client.company')))->handle();
|
||||
});
|
||||
}
|
||||
|
||||
if (isset($event->credit)) {
|
||||
$event->credit->invitations->each(function ($invitation) {
|
||||
CreateEntityPdf::dispatch($invitation->load('credit', 'contact.client.company'));
|
||||
// CreateEntityPdf::dispatch($invitation->load('credit', 'contact.client.company'));
|
||||
(new CreateEntityPdf($invitation->load('invoice', 'contact.client.company')))->handle();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ class BaseDriver extends AbstractPaymentDriver
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_FEE_APPLIED, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_FEE_APPLIED, $transaction, $invoice->company->db);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ class PaymentRepository extends BaseRepository {
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
|
||||
|
||||
return $payment->refresh();
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class ApplyPayment extends AbstractService
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_PAYMENT_APPLIED, $transaction, $this->invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_PAYMENT_APPLIED, $transaction, $this->invoice->company->db);
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class HandleCancellation extends AbstractService
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_CANCELLED, $transaction, $this->invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_CANCELLED, $transaction, $this->invoice->company->db);
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ class HandleReversal extends AbstractService
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_REVERSED, $transaction, $this->invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_REVERSED, $transaction, $this->invoice->company->db);
|
||||
|
||||
return $this->invoice;
|
||||
//create a ledger row for this with the resulting Credit ( also include an explanation in the notes section )
|
||||
|
@ -56,7 +56,7 @@ class MarkInvoiceDeleted extends AbstractService
|
||||
'metadata' => ['total_payments' => $this->total_payments, 'balance_adjustment' => $this->balance_adjustment, 'adjustment_amount' => $this->adjustment_amount],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_DELETED, $transaction, $this->invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_DELETED, $transaction, $this->invoice->company->db);
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class MarkPaid extends AbstractService
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::INVOICE_MARK_PAID, $transaction, $this->invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::INVOICE_MARK_PAID, $transaction, $this->invoice->company->db);
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ class DeletePayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_DELETED, $transaction, $paymentable_invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_DELETED, $transaction, $paymentable_invoice->company->db);
|
||||
});
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ class DeletePayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::CLIENT_STATUS, $transaction, $this->payment->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::CLIENT_STATUS, $transaction, $this->payment->company->db);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ class RefundPayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $this->payment->company->db);
|
||||
|
||||
$notes = ctrans('texts.refunded') . " : {$this->total_refund} - " . ctrans('texts.gateway_refund') . " : ";
|
||||
$notes .= $this->refund_data['gateway_refund'] !== false ? ctrans('texts.yes') : ctrans('texts.no');
|
||||
@ -296,7 +296,7 @@ class RefundPayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $invoice->company->db);
|
||||
|
||||
if ($invoice->is_deleted) {
|
||||
$invoice->delete();
|
||||
@ -319,7 +319,7 @@ class RefundPayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
|
||||
} else {
|
||||
//if we are refunding and no payments have been tagged, then we need to decrement the client->paid_to_date by the total refund amount.
|
||||
|
||||
@ -339,7 +339,7 @@ class RefundPayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::PAYMENT_REFUND, $transaction, $client->company->db);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -119,7 +119,7 @@ class UpdateInvoicePayment
|
||||
'metadata' => [],
|
||||
];
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $invoice->company->db);
|
||||
// TransactionLog::dispatch(TransactionEvent::GATEWAY_PAYMENT_MADE, $transaction, $invoice->company->db);
|
||||
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user