From fc69dc2293c7c81e3e9391a5348e86398a2c3a06 Mon Sep 17 00:00:00 2001 From: Dev Team Date: Mon, 14 Jul 2025 14:51:46 +0630 Subject: [PATCH] change tax in qrpay precreate --- app/controllers/foodcourt/qrpay_controller.rb | 12 ++++++++++++ app/views/foodcourt/qrpay/precreate.html.erb | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controllers/foodcourt/qrpay_controller.rb b/app/controllers/foodcourt/qrpay_controller.rb index b85ef339..9bcd4770 100644 --- a/app/controllers/foodcourt/qrpay_controller.rb +++ b/app/controllers/foodcourt/qrpay_controller.rb @@ -35,6 +35,18 @@ class Foodcourt::QrpayController < BaseFoodcourtController @member_discount = MembershipSetting.find_by_discount(1) @membership_rebate_balance=0 + @changable_tax = true + lookup_changable_tax = Lookup.collection_of('changable_tax') + if !lookup_changable_tax.empty? + lookup_changable_tax.each do |changable_tax| + if changable_tax[0].downcase == "change" + if changable_tax[1] == '0' + @changable_tax = false + end + end + end + end + if Sale.exists?(sale_id) begin @cash = 0.0 diff --git a/app/views/foodcourt/qrpay/precreate.html.erb b/app/views/foodcourt/qrpay/precreate.html.erb index 9591dc82..15fd6c8d 100644 --- a/app/views/foodcourt/qrpay/precreate.html.erb +++ b/app/views/foodcourt/qrpay/precreate.html.erb @@ -465,7 +465,7 @@ var paymalcount = <%= @paymalcount %>; var customer_paypar_account = '<%= @sale_data.customer.paypar_account_no %>'; // console.log(pdf_view) $(document).ready(function(){ - + $.post('/foodcourt/customer_view', { data: { items: <%= raw @sale_data.sale_items.to_json %>, @@ -1188,7 +1188,7 @@ $(document).ready(function(){ if(data.status){ // console.log(type); localStorage.setItem("tax_type", type); - window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment'; + window.location.reload(); } } });