Fix for tests

This commit is contained in:
Hillel Coren 2018-01-18 16:03:41 +02:00
parent 1de93e0f03
commit 8a8483bcbd

View File

@ -215,21 +215,21 @@
}); });
function onFormSubmit(event) { function onFormSubmit(event) {
@if ($payment)
return true;
@else
// warn if amount is more than balance/credit will be created // warn if amount is more than balance/credit will be created
var invoiceId = $('input[name=invoice]').val(); var invoiceId = $('input[name=invoice]').val();
var invoice = invoiceMap[invoiceId]; var invoice = invoiceMap[invoiceId];
var amount = $('#amount').val(); var amount = $('#amount').val();
if (! invoice) {
logError('Warning: invoice not found: ' + invoiceId);
}
if (amount <= invoice.balance || confirm("{{ trans('texts.amount_greater_than_balance') }}")) { if (amount <= invoice.balance || confirm("{{ trans('texts.amount_greater_than_balance') }}")) {
$('#saveButton').attr('disabled', true); $('#saveButton').attr('disabled', true);
return true; return true;
} else { } else {
return false; return false;
} }
@endif
} }
function submitAction(action) { function submitAction(action) {