From 2508653fefa7324b310d653dcf34b42915cfc59f Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Wed, 2 Aug 2017 21:27:34 +0000 Subject: [PATCH] Shows amount if expired membership & status is stand time. --- js/transaction.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index 66624d2..146ede4 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -789,6 +789,7 @@ $(function() { sold_to.change(function() { if (this.value !== "no_selection") { + var expiration_date; // Is this a paid member? $.post("json/transaction.php", { membership_benefits: 1, contact_id: this.value }, function (data) { @@ -801,7 +802,7 @@ $(function() { if (typeof obj.expiration_date && obj.expiration_date !== undefined) { var exp = obj.expiration_date; - var expiration_date = new Date(exp.split("-").toString()); + expiration_date = new Date(exp.split("-").toString()); if (d >= expiration_date) { if ($("#expired_membership").length === 1) { $("#expired_membership").prop("title",title).html("Expired Membership"); @@ -830,7 +831,7 @@ $(function() { if (data) { var obj = $.parseJSON(data); amount.val(""); - if(!obj.membership) { + if(!obj.membership || expiration_date) { amount.val(obj.total + ".00"); // should improve this for amount values with digits price = obj.total; }