Browse Source

This fixes a bug introduced by the 34650c9be fix.

* There is an issue if the spinner is used, when the transaction is complete, the function is called infinitely.
devel
Jonathan Rosenbaum 7 years ago
parent
commit
e99d2863b8
  1. 6
      js/transaction.js

6
js/transaction.js

@ -608,7 +608,7 @@ $(function() {
} // end function save_or_close
// invoke when volunteer hours run out for a member with a qualifying transaction
function volunteer_hours_to_membership_discount(price) {
function volunteer_hours_to_membership_discount(price, membership_obj) {
var discount = (price * (membership_obj.membership_discount / 100).toFixed(2)).toFixed(2);
var discount_price = (price - discount).toFixed(2);
@ -1155,7 +1155,7 @@ $(function() {
if (remaining === ui.value && remaining !== 0 && ui.value !== 0) {
if ( typeof amount.val() !== 'undefined') {
var price = amount.cleanVal();
volunteer_hours_to_membership_discount(price);
volunteer_hours_to_membership_discount(price, membership_obj);
}
}
}
@ -1201,7 +1201,7 @@ $(function() {
if (remaining === Number(val) && remaining !== 0 && Number(val) !== 0) {
if ( typeof amount.val() !== 'undefined') {
var price = amount.cleanVal();
volunteer_hours_to_membership_discount(price);
volunteer_hours_to_membership_discount(price, membership_obj);
}
}
}

Loading…
Cancel
Save