diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index fe074210..63549c23 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -126,7 +126,7 @@ class Origami::HomeController < BaseOrigamiController lookup_edit_order = Lookup.collection_of('edit_order') if !lookup_edit_order.empty? lookup_edit_order.each do |edit_order| - if edit_order[0].downcase == "editorderorigami" + if edit_order[0].downcase == "editorderorigami" if edit_order[1] == '0' && (current_login_employee.role == 'cashier' || current_login_employee.role == 'waiter') @edit_order_origami = false end @@ -139,14 +139,14 @@ class Origami::HomeController < BaseOrigamiController lookup_changable_tax = Lookup.collection_of('changable_tax') if !lookup_changable_tax.empty? lookup_changable_tax.each do |changable_tax| - if changable_tax[0].downcase == "change" - if changable_tax[1] == '0' + if changable_tax[0].downcase == "change" + if changable_tax[1] == '0' @changable_tax = false end end end end - + end def check_emp_access_code diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index fee19a31..e0d4fc85 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -3,7 +3,7 @@ require 'cups' class Printer::PrinterWorker attr_accessor :print_settings - + def initialize(print_settings) self.print_settings = print_settings end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index e8074fe2..cfa1df70 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -57,14 +57,14 @@
- <% @tables.each do |table| %> + <% @tables.each do |table| %> <% if table.status == 'occupied' %> <% if table.get_booking.nil? %> <% if table.get_checkout_booking.nil? %>
- <% else %> + <% else %>
- <% end %> + <% end %>
<%= table.name %>
<%= table.zone.name %> @@ -72,12 +72,12 @@
- <% else %> + <% else %> <% if table.get_checkout_booking.nil? %>
- <% else %> + <% else %>
- <% end %> + <% end %>
<%= table.name %>
<%= table.zone.name %> @@ -111,7 +111,7 @@ <% end %>
<%= room.name %>
- <%= room.zone.name %> + <%= room.zone.name %> billed
@@ -123,7 +123,7 @@ <% end %>
<%= room.name %>
- <%= room.zone.name %> + <%= room.zone.name %> new
@@ -132,8 +132,8 @@
<%= room.name %>
- <%= room.zone.name %> - + <%= room.zone.name %> +
<% end %> @@ -160,8 +160,8 @@ <% else %> <% order_status = order.status %> <% end %> - <%= order.order_id %> - <% if !order_status.empty? %>| <%= order_status %> + <%= order.order_id %> + <% if !order_status.empty? %>| <%= order_status %> <% end %>
@@ -193,7 +193,7 @@ <%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %> <%= t("views.right_panel.detail.receipt_no") %> <%= t :cashier %> <%= t("views.right_panel.detail.name") %> - <%= t :customer %> <%= t("views.right_panel.detail.name") %> + <%= t :customer %> <%= t("views.right_panel.detail.name") %> <%= t("views.right_panel.detail.credit_amount") %> @@ -245,7 +245,7 @@ <% else %> ORDER DETAILS | Table <%= @dining.name rescue "" %> <% end %> -
+
@@ -335,8 +335,8 @@ <% end %> <% if !order_item.set_menu_items.nil? && order_item.set_menu_items != '[]' - JSON.parse(order_item.set_menu_items).each do |item_instance| - set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %> + JSON.parse(order_item.set_menu_items).each do |item_instance| + set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
<%= item_instance["item_instance_name"] %> @@ -345,17 +345,17 @@
<%= set_item_option %> <% end %> <% end %> -
- <% end + + <% end sub_total += set_item_prices end %> <%= order_item.qty %> <%= (order_item.qty*order_item.price).to_f + set_item_prices %> - + <% end %> <% end %> - <% end %> + <% end %>
@@ -431,10 +431,10 @@ <% end %> <% end %> - <% if !order_item.set_menu_items.nil? - JSON.parse(order_item.set_menu_items).each do |item_instance| + <% if !order_item.set_menu_items.nil? + JSON.parse(order_item.set_menu_items).each do |item_instance| set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f - %> + %>
<%= item_instance["item_instance_name"] %> <% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %> @@ -444,8 +444,8 @@ <% end %> <% end %> - - <% end + + <% end sub_total += set_item_prices end %> @@ -456,7 +456,7 @@ end %> --> - + <% end %> <% if @sale_array.size > 1 %> @@ -496,7 +496,7 @@ - <% if @dining.status != "available" %> + <% if @dining.status != "available" %> <% if @status_order == 'order' && @status_sale != 'sale' %> <%if !@order_items.empty? %> @@ -526,7 +526,7 @@ <% if current_login_employee.role == "cashier" %> - Edit + Edit Void <% else %> @@ -545,19 +545,19 @@ <% end %> <% if current_login_employee.role != "waiter" %> - + <%if @membership.discount && @obj_sale.customer.membership_id %> <%else%> - <%end%> - + <%end%> + <% end %> <% end %> @@ -583,7 +583,7 @@
- + <% @payment_methods.each_with_index do |pay, pay_index| %> <%if (pay_index+1)%3 == 0 %>
@@ -625,7 +625,7 @@
- + @@ -638,7 +638,7 @@ - @@ -690,7 +690,7 @@ count += 1 %> - <%= count %> + <%= count %> <%= order_item.item_name %> <% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %> @@ -701,10 +701,10 @@ <% end %> <% end %> - <% if !order_item.set_menu_items.nil? - JSON.parse(order_item.set_menu_items).each do |item_instance| + <% if !order_item.set_menu_items.nil? + JSON.parse(order_item.set_menu_items).each do |item_instance| set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f - %> + %>
<%= item_instance["item_instance_name"] %> <% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %> @@ -714,8 +714,8 @@ <% end %> <% end %> - - <% end + + <% end sub_total += set_item_prices end %> @@ -823,7 +823,7 @@ if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){ receipt_no = ($("#receipt_no").html()).trim(); } - + discount="<%= @membership.discount%>" if ($("#server_mode").val() != "cloud") { // first bill not used in cloud if (discount) { @@ -887,7 +887,7 @@ } else { var sale_id = "<%= @dining.id %>"; } - //var table_id = $('.tables').attr("data-id"); + //var table_id = $('.tables').attr("data-id"); window.location.href = '/origami/' + sale_id +"/"+cashier_type+ "/surveys" }); @@ -989,22 +989,22 @@ } location.reload(); } - }); + }); } - }); + }); }); - // click select option icon for add - $(document).on('click', '.payment_btn', function(event){ + // click select option icon for add + $(document).on('click', '.payment_btn', function(event){ active = $(this).hasClass('selected-payment'); value = $(this).data('value'); type = $(this).data('type'); group = $(this).data('group'); payments = $(".payment_btn"); - if (active) { + if (active) { $(this).removeClass('selected-payment'); - }else{ + }else{ $(this).addClass('selected-payment'); } }); //End selecct attribute buttom @@ -1026,7 +1026,7 @@ if(!location.pathname.includes("credit_payment")){ calculate_member_discount(sale_id,"Cash",tax_type); } - } + } } var ajax_url = "/origami/sale/" + sale_id + "/first_bill"; $.ajax({ @@ -1045,7 +1045,7 @@ } location.reload(); } - }); + }); }); function calculate_member_discount(sale_id,type,tax_type) { @@ -1060,10 +1060,10 @@ url: "/origami/" + sale_id + "/member_discount", data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':'cashier','tax_type':tax_type }, async: false, - success:function(result){ + success:function(result){ } }); - + } $('#pay').on('click', function () { @@ -1137,11 +1137,11 @@ } }); } - else { + else { location.reload(); } } - }); + }); }else{ swal("Opps","There is no orders!","warning"); } @@ -1151,7 +1151,7 @@ $('#split_bills').click(function(){ var dining_id = "<%= @dining.id %>"; window.location.href = '/origami/table/' + dining_id + "/" + cashier_type +"/split_bills"; - }); + }); $('#move').on('click', function () { if($('#move').is(":visible")) { @@ -1236,7 +1236,7 @@ }else{ swal("Opps","You are not authorized for void","warning") } - + }); $('#commissions').on('click', function () { @@ -1285,7 +1285,7 @@ } }); } - }); + }); }else{ swal("Opps","You are not authorized for void","warning") } @@ -1303,7 +1303,7 @@ window.location.href = '/origami/addorders/' + dining_id; }); - /* check in process */ + /* check in process */ $('#check_in').on('click',function(){ var dining_id = "<%= @dining.id %>"; @@ -1394,7 +1394,7 @@ } }); } - }); + }); } function check_emp_access_code(access_code,type) { @@ -1460,11 +1460,11 @@ type: "POST", url: "/origami/payment/"+cashier_type+"/change_tax", data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: tax_type}, - success:function(data){ + success:function(data){ if(data.status){ localStorage.setItem("tax_type", tax_type); window.location.href = '/origami/table/'+dining_id; - } + } } }); }else{