fixed print serviceaction cable

This commit is contained in:
NyanLinHtut
2020-08-12 15:37:38 +06:30
parent 61a1189083
commit 583d7ee473
9 changed files with 89 additions and 89 deletions

View File

@@ -106,6 +106,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
pdf = ReceiptBillOrderPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data,other_amount,latest_order_no,card_balance_amount,order_reservation)
end
if ENV["SERVER_MODE"] == "cloud"
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: "Cashier",
unique_code: print_settings.unique_code,
@@ -133,6 +134,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
footer: { printed_status: printed_status, footer_text: "Thank You! See you Again" }
}
)
end
# print as print copies in printer setting
count = printer_settings.print_copies
@@ -199,18 +201,19 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
#Use CUPS service
#Generate PDF
#Print
pdf = MoveTablePdf.new(printer_settings,to,from,shop_detail,date,type,moved_by,order_items)
pdf.render_file "tmp/print_move_table.pdf"
if oqs.print_copy
self.print("tmp/print_move_table.pdf",oqs.printer_name)
if ENV["SERVER_MODE"] != "cloud"
if oqs.print_copy
self.print("tmp/print_move_table.pdf",oqs.printer_name)
else
print_settings.print_copies = 1
print_settings.save!
#no print in cloud server
self.print("tmp/print_move_table.pdf", oqs.printer_name)
end
else
print_settings.print_copies = 1
print_settings.save!
#no print in cloud server
self.print("tmp/print_move_table.pdf", oqs.printer_name)
end
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: oqs.station_name,
unique_code: print_settings.unique_code,
@@ -226,6 +229,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
},
}
)
end
end
#Bill Receipt Print