Browse Source

Adds the correct conversion for Stand Time transactions, still limited like normal transactions.

devel
Jonathan Rosenbaum 7 years ago
parent
commit
23d8bcf60e
  1. 22
      js/transaction.js

22
js/transaction.js

@ -650,7 +650,12 @@ $(function() {
// if running volunteer_hours >= special_volunteer_hours_qualification the special_discount kicks in
// other wise it is 25%
var sweat_equity_limit = obj.volunteer_hour_value * spinner_value;
var sweat_equity_limit;
if ($("#transaction_type").val() !== "Stand Time") {
sweat_equity_limit = obj.volunteer_hour_value * spinner_value;
} else {
sweat_equity_limit = obj.stand_time_value * spinner_value;
}
// discount is now applied
if (sweat_equity_limit > obj.sweat_equity_limit) {
@ -659,7 +664,12 @@ $(function() {
// bug final value is fine , but 12 is being deducted or added per hour
// are maxable redeemable hours less than price
var max_discount_price = obj.current_year_volunteer_hours * obj.volunteer_hour_value;
var max_discount_price;
if ($("#transaction_type").val() !== "Stand Time") {
max_discount_price = obj.current_year_volunteer_hours * obj.volunteer_hour_value;
} else {
max_discount_price = obj.stand_time_value * obj.volunteer_hour_value;
}
var max_discount_price_difference;
if (price > max_discount_price) {
@ -853,7 +863,7 @@ $(function() {
if (obj) {
var volunteer_hours = obj.volunteer_hours;
if (volunteer_hours && volunteer_hours.length) {
if ((volunteer_hours && volunteer_hours.length)) {
$("#volunteer_hours").prop("title",title).html("Volunteer Hours");
$(".ui-spinner").show();
@ -909,6 +919,12 @@ $(function() {
}
}
if ($("#stand_time_total").is(":empty")) {
$("#redeemable_hours").spinner("disable");
} else {
$("#redeemable_hours").spinner("enable");
}
}); // volunteers post

Loading…
Cancel
Save