Add MoveTablePdf and FOC update error

This commit is contained in:
San Wai Lwin
2018-04-05 18:23:29 +06:30
parent 39e887c7a5
commit 769698e09e
6 changed files with 93 additions and 23 deletions

View File

@@ -62,9 +62,19 @@ class Origami::MovetableController < BaseOrigamiController
bookings = Booking.where('dining_facility_id=?',change_from)
booking_array = Array.new
bookings.each do | booking |
if booking.sale_id.nil? && booking.booking_status != 'moved'
booking_array.push(booking)
order_items = Array.new
if !bookings.nil?
bookings.each do | booking |
if booking.sale_id.nil? && booking.booking_status != 'moved'
booking_array.push(booking)
end
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
order.order_items.each do |order_item|
order_items.push(order_item)
end
end
end
end
@@ -82,12 +92,13 @@ class Origami::MovetableController < BaseOrigamiController
#print_settings = PrintSetting.find_by_unique_code(unique_code)
printer_array = []
printer_array = PrintSetting.where(:unique_code => unique_code)
for i in 0..pdf_no
if i != pdf_no
print_settings = printer_array[i]
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items)
end
end
end
end
end