From d8a0b5b2dd36bb5a5a7e327548e53e62b885c7c0 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 23 Aug 2018 14:50:36 +0630 Subject: [PATCH] add order source --- app/controllers/origami/split_bill_controller.rb | 2 +- app/views/origami/orders/show.html.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/origami/split_bill_controller.rb b/app/controllers/origami/split_bill_controller.rb index 729a3f15..c7311fd6 100755 --- a/app/controllers/origami/split_bill_controller.rb +++ b/app/controllers/origami/split_bill_controller.rb @@ -120,7 +120,7 @@ class Origami::SplitBillController < BaseOrigamiController if booking if booking.sale_id.nil? sale = Sale.new - status, sale_id = sale.generate_invoice_from_booking(params[:booking_id], current_user, current_user, cashier_type, "cashier") + status, sale_id = sale.generate_invoice_from_booking(params[:booking_id], current_user, current_user, cashier_type) sale_data = Sale.find_by_sale_id(sale_id) else status = true diff --git a/app/views/origami/orders/show.html.erb b/app/views/origami/orders/show.html.erb index c4ba5ae4..cae8c4c6 100755 --- a/app/views/origami/orders/show.html.erb +++ b/app/views/origami/orders/show.html.erb @@ -355,13 +355,14 @@ if(orders.length == 1){ booking_id = booking[0].booking_id; } + var cashier_type = "cashier"; var ajax_url = "/origami/split_bills"; $.ajax({ type: "POST", url: ajax_url, dataType: 'JSON', - data: {'dining_id' : dining_id, 'type': type, 'customer_id' : customer_id, 'booking_id' : booking_id, 'order_ids' : [], 'order_items' : '', 'orders' : JSON.stringify(arr_order)}, + data: {'cashier_type':cashier_type,'dining_id' : dining_id, 'type': type, 'customer_id' : customer_id, 'booking_id' : booking_id, 'order_ids' : [], 'order_items' : '', 'orders' : JSON.stringify(arr_order)}, success: function (result) { if (!result.status) { swal("Information!", result.error_message);