1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-23 09:13:23 -05:00

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

This commit is contained in:
Jonathan Rosenbaum 2017-08-02 21:15:11 +00:00
parent bd00d498f1
commit 23d8bcf60e

View File

@ -650,7 +650,12 @@ $(function() {
// if running volunteer_hours >= special_volunteer_hours_qualification the special_discount kicks in // if running volunteer_hours >= special_volunteer_hours_qualification the special_discount kicks in
// other wise it is 25% // 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 // discount is now applied
if (sweat_equity_limit > obj.sweat_equity_limit) { 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 // bug final value is fine , but 12 is being deducted or added per hour
// are maxable redeemable hours less than price // 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; var max_discount_price_difference;
if (price > max_discount_price) { if (price > max_discount_price) {
@ -853,7 +863,7 @@ $(function() {
if (obj) { if (obj) {
var volunteer_hours = obj.volunteer_hours; 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"); $("#volunteer_hours").prop("title",title).html("Volunteer Hours");
$(".ui-spinner").show(); $(".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 }); // volunteers post