feat: update for discount, edit for qrpay
This commit is contained in:
@@ -18,7 +18,7 @@ class Foodcourt::QrpayController < BaseFoodcourtController
|
|||||||
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"
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user