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

This doesn't allow a value > current_year_volunteer_values on input.

This commit is contained in:
Jonathan Rosenbaum 2017-08-01 05:57:34 +00:00
parent 38286d280a
commit 35c3a69f73

View File

@ -768,7 +768,8 @@ $(function() {
max: obj.current_year_volunteer_hours,
min: 0,
spin: function( event, ui ) {
console.log(ui.value);
//console.log(ui.value);
var volunteer_hours_redeemed = 0;
var bikes_earned = 0;
@ -815,14 +816,19 @@ $(function() {
//var price = amount.val();
if ($(this).data('onInputPrevented')) return;
// test if value is greater than current_year_volunteer_hours
console.log($(this).spinner("value"));
var spinner_value;
if ($(this).spinner("value") > obj.current_year_volunteer_hours) {
spinner_value = obj.current_year_volunteer_hours;
} else {
spinner_value = $(this).spinner("value");
}
console.log("spinner value " + spinner_value);
var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
var redeemable_value;
if ($("#transaction_type").val() !== "Stand Time") {
redeemable_value = obj.volunteer_hour_value * $(this).spinner("value");
redeemable_value = obj.volunteer_hour_value * spinner_value;
} else {
redeemable_value = obj.stand_time_value * $(this).spinner("value");
redeemable_value = obj.stand_time_value * spinner_value;
}
// check box to use 25% or 50% ? Also, check for 50% when no sweat_equity.