mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Only send one payment email receipt
This commit is contained in:
parent
57cbbd0a42
commit
e302b9f9cb
@ -60,7 +60,6 @@ class EmailPayment implements ShouldQueue
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
|
@ -26,7 +26,7 @@ class UnlinkFile implements ShouldQueue
|
||||
|
||||
protected $disk;
|
||||
|
||||
public function __construct(string $disk, string $file_path)
|
||||
public function __construct(string $disk, ?string $file_path)
|
||||
{
|
||||
$this->file_path = $file_path;
|
||||
$this->disk = $disk;
|
||||
@ -40,7 +40,7 @@ class UnlinkFile implements ShouldQueue
|
||||
public function handle()
|
||||
{
|
||||
/* Do not delete files if we are on the sync queue*/
|
||||
if (config('queue.default') == 'sync') {
|
||||
if (config('queue.default') == 'sync' || ! $this->file_path) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ class ApplyPaymentAmount extends AbstractService
|
||||
$exchange_rate = new CurrencyApi();
|
||||
|
||||
$payment->exchange_rate = $exchange_rate->exchangeRate($client_currency, $company_currency, Carbon::parse($payment->date));
|
||||
//$payment->exchange_currency_id = $client_currency; // 23/06/2021
|
||||
|
||||
$payment->exchange_currency_id = $company_currency;
|
||||
|
||||
$payment->saveQuietly();
|
||||
|
@ -103,7 +103,6 @@ class InvoiceService
|
||||
* @param Payment $payment The Payment
|
||||
* @param float $payment_amount The Payment amount
|
||||
* @return InvoiceService Parent class object
|
||||
* @deprecated 24-11-2022 - cannot find any references to this method anywhere
|
||||
*/
|
||||
public function applyPayment(Payment $payment, float $payment_amount)
|
||||
{
|
||||
|
@ -36,12 +36,12 @@ class SendEmail
|
||||
|
||||
$contact = $this->payment->client->contacts()->first();
|
||||
|
||||
$this->payment->invoices->sortByDesc('id')->first(function ($invoice) {
|
||||
$invoice->invitations->each(function ($invitation) {
|
||||
if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
||||
EmailPayment::dispatch($this->payment, $this->payment->company, $invitation->contact);
|
||||
}
|
||||
});
|
||||
});
|
||||
// $this->payment->invoices->sortByDesc('id')->first(function ($invoice) {
|
||||
// $invoice->invitations->each(function ($invitation) {
|
||||
// if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
||||
EmailPayment::dispatch($this->payment, $this->payment->company, $contact);
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
@ -22,9 +22,7 @@ trait Uploadable
|
||||
{
|
||||
public function removeLogo($company)
|
||||
{
|
||||
//if (Storage::disk(config('filesystems.default'))->exists($company->settings->company_logo)) {
|
||||
(new UnlinkFile(config('filesystems.default'), $company->settings->company_logo))->handle();
|
||||
//}
|
||||
(new UnlinkFile(config('filesystems.default'), $company?->settings?->company_logo))->handle();
|
||||
}
|
||||
|
||||
public function uploadLogo($file, $company, $entity)
|
||||
|
Loading…
x
Reference in New Issue
Block a user