diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 6fa61bc7..199325e9 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -45,8 +45,8 @@ class Origami::PaymentsController < BaseOrigamiController rebate = MembershipSetting.find_by_rebate(1) if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) - # current_balance = SaleAudit.paymal_search(sale_id) - current_balance = 0 + current_balance = SaleAudit.paymal_search(sale_id) + # current_balance = 0 end # get printer info print_settings=PrintSetting.find_by_unique_code(unique_code) diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 0b70e159..cc7c564f 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -476,12 +476,15 @@ receipt_no = ($("#receipt_no").html()).trim(); } - // console.log(checkReceiptNoInFirstBillData(receipt_no)); + discount="<%= @membership.discount%>" + membership_id="<%= @obj_sale.customer.membership_id%>" if ($("#server_mode").val() != "cloud") { // first bill not used in cloud - if(checkReceiptNoInFirstBillData(receipt_no,"")){ - $("#pay").show(); - }else{ - $("#pay").hide(); + if (discount && membership_id) { + if(checkReceiptNoInFirstBillData(receipt_no,"")){ + $("#pay").show(); + }else{ + $("#pay").hide(); + } } } /* end check first bill or not*/