From e0caca99f2ddced8c651cce69e2abf50b03db1f1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 12 Jan 2018 11:32:06 +0200 Subject: [PATCH] Fix for auth check when approving quote --- resources/views/invoices/view.blade.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/views/invoices/view.blade.php b/resources/views/invoices/view.blade.php index 4736c8f6c4d8..dfc2d2d107e0 100644 --- a/resources/views/invoices/view.blade.php +++ b/resources/views/invoices/view.blade.php @@ -290,6 +290,15 @@ } function onApproveClick() { + @if ($account->requiresAuthorization($invoice)) + window.pendingPaymentFunction = approveQuote; + showAuthorizationModal(); + @else + approveQuote(); + @endif + } + + function approveQuote() { $('#approveButton').prop('disabled', true); location.href = "{{ url('/approve/' . $invitation->invitation_key) }}"; }