Browse Source

Fixes #57, happy New Years!

devel
Jonathan Rosenbaum 7 years ago
parent
commit
8ffb51e20a
  1. 8
      js/transaction.js

8
js/transaction.js

@ -688,6 +688,9 @@ $(function() {
// figure out remaining hours that can be redeemed if some, but not all, volunteer hours have been redeemed.
var remaining, year = d.getFullYear(), exceeded_sweat_equity_limit = false, price_after_redeeming, spinner_difference;
if (volunteer) {
// will need to figure out these values when there isn't a property for the new year
if (volunteer.hasOwnProperty(year)) {
var vhr = obj.volunteer_hour_value * volunteer[year].volunteer_hours_redeemed + (spinner_value * obj.volunteer_hour_value);
//console.log(obj.volunteer_hour_value + " * " + volunteer[year].volunteer_hours_redeemed + " = " + vhr );
remaining = obj.current_year_volunteer_hours - volunteer[year].volunteer_hours_redeemed;
@ -699,7 +702,7 @@ $(function() {
//console.log(spinner_difference + " " + price_after_redeeming);
}
}
}
// no volunteer_hours_redeemed or still less than the allowable sweat_equity_hours
@ -755,6 +758,7 @@ $(function() {
}
//console.log(price_after_redeeming + " - " + redeemable_value + " * ." + discount);
} else {
// Never redeemed before
amount.val(price - redeemable_value);
}
}
@ -1179,7 +1183,7 @@ $(function() {
if ((volunteer_hours && volunteer_hours.length)) {
var max;
if ((remaining || remaining === 0) && obj.volunteer) {
if ((remaining || remaining === 0) && (obj.volunteer && volunteer.hasOwnProperty(year))) {
max = remaining;
} else {
max = obj.current_year_volunteer_hours;

Loading…
Cancel
Save