add order source

This commit is contained in:
phyusin
2018-08-23 14:50:36 +06:30
parent 0f6986a4ed
commit d8a0b5b2dd
2 changed files with 3 additions and 2 deletions

View File

@@ -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

View File

@@ -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);