From a210790a57eda8f5a07df748bb24df9f381e6aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 29 Sep 2020 14:16:01 +0200 Subject: [PATCH] Fix overpayments --- app/Http/Controllers/ClientPortal/PaymentController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientPortal/PaymentController.php b/app/Http/Controllers/ClientPortal/PaymentController.php index 658ad9ff562f..7016ce746e03 100644 --- a/app/Http/Controllers/ClientPortal/PaymentController.php +++ b/app/Http/Controllers/ClientPortal/PaymentController.php @@ -111,7 +111,7 @@ class PaymentController extends Controller $invoice_amount = Number::roundValue($invoice->amount, auth()->user()->client->currency()->precision); if ($settings->client_portal_allow_under_payment == false && $settings->client_portal_allow_over_payment == false) { - $payable_invoice['amount'] = $invoice->amount; + $payable_invoice['amount'] = Number::roundValue(($invoice->partial > 0 ? $invoice->partial : $invoice->balance), auth()->user()->client->currency()->precision); } // We don't allow either of these, reset the amount to default invoice (to prevent inspect element payments). if ($settings->client_portal_allow_under_payment) {