mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Improve PDF creation performance
This commit is contained in:
parent
853ca8fa94
commit
b9c9874533
@ -376,6 +376,8 @@ class CreditController extends BaseController
|
|||||||
|
|
||||||
$credit = $this->credit_repository->save($request->all(), $credit);
|
$credit = $this->credit_repository->save($request->all(), $credit);
|
||||||
|
|
||||||
|
$credit->service()->deletePdf();
|
||||||
|
|
||||||
event(new CreditWasUpdated($credit, $credit->company, Ninja::eventVars()));
|
event(new CreditWasUpdated($credit, $credit->company, Ninja::eventVars()));
|
||||||
|
|
||||||
return $this->itemResponse($credit);
|
return $this->itemResponse($credit);
|
||||||
|
@ -387,6 +387,8 @@ class QuoteController extends BaseController
|
|||||||
|
|
||||||
$quote = $this->quote_repo->save($request->all(), $quote);
|
$quote = $this->quote_repo->save($request->all(), $quote);
|
||||||
|
|
||||||
|
$quote->service()->deletePdf();
|
||||||
|
|
||||||
event(new QuoteWasUpdated($quote, $quote->company, Ninja::eventVars()));
|
event(new QuoteWasUpdated($quote, $quote->company, Ninja::eventVars()));
|
||||||
|
|
||||||
return $this->itemResponse($quote);
|
return $this->itemResponse($quote);
|
||||||
|
@ -374,6 +374,8 @@ class RecurringInvoiceController extends BaseController
|
|||||||
|
|
||||||
$recurring_invoice = $this->recurring_invoice_repo->save($request->all(), $recurring_invoice);
|
$recurring_invoice = $this->recurring_invoice_repo->save($request->all(), $recurring_invoice);
|
||||||
|
|
||||||
|
$recurring_invoice->service()->deletePdf()->save();
|
||||||
|
|
||||||
return $this->itemResponse($recurring_invoice);
|
return $this->itemResponse($recurring_invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,6 +88,8 @@ class CreditService
|
|||||||
{
|
{
|
||||||
$this->credit = (new ApplyPayment($this->credit, $invoice, $amount, $payment))->run();
|
$this->credit = (new ApplyPayment($this->credit, $invoice, $amount, $payment))->run();
|
||||||
|
|
||||||
|
$this->deletePdf();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class MarkSent
|
|||||||
->setStatus(Credit::STATUS_SENT)
|
->setStatus(Credit::STATUS_SENT)
|
||||||
->applyNumber()
|
->applyNumber()
|
||||||
->adjustBalance($this->credit->amount)
|
->adjustBalance($this->credit->amount)
|
||||||
|
->deletePdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ class MarkSent
|
|||||||
->service()
|
->service()
|
||||||
->setStatus(Quote::STATUS_SENT)
|
->setStatus(Quote::STATUS_SENT)
|
||||||
->applyNumber()
|
->applyNumber()
|
||||||
|
->deletePdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
return $this->quote;
|
return $this->quote;
|
||||||
|
@ -39,21 +39,6 @@ class QuoteService
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function markApproved()
|
|
||||||
// {
|
|
||||||
// $mark_approved = new MarkApproved($this->quote->client);
|
|
||||||
// $this->quote = $mark_approved->run($this->quote);
|
|
||||||
|
|
||||||
// if ($this->quote->client->getSetting('auto_convert_quote') == true) {
|
|
||||||
// $this->convert();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $this->markSent()
|
|
||||||
// ->createInvitations();
|
|
||||||
|
|
||||||
// return $this;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function convert() :self
|
public function convert() :self
|
||||||
{
|
{
|
||||||
if ($this->quote->invoice_id) {
|
if ($this->quote->invoice_id) {
|
||||||
@ -127,6 +112,7 @@ class QuoteService
|
|||||||
->service()
|
->service()
|
||||||
->markSent()
|
->markSent()
|
||||||
->createInvitations()
|
->createInvitations()
|
||||||
|
->deletePdf()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user