1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Remove invoice deletion observer

This commit is contained in:
David Bomba 2021-02-17 00:31:00 +11:00
parent 4c9f6fcf8f
commit 0b8bf4fbf1
4 changed files with 4 additions and 7 deletions

View File

@ -38,7 +38,7 @@ use Illuminate\Support\Str;
/*Multi Mailer implemented*/
class EmailEntity extends BaseMailerJob implements ShouldQueue
class EmailEntity implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
@ -105,9 +105,6 @@ class EmailEntity extends BaseMailerJob implements ShouldQueue
/* Set DB */
MultiDB::setDB($this->company->db);
/* Set the correct mail driver */
$this->setMailDriver();
$nmo = new NinjaMailerObject;
$nmo->mailable = new TemplateEmail($this->email_entity_builder,$this->invitation->contact);
$nmo->company = $this->company;

View File

@ -52,7 +52,7 @@ class InvoiceObserver
WebhookHandler::dispatch(Webhook::EVENT_UPDATE_INVOICE, $invoice, $invoice->company);
}
UnlinkFile::dispatchNow(config('filesystems.default'), $invoice->client->invoice_filepath() . $invoice->number.'.pdf');
// UnlinkFile::dispatchNow(config('filesystems.default'), $invoice->client->invoice_filepath() . $invoice->number.'.pdf');
}

View File

@ -147,7 +147,7 @@ class ApplyPayment
event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars()));
if ((int)$this->invoice->balance == 0) {
// $this->invoice->service()->deletePdf();
$this->invoice->service()->deletePdf();
event(new InvoiceWasPaid($this->invoice, $payment, $this->payment->company, Ninja::eventVars()));
}
}

View File

@ -266,7 +266,7 @@ class InvoiceService
//$this->invoice = $this->invoice->calc()->getInvoice();
// $this->deletePdf();
$this->deletePdf();
return $this;
}