mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 15:14:35 -04:00
Improve delete pdf performance
This commit is contained in:
parent
86d168e3a8
commit
9888d7acb9
@ -396,6 +396,8 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invoice = $this->invoice_repo->save($request->all(), $invoice);
|
$invoice = $this->invoice_repo->save($request->all(), $invoice);
|
||||||
|
|
||||||
|
$invoice->service()->deletePdf();
|
||||||
|
|
||||||
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars()));
|
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars()));
|
||||||
|
|
||||||
@ -697,14 +699,14 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cancel':
|
case 'cancel':
|
||||||
$invoice = $invoice->service()->handleCancellation()->save();
|
$invoice = $invoice->service()->handleCancellation()->deletePdf()->save();
|
||||||
|
|
||||||
if (! $bulk) {
|
if (! $bulk) {
|
||||||
$this->itemResponse($invoice);
|
$this->itemResponse($invoice);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'reverse':
|
case 'reverse':
|
||||||
$invoice = $invoice->service()->handleReversal()->save();
|
$invoice = $invoice->service()->handleReversal()->deletePdf()->save();
|
||||||
|
|
||||||
if (! $bulk) {
|
if (! $bulk) {
|
||||||
$this->itemResponse($invoice);
|
$this->itemResponse($invoice);
|
||||||
@ -720,7 +722,7 @@ class InvoiceController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//touch reminder1,2,3_sent + last_sent here if the email is a reminder.
|
//touch reminder1,2,3_sent + last_sent here if the email is a reminder.
|
||||||
$invoice->service()->touchReminder($this->reminder_template)->save();
|
$invoice->service()->touchReminder($this->reminder_template)->deletePdf()->save();
|
||||||
|
|
||||||
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
|
$invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($invoice) {
|
||||||
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template);
|
EmailEntity::dispatch($invitation, $invoice->company, $this->reminder_template);
|
||||||
|
@ -74,6 +74,7 @@ class MarkPaid extends AbstractService
|
|||||||
->updatePaidToDate($payment->amount)
|
->updatePaidToDate($payment->amount)
|
||||||
->setStatus(Invoice::STATUS_PAID)
|
->setStatus(Invoice::STATUS_PAID)
|
||||||
->applyNumber()
|
->applyNumber()
|
||||||
|
->deletePdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
if ($this->invoice->client->getSetting('client_manual_payment_notification'))
|
if ($this->invoice->client->getSetting('client_manual_payment_notification'))
|
||||||
|
@ -47,6 +47,7 @@ class MarkSent extends AbstractService
|
|||||||
->applyNumber()
|
->applyNumber()
|
||||||
->setDueDate()
|
->setDueDate()
|
||||||
->updateBalance($this->invoice->amount)
|
->updateBalance($this->invoice->amount)
|
||||||
|
->deletePdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
$this->client->service()->updateBalance($this->invoice->balance)->save();
|
$this->client->service()->updateBalance($this->invoice->balance)->save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user