From 37f3ef7a0d088c2ea2a703e0914c536f98e54e82 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 30 Mar 2018 15:07:48 +0630 Subject: [PATCH 1/2] update customer assign redirect --- app/controllers/origami/quick_service_controller.rb | 2 +- app/views/origami/customers/index.html.erb | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) 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 f36ca636..ab67d9fb 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 " %> @@ -469,7 +471,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 %>"; @@ -502,7 +504,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/'; From 2dec217bccb1adf26d2be58bdc6f1b6d1154259d Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Fri, 30 Mar 2018 17:23:59 +0630 Subject: [PATCH 2/2] update waste and spoile --- app/views/origami/home/show.html.erb | 9 +++--- app/views/origami/payments/show.html.erb | 38 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 4810cf13..b108c46d 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" %>
@@ -1160,4 +1162,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