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

@@ -67,10 +67,7 @@ class Origami::ShiftsController < BaseOrigamiController
end
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# if !close_cashier_print[0].nil?
# @close_cashier_print = close_cashier_print[0][1]
# end
@@ -126,34 +123,10 @@ class Origami::ShiftsController < BaseOrigamiController
end
find_close_cashier_print = Lookup.collection_of('close_cashier_print')
if find_close_cashier_print[0][1].to_i > 0
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments,@payment_methods)
printer.print_close_cashier(print_settings,cashier_terminal,@shift, @sale_items, @total_other_charges_info, shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount,@total_dinein,@total_takeway,@total_other_charges,@total_waste,@total_spoile,@total_credit_payments,@payment_methods,@other_charges)
end
end
p "close cashier print<==============================="
p @other_charges
p @total_amount_by_account
ActionCable.server.broadcast("print_channel_#{Shop.current_shop.shop_code}",
queue: "Cashier",
unique_code: print_settings.unique_code,
print_copies: print_settings.print_copies,
data: {
shop_details: shop_details.as_json,
shift_sale: @shift,
cashier_terminal: cashier_terminal,
shift_employee: @shift.employee,
sale_items: @sale_items,
sale_taxes: @sale_taxes,
other_payment: @other_payment,
total_amount_by_account: @total_amount_by_account,
total_discount_by_account: @total_discount_by_account,
total_member_discount: @total_member_discount,
total_waste: @total_waste,
total_spoile: @total_spoile,
other_charges: @other_charges,
total_other_charges: @total_other_charges,
total_credit_payments: @total_credit_payments
}
)
# end
end
Employee.logout(session[:session_token])
session[:session_token] = nil