39 lines
1.3 KiB
Ruby
Executable File
39 lines
1.3 KiB
Ruby
Executable File
class Printer::CashierStationPrinter < Printer::PrinterWorker
|
|
|
|
def print_open_cashier(receipt_no)
|
|
time = DateTime.now
|
|
|
|
#Use CUPS service
|
|
#Generate PDF
|
|
#Print
|
|
pdf = CashierStationOpening.new
|
|
pdf.render_file "tmp/cashier_station_#{order_id}_closing_#{time}.pdf"
|
|
self.print("tmp/cashier_station_#{order_id}_closing_#{time}.pdf")
|
|
end
|
|
|
|
# def print_close_cashier(receipt_no)
|
|
# #Use CUPS service
|
|
# #Generate PDF
|
|
# time = DateTime.now
|
|
# #Print
|
|
# pdf = CashierStationClosing.new
|
|
# pdf.render_file "tmp/cashier_station_#{order_id}_closing_#{time}.pdf"
|
|
# self.print("tmp/receipt.pdf")
|
|
# end
|
|
|
|
#Bill Receipt Print
|
|
def print_close_cashier(printer_settings,cashier_terminal,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount)
|
|
#Use CUPS service
|
|
#Generate PDF
|
|
#Print
|
|
cashier = shift_sale.employee.name
|
|
shift_name = shift_sale.shift_started_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") + "_" + shift_sale.shift_closed_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p")
|
|
|
|
pdf = CloseCashierPdf.new(printer_settings,shift_sale,shop_details,sale_taxes,other_payment,amount,discount,member_discount)
|
|
filename = "tmp/close_cashier_#{cashier}_#{shift_name}.pdf"
|
|
pdf.render_file filename
|
|
self.print(filename, cashier_terminal.printer_name)
|
|
end
|
|
#sqa
|
|
end
|