Add MoveTablePdf with multiple printer
This commit is contained in:
@@ -56,19 +56,19 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
end
|
||||
end
|
||||
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
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)
|
||||
end
|
||||
end
|
||||
booking_array = Array.new
|
||||
bookings.each do | booking |
|
||||
if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
booking_array.push(booking)
|
||||
end
|
||||
end
|
||||
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
|
||||
# get printer info
|
||||
@from = (DiningFacility.find(change_from)).name
|
||||
@@ -78,9 +78,16 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
@date = DateTime.now
|
||||
@shop = Shop::ShopDetail
|
||||
unique_code = "MoveTablePdf"
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by)
|
||||
end
|
||||
|
||||
pdf_no = PrintSetting.where(:unique_code => unique_code).count
|
||||
#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)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user