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

Shows original price and redeemed volunteer hours for saved transaction when edit button is pressed.

This commit is contained in:
Jonathan Rosenbaum 2017-08-03 20:03:27 +00:00
parent 7147ea6213
commit daf885cc4a
2 changed files with 16 additions and 1 deletions

View File

@ -137,4 +137,5 @@ input[value=Save]:focus, input[value=Close]:focus {
#original_price {
display: none;
color: blueviolet;
}

View File

@ -765,7 +765,21 @@ $(function() {
$("#paid_label").text("Amount Owed:");
}
// show original amount for transaction using volunteer / membership benefits
// show original price for transaction using volunteer / membership benefits
$.post("json/transaction.php", { transaction_benefits: 1 }, function (data) {
var obj = $.parseJSON(data);
// Volunteer benefits
if ( obj.transactions_with_volunteer_benefits[$("#trans_type_info").text()] === true ) {
$.post("json/transaction.php",{ history_select: 1, transaction_id: transaction_id }, function(data) {
var obj = $.parseJSON(data);
var history = obj[obj.length - 1];
$("#original_price").text(history.original_price).show();
$("#volunteer_hours").text(history.redeemed_hours).show();
});
}); // show original price
// Things to do before pressing the save / close button