From 4a2dd294abf453b74b056b9d4fb15beb7aa165f5 Mon Sep 17 00:00:00 2001 From: yarzar_code Date: Wed, 29 Jul 2020 15:24:46 +0630 Subject: [PATCH] sale item report print action cable added --- app/models/printer/cashier_station_printer.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/models/printer/cashier_station_printer.rb b/app/models/printer/cashier_station_printer.rb index 63ffc53e..8bb46542 100755 --- a/app/models/printer/cashier_station_printer.rb +++ b/app/models/printer/cashier_station_printer.rb @@ -86,6 +86,25 @@ 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", + queue: 'Cashier', + unique_code: print_settings.unique_code, + print_copies: print_settings.print_copies, + data: { + sale_items: sale_items.as_json, + total_other_charges: total_other_charges, + shop_details:shop_details.as_json, + sale_details: { + period: period_name, + type: type, + account: account, + from_date: from_date, + to_date: to_date, + shift: shift_name, + }, + } + ) puts 'Printing!!!!' end if print_settings.unique_code == "SaleItemsStarPdf"