From aec212d127c896eaa2bf2cae9a16eba4c84b8780 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 18 Jun 2018 10:39:52 +0630 Subject: [PATCH] update lookup display type --- app/controllers/origami/dashboard_controller.rb | 2 ++ app/views/origami/dashboard/index.html.erb | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/origami/dashboard_controller.rb b/app/controllers/origami/dashboard_controller.rb index 4b530322..ffbf7848 100644 --- a/app/controllers/origami/dashboard_controller.rb +++ b/app/controllers/origami/dashboard_controller.rb @@ -23,6 +23,8 @@ class Origami::DashboardController < BaseOrigamiController # @total_card = Sale.total_card_sale(today,current_user) # @total_credit = Sale.credit_payment(today,current_user) + @display_type = Lookup.find_by_lookup_type("display_type") + @sale_data = Array.new @total_payment_methods = Sale.total_payment_methods(today,current_user) if !@total_payment_methods.nil? diff --git a/app/views/origami/dashboard/index.html.erb b/app/views/origami/dashboard/index.html.erb index 4b7c6f2c..9eeeb4e3 100644 --- a/app/views/origami/dashboard/index.html.erb +++ b/app/views/origami/dashboard/index.html.erb @@ -219,7 +219,13 @@ $(function() { }); $(".qs_view").on('click', function() { - if ($('#server_mode').val() != "cloud") { + var display_type = '<%= @display_type %>'; + if (display_type.length>0) { + display_type = '<%= @display_type %>'; + }else{ + display_type = null; + } + if ($('#server_mode').val() != "cloud" && display_type == 2) { document.getElementById('second_view').click(); } window.location.href = '/origami/quick_service';