add print action cable
This commit is contained in:
@@ -111,6 +111,7 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
@total_dinein = ShiftSale.get_total_dinein(@shift).total_dinein_amount
|
||||
@total_takeway = ShiftSale.get_total_takeway(@shift).total_takeway_amount
|
||||
@total_other_charges = ShiftSale.get_total_other_charges(@shift).total_other_charges_amount
|
||||
@other_charges = ShiftSale.get_other_charges(@shift)
|
||||
@total_credit_payments = ShiftSale.get_shift_sales_with_credit_payment(shift_id).total_credit_payments
|
||||
@payment_methods = PaymentMethodSetting.where("is_active='1'").pluck("payment_method")
|
||||
# get printer info
|
||||
@@ -128,6 +129,31 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
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)
|
||||
end
|
||||
end
|
||||
p "close cashier print<==============================="
|
||||
p @other_charges
|
||||
p @total_amount_by_account
|
||||
ActionCable.server.broadcast("print_channel",
|
||||
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
|
||||
Employee.logout(session[:session_token])
|
||||
session[:session_token] = nil
|
||||
|
||||
Reference in New Issue
Block a user