Browse Source

Fixes a bug with then newest introduced volunteer benefits math.

devel
Jonathan Rosenbaum 7 years ago
parent
commit
a2ae9907e4
  1. 4
      js/transaction.js

4
js/transaction.js

@ -640,7 +640,7 @@ $(function() {
exceeded_sweat_equity_limit = true;
price_after_redeeming = price - (obj.volunteer_hour_value * ((obj.sweat_equity_limit / obj.volunteer_hour_value) - volunteer[year].volunteer_hours_redeemed));
spinner_difference = (obj.sweat_equity_limit / obj.volunteer_hour_value) - volunteer[year].volunteer_hours_redeemed;
//console.log(spinner_difference);
//console.log(spinner_difference + " " + price_after_redeeming);
}
}
@ -692,7 +692,7 @@ $(function() {
// volunteer hours redeemed if the redeemable_value <= obj.sweat_equity_limit
} else {
if (exceeded_sweat_equity_limit === true) {
if (price_after_redeeming) {
if (price_after_redeeming && price_after_redeeming && spinner_difference > 0) {
amount.val(price_after_redeeming - (((spinner_value - spinner_difference) * obj.volunteer_hour_value) * (discount / 100).toFixed(2)));
} else {
amount.val(price - (redeemable_value * (discount / 100).toFixed(2)));

Loading…
Cancel
Save