From 8ccf45d06f31e70b45d7eb678683bec91a6cb253 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 19 Feb 2018 18:05:30 +0630 Subject: [PATCH] check some function --- app/controllers/origami/surveys_controller.rb | 4 ++-- app/views/origami/split_bill/index.html.erb | 4 ++-- app/views/origami/surveys/_form.html.erb | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/controllers/origami/surveys_controller.rb b/app/controllers/origami/surveys_controller.rb index 5e33fde9..02ec9795 100644 --- a/app/controllers/origami/surveys_controller.rb +++ b/app/controllers/origami/surveys_controller.rb @@ -93,10 +93,10 @@ class Origami::SurveysController < BaseOrigamiController if @type != "quick_service" dining_facility = DiningFacility.find(params[:dining_id]) cashier_zone = CashierTerminalByZone.find_by_zone_id(dining_facility.zone_id) - cashier_zone = cashier_zone.cashier_terminal_id + cashier_terminal_id = cashier_zone.cashier_terminal_id else shift = ShiftSale.find(sale.shift_sale_id) - cashier_zone = shift.cashier_terminal_id + cashier_terminal_id = shift.cashier_terminal_id end shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(cashier_terminal_id,nil) diff --git a/app/views/origami/split_bill/index.html.erb b/app/views/origami/split_bill/index.html.erb index 31e6a5d0..f246e98c 100755 --- a/app/views/origami/split_bill/index.html.erb +++ b/app/views/origami/split_bill/index.html.erb @@ -517,7 +517,7 @@ // window.location.href = '/origami/room/' + dining_id; // } - window.location.href = '/origami/sale/' + split_sale_id + "/payment"; + window.location.href = '/origami/sale/' + split_sale_id + "/cashier/payment"; } }); } @@ -538,7 +538,7 @@ // }else{ // window.location.href = '/origami/room/' + dining_id; // } - window.location.href = '/origami/sale/' + split_sale_id + "/payment"; + window.location.href = '/origami/sale/' + split_sale_id + "/cashier/payment"; } }); } diff --git a/app/views/origami/surveys/_form.html.erb b/app/views/origami/surveys/_form.html.erb index cccda50a..82b7c12a 100755 --- a/app/views/origami/surveys/_form.html.erb +++ b/app/views/origami/surveys/_form.html.erb @@ -73,13 +73,13 @@ - <%if !@dining_facility.nil?%> - - + <%if !@dining_facility.nil? %> + + <%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %> <%else%> - - + + <%= f.input :dining_name, :as => :hidden, :input_html => { :value => 0 } %> <%end%> @@ -275,17 +275,17 @@ var cashier_type = "<%= @cashier_type %>"; }); // click back button for redirect $('#back').on('click',function(){ - table_type = $('#table_type').val() - table_id = $('#table_id').val() + var table_type = $('#table_type').val(); + var table_id = $('#table_id').val(); if (cashier_type == "quick_service") { window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/'; }else{ if(table_type == "Table"){ - window.location.href = "/origami/table/" + table_id + window.location.href = "/origami/table/" + table_id; } else { - window.location.href = "/origami/room/" + table_id + window.location.href = "/origami/room/" + table_id; } } });