From 8a8483bcbd220b8a256f2ca1af6ba1e285ae51c8 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 18 Jan 2018 16:03:41 +0200 Subject: [PATCH] Fix for tests --- resources/views/payments/edit.blade.php | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/views/payments/edit.blade.php b/resources/views/payments/edit.blade.php index 81d1aace03..7760d8ada6 100644 --- a/resources/views/payments/edit.blade.php +++ b/resources/views/payments/edit.blade.php @@ -215,21 +215,21 @@ }); function onFormSubmit(event) { - // warn if amount is more than balance/credit will be created - var invoiceId = $('input[name=invoice]').val(); - var invoice = invoiceMap[invoiceId]; - var amount = $('#amount').val(); - - if (! invoice) { - logError('Warning: invoice not found: ' + invoiceId); - } - - if (amount <= invoice.balance || confirm("{{ trans('texts.amount_greater_than_balance') }}")) { - $('#saveButton').attr('disabled', true); + @if ($payment) return true; - } else { - return false; - } + @else + // warn if amount is more than balance/credit will be created + var invoiceId = $('input[name=invoice]').val(); + var invoice = invoiceMap[invoiceId]; + var amount = $('#amount').val(); + + if (amount <= invoice.balance || confirm("{{ trans('texts.amount_greater_than_balance') }}")) { + $('#saveButton').attr('disabled', true); + return true; + } else { + return false; + } + @endif } function submitAction(action) {