From 420d3848457e07065c1f00cf9276116203403f5e Mon Sep 17 00:00:00 2001 From: Zin Moe Date: Wed, 15 Jan 2020 12:28:25 +0630 Subject: [PATCH 1/3] modify current login employee action --- app/controllers/concerns/login_verification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/login_verification.rb b/app/controllers/concerns/login_verification.rb index 88b31f6d..cb00ea1d 100755 --- a/app/controllers/concerns/login_verification.rb +++ b/app/controllers/concerns/login_verification.rb @@ -17,7 +17,7 @@ module LoginVerification end def current_login_employee - @employee ||= current_user + @emp ||= current_user end def current_user From f6ad1973585196ce275850591f23bc4504b184f7 Mon Sep 17 00:00:00 2001 From: Zin Moe Date: Wed, 15 Jan 2020 14:27:22 +0630 Subject: [PATCH 2/3] add cashier change tax require manager access code --- app/views/origami/home/show.html.erb | 11 +++++++++-- app/views/origami/payments/show.html.erb | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 00631cae..dedfc728 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -379,7 +379,11 @@ No Tax <% end %>
<%if !@webview && @changable_tax %> - + <% if @current_user.role == 'cashier' %> + + <% else %> + + <% end %> <% end %> <%= number_format(@obj_sale.total_tax, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i )%> @@ -1382,7 +1386,7 @@ }); } }); - } + } function check_emp_access_code(access_code,type) { var url = "/origami/check_emp_access_code/" + access_code ; @@ -1405,6 +1409,9 @@ // overall_void(); }else if(type == "waste_and_spoilage"){ + }else if(type == "change_tax"){ + $('#AccessCodeModal').modal('hide'); + $('#change_taxModal').modal('show'); } }else{ swal("Opps",result.message,"warning") diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 42152e20..346db018 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -105,8 +105,12 @@ No Tax <% end %>
<%if @sale_payment.nil? && @changable_tax %> + <% if @current_user.role == 'cashier' %> + + <% else %> <% end %> + <% end %> <%= number_format(@sale_data.total_tax, precision: precision.to_i ) rescue number_format(0, precision: precision.to_i )%> @@ -1472,6 +1476,9 @@ $(document).ready(function(){ $('#AccessCodeModal').modal('hide'); $('#focModal').modal('show'); // overall_foc(); + }else if(type == "change_tax"){ + $('#AccessCodeModal').modal('hide'); + $('#change_taxModal').modal('show'); } }else{ swal("Oops",result.message,"warning"); From d9012840c1470b011ce03c07557de3f7da832020 Mon Sep 17 00:00:00 2001 From: Zin Moe Date: Wed, 15 Jan 2020 16:15:42 +0630 Subject: [PATCH 3/3] clean second display after waste and spoile --- app/views/foodcourt/payments/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/foodcourt/payments/show.html.erb b/app/views/foodcourt/payments/show.html.erb index 691e7ec8..1353a05a 100755 --- a/app/views/foodcourt/payments/show.html.erb +++ b/app/views/foodcourt/payments/show.html.erb @@ -1514,7 +1514,7 @@ $(document).ready(function(){ window.location.href = '/foodcourt'; }else{ window.location.href = '/foodcourt/'+cashier_type; - if(cashier_type=="quick_service"){ + if(cashier_type=="quick_service" || cashier_type == 'food_court'){ customer_display_view(null,"reload"); } }