From 151cc07560c333e4e6ad863e8bb7f4f3cc6e8028 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Oct 2021 11:41:58 +1100 Subject: [PATCH 1/5] Change protected to public for --- app/PaymentDrivers/BasePaymentDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/PaymentDrivers/BasePaymentDriver.php b/app/PaymentDrivers/BasePaymentDriver.php index 3053a6b9e783..18a6cc1b3c89 100644 --- a/app/PaymentDrivers/BasePaymentDriver.php +++ b/app/PaymentDrivers/BasePaymentDriver.php @@ -56,7 +56,7 @@ class BasePaymentDriver protected $refundable = false; /* Token billing */ - protected $token_billing = false; + public $token_billing = false; /* Authorise payment methods */ protected $can_authorise_credit_card = false; From 5a31634f81bd769f71d2f774781249d3ffbdd1ea Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Oct 2021 20:43:00 +1100 Subject: [PATCH 2/5] Fixes for invoice paid to date calculations on refund --- app/Services/Payment/RefundPayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 0d10b83fa745..6d9f8a76e1eb 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -242,7 +242,8 @@ class RefundPayment $invoice->service()->updateBalance($refunded_invoice['amount'])->save(); $invoice->ledger()->updateInvoiceBalance($refunded_invoice['amount'], "Refund of payment # {$this->payment->number}")->save(); - + $invoice->paid_to_date -= $refunded_invoice['amount']; + if ($invoice->amount == $invoice->balance) { $invoice->service()->setStatus(Invoice::STATUS_SENT); } else { From 129a8a021084852bf849a932ff840162f4d2012e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Oct 2021 21:10:56 +1100 Subject: [PATCH 3/5] Order gateways by is_default --- app/Services/Invoice/AutoBillInvoice.php | 4 ++-- resources/views/errors/guest.blade.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 resources/views/errors/guest.blade.php diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 96e72f487058..f450380f0ab9 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -306,8 +306,8 @@ class AutoBillInvoice extends AbstractService { //get all client gateway tokens and set the is_default one to the first record - //$gateway_tokens = $this->client->gateway_tokens()->orderBy('is_default', 'DESC'); - $gateway_tokens = $this->client->gateway_tokens; + $gateway_tokens = $this->client->gateway_tokens()->orderBy('is_default', 'DESC'); + // $gateway_tokens = $this->client->gateway_tokens; $filtered_gateways = $gateway_tokens->filter(function ($gateway_token) use($amount) { diff --git a/resources/views/errors/guest.blade.php b/resources/views/errors/guest.blade.php new file mode 100644 index 000000000000..9df84c302c60 --- /dev/null +++ b/resources/views/errors/guest.blade.php @@ -0,0 +1,5 @@ +@extends('portal.ninja2020.layout.error') + +@section('title', __('Server Error')) +@section('code', '500') +@section('message', __($message) ?: 'System Error') From 03bb31a9e3a3cda0800ccd18e7de3747d35fe918 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Oct 2021 21:12:20 +1100 Subject: [PATCH 4/5] clean up --- app/Services/Invoice/AutoBillInvoice.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index f450380f0ab9..f4d6d4cfa7d9 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -291,16 +291,6 @@ class AutoBillInvoice extends AbstractService * @param float $amount The amount to charge * @return ClientGatewayToken The client gateway token */ - // private function - // { - // $gateway_tokens = $this->client->gateway_tokens()->orderBy('is_default', 'DESC')->get(); - - // foreach ($gateway_tokens as $gateway_token) { - // if ($this->validGatewayLimits($gateway_token, $amount)) { - // return $gateway_token; - // } - // } - // } public function getGateway($amount) { From 915b033f1dff254125e2020f817305451fd7e566 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 4 Oct 2021 21:12:50 +1100 Subject: [PATCH 5/5] v5.3.19 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 9c7d58fcd98c..719920388ff8 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.3.18 \ No newline at end of file +5.3.19 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 753291465970..07c28d3eadd1 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.3.18', - 'app_tag' => '5.3.18', + 'app_version' => '5.3.19', + 'app_tag' => '5.3.19', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),