From c60b6a16f681b3211ceae3c031c1d14e4f9cd53e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 30 Dec 2020 15:16:46 +0000 Subject: [PATCH] Bug 27290: Clean up validation It seems we had the validator instantiated twice and we used a mix of validation of required at form element level and in JS instantiator. This patch moves the rules to consistently apply at the instantiation and removes the duplicate lines. --- .../intranet-tmpl/prog/en/modules/pos/pay.tt | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt index 188702f8f5..6d1207a4c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt @@ -128,7 +128,7 @@
  • - [% PROCESS options_for_registers %] @@ -370,11 +370,16 @@ $('#payForm').submit(); }); - $( "#payForm" ).validate({ + $('#payForm').validate({ rules: { - paid: { required: true }, + paid: { + required: true + }, collected: { required: true + }, + registerid: { + required: true } } }); @@ -401,17 +406,6 @@ } }); - $('#payForm').validate({ - rules: { - collected: { - required: true - }, - registerid: { - required: true - } - } - }); - [% IF payment_id && Koha.Preference('FinePaymentAutoPopup') %] $("#printReceipt").click(function() { var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=[% payment_id | uri %]&collected=[% collected | uri %]&change=[% change | uri %]', '_blank'); -- 2.20.1