From fa635a7ef0ac85701ed7e52f14934b99e4c3adad Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 4 Sep 2021 15:51:31 +1000 Subject: [PATCH] minor fixes --- app/Mail/TemplateEmail.php | 2 -- app/Services/Invoice/AutoBillInvoice.php | 4 ++++ app/Services/Payment/DeletePayment.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index f42ae0e413e6..bbfabebc09d0 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -84,8 +84,6 @@ class TemplateEmail extends Mailable else $email_from_name = $this->company->present()->name(); -nlog($email_from_name); - $this->from(config('mail.from.address'), $email_from_name); if (strlen($settings->bcc_email) > 1) diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 7b0a2f83c865..a64b568a988e 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -89,6 +89,8 @@ class AutoBillInvoice extends AbstractService return $this->invoice; } + nlog("Gateway present - adding gateway fee"); + /* $gateway fee */ $this->invoice = $this->invoice->service()->addGatewayFee($gateway_token->gateway, $gateway_token->gateway_type_id, $amount)->save(); @@ -105,6 +107,8 @@ class AutoBillInvoice extends AbstractService 'fee_invoice_id' => $this->invoice->id, ]); + nlog("Payment hash created => {$payment_hash->id}"); + $payment = $gateway_token->gateway ->driver($this->client) ->setPaymentHash($payment_hash) diff --git a/app/Services/Payment/DeletePayment.php b/app/Services/Payment/DeletePayment.php index 19f121ccd582..b4171cc0a03e 100644 --- a/app/Services/Payment/DeletePayment.php +++ b/app/Services/Payment/DeletePayment.php @@ -82,6 +82,8 @@ class DeletePayment $net_deletable = $paymentable_invoice->pivot->amount - $paymentable_invoice->pivot->refunded; + nlog("net deletable amount - refunded = {$net_deletable}"); + $paymentable_invoice->service() ->updateBalance($net_deletable) ->updatePaidToDate($net_deletable * -1) @@ -103,8 +105,6 @@ class DeletePayment $paymentable_invoice->service()->setStatus(Invoice::STATUS_PARTIAL)->save(); } - //fire event for this credit - // }); }