diff --git a/app/channels/print_channel.rb b/app/channels/print_channel.rb index 565622cd..b27223e1 100644 --- a/app/channels/print_channel.rb +++ b/app/channels/print_channel.rb @@ -1,6 +1,6 @@ class PrintChannel < ApplicationCable::Channel def subscribed - stream_from "print_channel" + stream_from "print_channel_#{params[:shop_code]}" end def unsubscribed diff --git a/app/controllers/origami/shifts_controller.rb b/app/controllers/origami/shifts_controller.rb index 4045eef3..cdc2950a 100755 --- a/app/controllers/origami/shifts_controller.rb +++ b/app/controllers/origami/shifts_controller.rb @@ -132,7 +132,7 @@ class Origami::ShiftsController < BaseOrigamiController p "close cashier print<===============================" p @other_charges p @total_amount_by_account - ActionCable.server.broadcast("print_channel", + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: "Cashier", unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, diff --git a/app/models/printer/cashier_station_printer.rb b/app/models/printer/cashier_station_printer.rb index 8bb46542..7f290133 100755 --- a/app/models/printer/cashier_station_printer.rb +++ b/app/models/printer/cashier_station_printer.rb @@ -87,7 +87,7 @@ class Printer::CashierStationPrinter < Printer::PrinterWorker if print_settings.unique_code == "SaleItemsPdf" pdf = SaleItemsPdf.new(print_settings, shop_details, period_name, type, account, from_date, to_date, shift_name, sale_items, total_other_charges) - ActionCable.server.broadcast("print_channel", + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: 'Cashier', unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, diff --git a/app/models/printer/order_queue_printer.rb b/app/models/printer/order_queue_printer.rb index 14cc3c67..5b1231b6 100755 --- a/app/models/printer/order_queue_printer.rb +++ b/app/models/printer/order_queue_printer.rb @@ -15,7 +15,8 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker pdf = print_settings.unique_code.constantize.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty) booking_id = Booking.get_booking_id(order_id) # end - ActionCable.server.broadcast("print_channel", + puts "print_channel_#{Shop.current_shop.shop_code}" + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: oqs.station_name, unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, @@ -98,7 +99,9 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker self.print(filename, oqs.printer_name) end booking_id = Booking.get_booking_id(order_id) #order[0].order_id - ActionCable.server.broadcast("print_channel", + puts "printing>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + puts "print_channel_#{Shop.current_shop.shop_code}" + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: oqs.station_name, unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, diff --git a/app/models/printer/receipt_printer.rb b/app/models/printer/receipt_printer.rb index ff6cc8e6..6adcca25 100755 --- a/app/models/printer/receipt_printer.rb +++ b/app/models/printer/receipt_printer.rb @@ -106,7 +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 - ActionCable.server.broadcast("print_channel", + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: "Cashier", unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, @@ -211,7 +211,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker #no print in cloud server self.print("tmp/print_move_table.pdf", oqs.printer_name) end - ActionCable.server.broadcast("print_channel", + ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}", queue: oqs.station_name, unique_code: print_settings.unique_code, print_copies: print_settings.print_copies, diff --git a/app/models/shop.rb b/app/models/shop.rb index 41110515..dbe6c58b 100755 --- a/app/models/shop.rb +++ b/app/models/shop.rb @@ -8,7 +8,7 @@ class Shop < ApplicationRecord accepts_nested_attributes_for :display_images def file_data=(input_data) - self.data = input_data.read + self.data = input_data.read end def self.current_shop