Bug 23868: Check if threshold is undefined in javascript block of opac-account.tt
authorAgustin Moyano <agustinmoyano@theke.io>
Mon, 4 Nov 2019 18:09:33 +0000 (15:09 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 7 Nov 2019 09:09:38 +0000 (09:09 +0000)
This patch fixes a bug introduced by checking payment plugins threshold

To test:
1. do not apply this patch
2. configure paypal options in intranet
3. create a manual invoice for a patron
4. in opac try to pay that invoice
CHECK => Make Payment button is disabled, even when invoices where checked.
5. apply this patch
6. repeat step 4
SUCCESS => Make Payment button is enabled when an invoice is checked.
7. Sign off

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt

index 96cbfb3..7375ca0 100644 (file)
@@ -143,7 +143,7 @@ $( document ).ready(function() {
                     return new Promise(function(resolve, reject) {
                         var threshold = $(self).data('threshold');
                         var help = $(self).parent().siblings('.help-block');
-                        if(threshold == '' || threshold <= total) {
+                        if(!threshold || threshold == '' || threshold <= total) {
                             $(self).prop('disabled', false);
                             help.addClass('hide');
                         } else {