feat: update for discount, edit for qrpay

This commit is contained in:
Dev Team
2025-06-27 18:22:40 +06:30
committed by DevTeam
parent 8101916fcc
commit 8b62d410b0
3 changed files with 17 additions and 6 deletions

View File

@@ -17,10 +17,10 @@ class Foodcourt::QrpayController < BaseFoodcourtController
path = request.fullpath path = request.fullpath
sale_id = params[:sale_id] sale_id = params[:sale_id]
@trans_flag = true @trans_flag = true
@cashier_type = params[:cashier_type] || session[:cashier_type] || "cashier" @cashier_type = params[:cashier_type] || session[:cashier_type] || "food_court_qr"
Rails.logger.info "Precreate action called with params: #{@cashier_type}" Rails.logger.info "Precreate action called with params: #{@cashier_type}"
# if params[:type] == "transaction" # if params[:type] == "transaction"
# @trans_flag = false # @trans_flag = false
# @cashier_type = "cashier" # @cashier_type = "cashier"

View File

@@ -499,7 +499,10 @@
}, function () { }, function () {
if (cashier_type=="quick_service" || cashier_type=="food_court") { if (cashier_type=="quick_service" || cashier_type=="food_court") {
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/'; window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{ }else if(cashier_type == "food_court_qr") {
window.location.href = '/foodcourt/'+sale_id+'/qrpay/precreate';
}
else{
if(result.table_type == "Table"){ if(result.table_type == "Table"){
window.location.href = "/foodcourt/table/" + result.table_id window.location.href = "/foodcourt/table/" + result.table_id
} }

View File

@@ -372,7 +372,11 @@ var access_code = localStorage.getItem("access_code");
var sale_id = "<%= @saleobj.sale_id %>" var sale_id = "<%= @saleobj.sale_id %>"
if (cashier_type=="quick_service" || cashier_type == "food_court") { if (cashier_type=="quick_service" || cashier_type == "food_court") {
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/'; window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{ }
else if(cashier_type=="food_court_qr"){
window.location.href = '/foodcourt/'+sale_id+'/'+ 'qrpay' +'/precreate';
}
else{
window.location.href = '/foodcourt/table/' + table_id; window.location.href = '/foodcourt/table/' + table_id;
} }
}) })
@@ -401,7 +405,11 @@ var access_code = localStorage.getItem("access_code");
success: function (result) { success: function (result) {
if (cashier_type=="quick_service" || cashier_type=="food_court") { if (cashier_type=="quick_service" || cashier_type=="food_court") {
window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/'; window.location.href = '/foodcourt/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{ }
else if(cashier_type=="food_court_qr"){
window.location.href = '/foodcourt/'+sale_id+'/'+ 'qrpay' +'/precreate';
}
else{
window.location.href = '/foodcourt/table/' + table_id; window.location.href = '/foodcourt/table/' + table_id;
} }