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