mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-23 01:03:23 -05:00
Fixes a minor bug introduced on first transaction for benefit transactions.
This commit is contained in:
parent
daf885cc4a
commit
63cecfc678
@ -767,18 +767,22 @@ $(function() {
|
|||||||
|
|
||||||
// show original price for transaction using volunteer / membership benefits
|
// show original price for transaction using volunteer / membership benefits
|
||||||
$.post("json/transaction.php", { transaction_benefits: 1 }, function (data) {
|
$.post("json/transaction.php", { transaction_benefits: 1 }, function (data) {
|
||||||
var obj = $.parseJSON(data);
|
|
||||||
|
|
||||||
|
var obj = $.parseJSON(data);
|
||||||
|
|
||||||
// Volunteer benefits
|
// Volunteer benefits
|
||||||
if ( obj.transactions_with_volunteer_benefits[$("#trans_type_info").text()] === true ) {
|
if ( obj.transactions_with_volunteer_benefits[$("#trans_type_info").text()] === true ) {
|
||||||
$.post("json/transaction.php",{ history_select: 1, transaction_id: transaction_id }, function(data) {
|
$.post("json/transaction.php",{ history_select: 1, transaction_id: transaction_id }, function(data) {
|
||||||
var obj = $.parseJSON(data);
|
if (data !== "First Transaction") {
|
||||||
var history = obj[obj.length - 1];
|
var obj = $.parseJSON(data);
|
||||||
$("#original_price").text(history.original_price).show();
|
var history = obj[obj.length - 1];
|
||||||
$("#volunteer_hours").text(history.redeemed_hours).show();
|
$("#original_price").text(history.original_price).show();
|
||||||
|
$("#volunteer_hours").text(history.redeemed_hours).show();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}); // show original price
|
}); // show original price
|
||||||
|
|
||||||
// Things to do before pressing the save / close button
|
// Things to do before pressing the save / close button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user