mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-23 09:13:23 -05:00
Now uses stand_time_value for "Stand Time" transactions.
This commit is contained in:
parent
6a89e5d675
commit
38286d280a
@ -724,7 +724,7 @@ $(function() {
|
|||||||
var obj = $.parseJSON(data);
|
var obj = $.parseJSON(data);
|
||||||
amount.val("");
|
amount.val("");
|
||||||
if(!obj.membership) {
|
if(!obj.membership) {
|
||||||
amount.val(obj.total + ".00");
|
amount.val(obj.total + ".00"); // should improve this for amount values with digits
|
||||||
price = obj.total;
|
price = obj.total;
|
||||||
}
|
}
|
||||||
$("#stand_time_total").text(obj.hours + " hours " + obj.minutes + " minutes");
|
$("#stand_time_total").text(obj.hours + " hours " + obj.minutes + " minutes");
|
||||||
@ -759,8 +759,7 @@ $(function() {
|
|||||||
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();
|
||||||
var redeemable_value = obj.current_year_volunteer_hours * obj.volunteer_hour_value;
|
|
||||||
|
|
||||||
$("#redeemable_hours").spinner({
|
$("#redeemable_hours").spinner({
|
||||||
step: 0.01,
|
step: 0.01,
|
||||||
@ -775,14 +774,19 @@ $(function() {
|
|||||||
var bikes_earned = 0;
|
var bikes_earned = 0;
|
||||||
|
|
||||||
if (obj.volunteer !== "") {
|
if (obj.volunteer !== "") {
|
||||||
// still need to test
|
// still need to test .. this will be made an
|
||||||
var volunteer_benefits = obj.volunteer.split(" ",1);
|
var volunteer_benefits = obj.volunteer.split(" ",1);
|
||||||
volunteer_hours_redeemed = volunteer_benefits[0];
|
volunteer_hours_redeemed = volunteer_benefits[0];
|
||||||
bikes_earned = volunteer_benefits[1];
|
bikes_earned = volunteer_benefits[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
|
var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
|
||||||
var redeemable_value = obj.volunteer_hour_value * ui.value;
|
var redeemable_value;
|
||||||
|
if ($("#transaction_type").val() !== "Stand Time") {
|
||||||
|
redeemable_value = obj.volunteer_hour_value * ui.value;
|
||||||
|
} else {
|
||||||
|
redeemable_value = obj.stand_time_value * ui.value;
|
||||||
|
}
|
||||||
|
|
||||||
// check box to use 25% or 50% ? Also, check for 50% when no sweat_equity.
|
// check box to use 25% or 50% ? Also, check for 50% when no sweat_equity.
|
||||||
|
|
||||||
@ -814,7 +818,12 @@ $(function() {
|
|||||||
console.log($(this).spinner("value"));
|
console.log($(this).spinner("value"));
|
||||||
|
|
||||||
var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
|
var sweat_equity_hours = obj.sweat_equity_limit / (obj.volunteer_hours_redeemed * obj.volunteer_hour_value);
|
||||||
var redeemable_value = obj.volunteer_hour_value * $(this).spinner("value");
|
var redeemable_value;
|
||||||
|
if ($("#transaction_type").val() !== "Stand Time") {
|
||||||
|
redeemable_value = obj.volunteer_hour_value * $(this).spinner("value");
|
||||||
|
} else {
|
||||||
|
redeemable_value = obj.stand_time_value * $(this).spinner("value");
|
||||||
|
}
|
||||||
|
|
||||||
// check box to use 25% or 50% ? Also, check for 50% when no sweat_equity.
|
// check box to use 25% or 50% ? Also, check for 50% when no sweat_equity.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user