Payment notifications for online payments to the client

This commit is contained in:
David Bomba 2021-01-18 08:31:49 +11:00
parent 2e49776d75
commit a33c781919
3 changed files with 5 additions and 8 deletions

View File

@ -228,6 +228,9 @@ class BaseDriver extends AbstractPaymentDriver
$payment->service()->updateInvoicePayment($this->payment_hash); $payment->service()->updateInvoicePayment($this->payment_hash);
if ($this->client->getSetting('client_online_payment_notification'))
$payment->service()->sendEmail();
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars())); event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
return $payment->service()->applyNumber()->save(); return $payment->service()->applyNumber()->save();

View File

@ -375,11 +375,6 @@ class InvoiceService
if (!isset($this->invoice->terms)) { if (!isset($this->invoice->terms)) {
$this->invoice->terms = $settings->invoice_terms; $this->invoice->terms = $settings->invoice_terms;
} }
if(!isset($this->invoice->public_notes)) {
$this->invoice->public_notes = $settings->public_notes;
}
return $this; return $this;
} }

View File

@ -74,9 +74,8 @@ class MarkPaid extends AbstractService
->applyNumber() ->applyNumber()
->save(); ->save();
if ($this->invoice->client->getSetting('client_manual_payment_notification')) { if ($this->invoice->client->getSetting('client_manual_payment_notification'))
EmailPayment::dispatch($payment, $payment->company, $payment->client->primary_contact()->first()); $payment->service()->sendEmail();
}
/* Update Invoice balance */ /* Update Invoice balance */
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars())); event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));