From e1df4658834173dff91bc6880a81ca51ea9f7abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 6 Jan 2021 14:22:48 +0100 Subject: [PATCH] Show the message if invoice is unpayable --- app/Http/Controllers/ClientPortal/InvoiceController.php | 7 +++++-- resources/lang/en/texts.php | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 885be6971daf..22d27fa675f7 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -77,7 +77,9 @@ class InvoiceController extends Controller return $this->downloadInvoicePDF((array) $transformed_ids); } - return redirect()->back(); + return redirect() + ->back() + ->with('message', ctrans('texts.no_action_provided')); } private function makePayment(array $ids) @@ -93,7 +95,8 @@ class InvoiceController extends Controller }); if ($invoices->count() == 0) { - return back()->with(['warning' => 'No payable invoices selected']); + return back() + ->with('message', ctrans('texts.no_payable_invoices_selected')); } $invoices->map(function ($invoice) { diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index aeaf5a0a8e03..871f57b567b2 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -3363,4 +3363,7 @@ return [ 'endless' => 'Endless', 'minimum_payment' => 'Minimum Payment', + + 'no_action_provided' => 'No action provided. If you believe this is wrong, please contact the support.', + 'no_payable_invoices_selected' => 'No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.', ];