This commit is contained in:
Nweni
2017-06-20 18:59:34 +06:30
parent bdb42daad7
commit a9e1d8c3d1
20 changed files with 970 additions and 149 deletions

View File

@@ -4,8 +4,9 @@ class Origami::RequestBillsController < BaseOrigamiController
@sale = Sale.new
sale_order=SaleOrder.new
booking_id = params[:id]
check_booking = Booking.find_by_booking_id(booking_id)
order_id = params[:id] # order_id
bk_order = BookingOrder.find_by_order_id(order_id)
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
if check_booking.sale_id.nil?
# Create Sale if it doesn't exist
puts "current_login_employee"
@@ -32,6 +33,5 @@ class Origami::RequestBillsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total)
redirect_to origami_path(@sale_data.sale_id)
end
end