diff --git a/app/controllers/origami/quick_service_controller.rb b/app/controllers/origami/quick_service_controller.rb index 8abcfcc8..d2194bb5 100644 --- a/app/controllers/origami/quick_service_controller.rb +++ b/app/controllers/origami/quick_service_controller.rb @@ -12,7 +12,7 @@ class Origami::QuickServiceController < ApplicationController day = Date.today.wday @menus = Menu.all @menu = MenuCategory.active.where("menu_id =#{@menus[0].id}").order('order_by asc') - @zone = Zone.all + @zone = Zone.all @customer = Customer.all @tables = Table.all.active.order('status desc') @rooms = Room.all.active.order('status desc') diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb index 503cb01f..181319b9 100755 --- a/app/views/origami/customers/index.html.erb +++ b/app/views/origami/customers/index.html.erb @@ -119,11 +119,13 @@ <%if !@dining_facility.nil?%> - - + + + <%else%> - + + <%end%> <%= f.error_notification %> <%= f.hidden_field :id, :class => "form-control col-md-6 " %> @@ -473,7 +475,7 @@ if(data.status == true) { var id = $("#table_id").val(); - var type = $("#type").val(); + var type = $("#table_type").val(); var booking_id = ""; <% if !@booking_order.nil? %> booking_id = "<%= @booking_order.booking_id %>"; @@ -506,7 +508,7 @@ $('#back').on('click',function(){ var id = $("#table_id").val(); - var type = $("#type").val(); + var type = $("#table_type").val(); var sale_id = $("#sale_id").val(); if (cashier_type == "quick_service") { window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/'; diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 974afe7c..ec935f04 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -488,11 +488,6 @@ + <% if @cashier_type=="quick_service" %>
@@ -1202,4 +1204,40 @@ var customer_name = "<%= @customer.name %>"; var sale_id = $("#sale_id").text() || 0; update_sale("", customer_id, customer_name, sale_id); }); + + function waste_and_spoilage(remark) { + var sale_id = $('#sale_id').text(); + console.log(sale_id) + swal({ + title: "Alert", + text: "Are you sure want to " + remark +" ?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#DD6B55", + confirmButtonText: "Yes, " +remark+ " it!", + closeOnConfirm: false + }, function (isConfirm) { + if (isConfirm) { + var url = "/origami/sale/" + sale_id +'/'+cashier_type+'/waste_and_spoilage'; + $.ajax({ + type: 'POST', + url: url, + data: "remark="+ remark + "&sale_id=" + sale_id, + success: function (result) { + console.log(result) + // For Server Print - from jade + if ($("#server_mode").val() == "cloud") { + code2lab.printFile(result.filepath.substr(6), result.printer_url); + } + if (cashier_type=="cashier") { + window.location.href = '/origami'; + }else{ + window.location.href = '/origami/quick_service'; + customer_display_view(null,"reload"); + } + } + }); + } + }); + } \ No newline at end of file