Browse Source

Changes the logic so that price is read for stand time transactions.

devel
Jonathan Rosenbaum 8 years ago
parent
commit
0ef4138aa4
  1. 36
      js/transaction.js

36
js/transaction.js

@ -717,9 +717,26 @@ $(function() {
} }
}); // membership post }); // membership post
// Stand Time - if a paid member, nothing is owed
if ( $("#trans_type_info").text() === "Stand Time" ) {
$.post("json/transaction.php", { stand_time: 1, contact_id: this.value, shop_id: shop_id }, function (data) {
if (data) {
var obj = $.parseJSON(data);
amount.val("");
if(!obj.membership) {
amount.val(obj.total + ".00");
price = obj.total;
}
$("#stand_time_total").text(obj.hours + " hours " + obj.minutes + " minutes");
} else {
amount.val(data);
$("#stand_time_total").empty();
$(".ui-spinner").hide();
}
}); // stand time pos
}
// How many hours does this volunteer have? // How many hours does this volunteer have?
$.post("json/transaction.php", { volunteer_benefits: 1, contact_id: this.value }, function (data) { $.post("json/transaction.php", { volunteer_benefits: 1, contact_id: this.value }, function (data) {
var year = d.getFullYear(); var year = d.getFullYear();
@ -844,23 +861,6 @@ $(function() {
}); // volunteers post }); // volunteers post
// Stand Time - if a paid member, nothing is owed
if ( $("#trans_type_info").text() === "Stand Time" ) {
$.post("json/transaction.php", { stand_time: 1, contact_id: this.value, shop_id: shop_id }, function (data) {
if (data) {
var obj = $.parseJSON(data);
amount.val("");
if(!obj.membership) {
amount.val(obj.total + ".00");
}
$("#stand_time_total").text(obj.hours + " hours " + obj.minutes + " minutes");
} else {
amount.val(data);
$("#stand_time_total").empty();
$(".ui-spinner").hide();
}
}); // stand time pos
}
} // if not no_selection } // if not no_selection

Loading…
Cancel
Save