diff --git a/app/controllers/foodcourt/qrpay_controller.rb b/app/controllers/foodcourt/qrpay_controller.rb index cc8cf505..b2559194 100644 --- a/app/controllers/foodcourt/qrpay_controller.rb +++ b/app/controllers/foodcourt/qrpay_controller.rb @@ -17,10 +17,10 @@ class Foodcourt::QrpayController < BaseFoodcourtController path = request.fullpath sale_id = params[:sale_id] @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}" - + # if params[:type] == "transaction" # @trans_flag = false # @cashier_type = "cashier" diff --git a/app/views/foodcourt/discounts/index.html.erb b/app/views/foodcourt/discounts/index.html.erb index cee87565..13ad2db5 100755 --- a/app/views/foodcourt/discounts/index.html.erb +++ b/app/views/foodcourt/discounts/index.html.erb @@ -499,7 +499,10 @@ }, function () { if (cashier_type=="quick_service" || cashier_type=="food_court") { 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"){ window.location.href = "/foodcourt/table/" + result.table_id } diff --git a/app/views/foodcourt/sale_edit/edit.html.erb b/app/views/foodcourt/sale_edit/edit.html.erb index 2588e2bb..0242e5dc 100755 --- a/app/views/foodcourt/sale_edit/edit.html.erb +++ b/app/views/foodcourt/sale_edit/edit.html.erb @@ -372,7 +372,11 @@ var access_code = localStorage.getItem("access_code"); var sale_id = "<%= @saleobj.sale_id %>" if (cashier_type=="quick_service" || cashier_type == "food_court") { 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; } }) @@ -401,7 +405,11 @@ var access_code = localStorage.getItem("access_code"); success: function (result) { if (cashier_type=="quick_service" || cashier_type=="food_court") { 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; }