diff --git a/README.md b/README.md index a020ba48..15495ce6 100755 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ For Using Star Printer 3) settings/print_settings => SaleItemsStarPdf *** Other print settings aren't need to change. -For Sale Items Summary Include at CloseCashierPrint +For Show Sale Items Summary at CloseCashierPrint 1) settings/print_settings a) Check => Shift Sale Items diff --git a/app/controllers/origami/quick_service_controller.rb b/app/controllers/origami/quick_service_controller.rb index 98e61545..8fb6895c 100644 --- a/app/controllers/origami/quick_service_controller.rb +++ b/app/controllers/origami/quick_service_controller.rb @@ -6,7 +6,7 @@ class Origami::QuickServiceController < ApplicationController redirect_to root_path end end - + def index today = DateTime.now day = Date.today.wday @@ -14,7 +14,7 @@ class Origami::QuickServiceController < ApplicationController @menus = [] @menu = [] # else - # @menus = Menu.all + # @menus = Menu.all # @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc') # end @zone = Zone.all @@ -28,20 +28,22 @@ class Origami::QuickServiceController < ApplicationController else @display_type = nil end - + #checked quick_service only - @quick_service_only = true - lookup_dine_in = Lookup.collection_of('dinein_cashier') + @quick_service_only = false + lookup_dine_in = Lookup.collection_of('quickservice_add_order') + puts 'lookup_dine_in!!!!' + puts lookup_dine_in if !lookup_dine_in.empty? lookup_dine_in.each do |dine_in| - if dine_in[0].downcase == "dineincashier" - if dine_in[1] == '1' - @quick_service_only = false + if dine_in[0].downcase == "quickserviceaddorder" + if dine_in[1] == '1' + @quick_service_only = true end end end end - + render "origami/addorders/detail" end @@ -53,7 +55,7 @@ class Origami::QuickServiceController < ApplicationController @menus = [] @menu = [] # else - # @menus = Menu.all + # @menus = Menu.all # @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc') # end if(params[:id][0,3] == "BKI") @@ -65,7 +67,7 @@ class Origami::QuickServiceController < ApplicationController @table = DiningFacility.find(@table_id) @booking = @table.get_booking end - + @sale_id = params[:sale_id] if @booking @@ -96,7 +98,7 @@ class Origami::QuickServiceController < ApplicationController @cashier_type = "quick_service" items_arr = [] - JSON.parse(params[:order_items]).each { |i| + JSON.parse(params[:order_items]).each { |i| i["item_instance_code"] = i["item_instance_code"].downcase.to_s if i["item_instance_code"].include? "ext" is_extra_time = true @@ -169,7 +171,7 @@ class Origami::QuickServiceController < ApplicationController end @status, @booking = @order.generate - if(params[:sale_id][0,3] == "SAL") + if(params[:sale_id][0,3] == "SAL") if @status && @booking && @order.source == 'quick_service' if params[:sale_id] @sale = Sale.find(params[:sale_id]) @@ -180,17 +182,17 @@ class Origami::QuickServiceController < ApplicationController end update = Sale.add_to_existing_pending_invoice(@table_id,params[:sale_id],@booking) end - + result = {:status=> true, :data => @sale } render :json => result.to_json - end + end elsif (params[:sale_id][0,3] == "BKI") result = {:status=> true, :data => 'OK' } - render :json => result.to_json + render :json => result.to_json else result = {:status=> true, :data => nil } render :json => result.to_json - end + end end @@ -216,9 +218,9 @@ class Origami::QuickServiceController < ApplicationController return @sub_menu end end - + def get_all_product() - @product = Product.all + @product = Product.all end # render json for http status code diff --git a/app/controllers/reports/saleitem_controller.rb b/app/controllers/reports/saleitem_controller.rb index 80d206ce..4943d5c5 100755 --- a/app/controllers/reports/saleitem_controller.rb +++ b/app/controllers/reports/saleitem_controller.rb @@ -124,6 +124,11 @@ class Reports::SaleitemController < BaseReportController print_settings = PrintSetting.find_by_unique_code('SaleItemsPdf') # SaleItemsPdf print_settings_star = PrintSetting.find_by_unique_code('SaleItemsStarPdf') + # if print_settings.nil? && print_settings_star.nil? + # @print_setting = PrintSetting.new(name: "SaleItemsPdf", unique_code: "SaleItemsPdf", template: "",font: "Zawgyi-One", header_font_size: "10", item_font_size: "8", printer_name: "", api_settings: "", brand_name: nil, printer_type: nil, page_width: "210", page_height: "1450", print_copies: "1", precision: "0", delimiter: "0", heading_space: "5" ) + # @print_setting.save + # end + if print_settings.nil? if !print_settings_star.nil? printer = Printer::CashierStationPrinter.new(print_settings_star) diff --git a/app/views/origami/addorders/detail.html.erb b/app/views/origami/addorders/detail.html.erb index 80fba22e..fe860a25 100644 --- a/app/views/origami/addorders/detail.html.erb +++ b/app/views/origami/addorders/detail.html.erb @@ -1,5 +1,5 @@ <%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %> -<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %> +<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %> <% type = request.path_info.include?('quick_service') || request.path_info.include?('food_court')%> @@ -13,7 +13,7 @@
- -
-
Attributes
+
+
Attributes

@@ -471,8 +471,8 @@
- -
+ +
@@ -510,14 +510,14 @@ <% if table.get_booking.nil? %> <% if table.get_checkout_booking.nil? %> <% color="red"%> - <% else %> + <% else %> <% color="orange"%> - <% end %> + <% end %> - <% else %> + <% else %> <% if table.get_checkout_booking.nil? %> <% color="blue"%> - <% else %> + <% else %> <% color="orange"%> <% end %> <% end %> @@ -536,13 +536,13 @@ <% if table.get_booking.nil? %> <% if table.get_checkout_booking.nil? %> <% color="red"%> - <% else %> + <% else %> <% color="orange"%> - <% end %> - <% else %> + <% end %> + <% else %> <% if table.get_checkout_booking.nil? %> <% color="blue"%> - <% else %> + <% else %> <% color="orange"%> <% end %> <% end %> @@ -594,11 +594,11 @@ menu_cache_append(menus); }else{ $("#menu_data").removeClass("hidden"); - } + } function menu_cache_append(menus){ $("#menu_cache").removeClass("hidden"); - $(".menu_cache_name").text(menus[0]["name"]) + $(".menu_cache_name").text(menus[0]["name"]) for(var i in menus) { menu_list_template(menus[i]); } @@ -607,11 +607,11 @@ for(var ii in category) { if (category[ii]["is_available"]== true){ if (category[ii]["valid_time"]== true){ - if (category[ii]["parent_id"] == null ){ + if (category[ii]["parent_id"] == null ){ if(cashier_type){ if (category[ii]["code"].includes("SPL") != true) { category_list_template(category[ii]); - } + } }else{ if ($("#table_get_current").text()) { if (category[ii]["code"].includes("SPL") != true) { @@ -624,7 +624,7 @@ } } } - } + } } $(".tables").on('click', function () { @@ -658,13 +658,13 @@ var name = $(this).attr("data-name"); var menus = JSON.parse(localStorage.getItem("menus")); - if (menus != null) { + if (menus != null) { menu_click_cache_append(name,menus,menu_id); }else{ var url = "get_menu/"+menu_id; - show_menu_cat_list(name, url); + show_menu_cat_list(name, url); } - }); + }); //End menu category Click function menu_click_cache_append(name,menus,menu_id) { @@ -681,22 +681,22 @@ // +''; // $(".category_cache_list").append(row); - for(var i in menus) { + for(var i in menus) { if (menu_id == menus[i]["id"] && menus[i]["is_active"] == true) { // menu_list_template(menus[i]); var category = menus[i]["categories"]; - - for(var ii in category) { - if (category[ii]["is_available"]== true){ + + for(var ii in category) { + if (category[ii]["is_available"]== true){ if (category[ii]["valid_time"]== true){ - if (category[ii]["parent_id"] == null ){ - if(cashier_type){ + if (category[ii]["parent_id"] == null ){ + if(cashier_type){ if (category[ii]["code"].includes("SPL") != true) { category_list_template(category[ii]); - } - }else{ + } + }else{ if ($("#table_get_current").text()) { if (category[ii]["code"].includes("SPL") != true) { category_list_template(category[ii]); @@ -708,7 +708,7 @@ } } } - } + } } } } @@ -725,7 +725,7 @@ +'' +' '; - $(".category_cache_list").append(row); + $(".category_cache_list").append(row); } function menu_list_template(menu) { @@ -734,11 +734,11 @@ +' '+menu.name+'' +''; - $(".menu_cache_list").append(row); - } + $(".menu_cache_list").append(row); + } //show menu item list when click menu category - function show_menu_cat_list(name, url_item){ + function show_menu_cat_list(name, url_item){ var menu_list = $('.menu_items_list'); menu_list.empty(); @@ -758,13 +758,13 @@ url_item = url_item; } //Start Ajax - $.ajax({ - type: "GET", - url: url_item, + $.ajax({ + type: "GET", + url: url_item, data: {}, dataType: "json", success: function(data) { - for(var i in data) { + for(var i in data) { if (data[i].is_available == true) { row = '