From b480f8cd61fea214a604771f8f5c0bc3ce93b57b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 15 Jan 2018 16:47:41 +0630 Subject: [PATCH 1/3] update payment detail show --- app/views/origami/payments/show.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 78660997..97c4d216 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -313,8 +313,8 @@ } payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment") - console.log(payment_type) if ($("#server_mode").val() != "cloud") { // first bill not used in cloud + if (member_id && member_discount) { if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){ $("#credit_payment").hide(); @@ -457,9 +457,9 @@ var credit = $('#credit').text(); var card = $('#card').text(); - if (credit <= 0) { - calculate_member_discount(sale_id); - } + if (credit <= 0) { + calculate_member_discount(sale_id); + } $.ajax({type: "POST", url: "<%= origami_payment_cash_path %>", From fb989572b1c89bad7b3612df17898478af2e6372 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 15 Jan 2018 17:48:35 +0630 Subject: [PATCH 2/3] update room for first bill --- app/controllers/origami/void_controller.rb | 3 ++ app/views/origami/home/show.html.erb | 2 +- app/views/origami/rooms/show.html.erb | 60 +++++++++++++--------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/app/controllers/origami/void_controller.rb b/app/controllers/origami/void_controller.rb index a0c4a23b..0d368224 100755 --- a/app/controllers/origami/void_controller.rb +++ b/app/controllers/origami/void_controller.rb @@ -63,6 +63,7 @@ class Origami::VoidController < BaseOrigamiController member_info = nil rebate_amount = nil + current_balance = nil # For Cashier by Zone bookings = Booking.where("sale_id='#{sale_id}'") @@ -87,7 +88,9 @@ class Origami::VoidController < BaseOrigamiController if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no) + current_balance = SaleAudit.paymal_search(sale_id) end + # get printer info print_settings=PrintSetting.find_by_unique_code(unique_code) # Calculate Food and Beverage Total diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index fc1a5b20..372efa83 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -576,7 +576,7 @@ swal ( "Oops" , "Please select an table!" , "warning" ); } }else{ - swal("Opps","You are not authorized for void","warning") + swal("Opps","You are not authorized for Discount","warning") } return false; }); diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index f8dc69f0..00350f1b 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -367,17 +367,21 @@ - + - - - <% if ENV["SERVER_MODE"] != "cloud" %> - - <% end %> + <% if ENV["SERVER_MODE"] == "cloud" %> + + <% else %> + <%if @membership.discount && @obj_sale.customer.membership_id %> + + <%else%> + + <%end%> + <%end%> <% end %> @@ -393,6 +397,7 @@