no print for cloud
This commit is contained in:
@@ -22,29 +22,29 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
# Print for First Bill to Customer
|
||||
unique_code = "ReceiptBillPdf"
|
||||
#shop detail
|
||||
shop_details = Shop::ShopDetail
|
||||
# customer= Customer.where('customer_id=' +.customer_id)
|
||||
customer= Customer.find(sale_data.customer_id)
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# #shop detail
|
||||
# shop_details = Shop::ShopDetail
|
||||
# # customer= Customer.where('customer_id=' +.customer_id)
|
||||
# customer= Customer.find(sale_data.customer_id)
|
||||
# # get member information
|
||||
# rebate = MembershipSetting.find_by_rebate(1)
|
||||
# if customer.membership_id != nil && rebate
|
||||
# member_info = Customer.get_member_account(customer)
|
||||
# end
|
||||
# # get printer info
|
||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# find order id by sale id
|
||||
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||
# # find order id by sale id
|
||||
# # sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||
|
||||
# Calculate price_by_accounts
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale_items)
|
||||
# # Calculate price_by_accounts
|
||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale_items)
|
||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt")
|
||||
# printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt")
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -83,24 +83,24 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
# For Print
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# # get member information
|
||||
# rebate = MembershipSetting.find_by_rebate(1)
|
||||
# if customer.membership_id != nil && rebate
|
||||
# member_info = Customer.get_member_account(customer)
|
||||
# rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
# end
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
# # get printer info
|
||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# # Calculate Food and Beverage Total
|
||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid")
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
# printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -202,26 +202,26 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop::ShopDetail
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# #shop detail
|
||||
# shop_details = Shop::ShopDetail
|
||||
# # get member information
|
||||
# rebate = MembershipSetting.find_by_rebate(1)
|
||||
# if customer.membership_id != nil && rebate
|
||||
# member_info = Customer.get_member_account(customer)
|
||||
# rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
# end
|
||||
# # get printer info
|
||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
# Calculate price_by_accounts
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
# # Calculate price_by_accounts
|
||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print")
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
# printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print")
|
||||
end
|
||||
|
||||
def foc
|
||||
@@ -251,20 +251,20 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
# Re-call Sale Data
|
||||
saleObj = Sale.find(sale_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# customer= Customer.find(saleObj.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop::ShopDetail
|
||||
# #shop detail
|
||||
# shop_details = Shop::ShopDetail
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
# # get printer info
|
||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# # Calculate Food and Beverage Total
|
||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
# printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -46,24 +46,24 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
cashier_terminal.save
|
||||
|
||||
|
||||
unique_code = "CloseCashierPdf"
|
||||
shop_details = Shop.find(1)
|
||||
#get tax
|
||||
shift_obj = ShiftSale.where('id =?',@shift.id)
|
||||
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||
#other payment details for mpu or visa like card
|
||||
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
||||
# unique_code = "CloseCashierPdf"
|
||||
# shop_details = Shop.find(1)
|
||||
# #get tax
|
||||
# shift_obj = ShiftSale.where('id =?',@shift.id)
|
||||
# @sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
|
||||
# #other payment details for mpu or visa like card
|
||||
# @other_payment = ShiftSale.get_by_shift_other_payment(@shift)
|
||||
|
||||
# Calculate price_by_accounts
|
||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
||||
# get printer info
|
||||
print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
# # Calculate price_by_accounts
|
||||
# @total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||
# @total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||
# @total_member_discount = ShiftSale.get_total_member_discount(@shift)
|
||||
# # get printer info
|
||||
# print_settings = PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
printer = Printer::CashierStationPrinter.new(print_settings)
|
||||
# printer = Printer::CashierStationPrinter.new(print_settings)
|
||||
|
||||
printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
|
||||
# printer.print_close_cashier(print_settings,cashier_terminal,@shift,shop_details,@sale_taxes,@other_payment,@total_amount_by_account,@total_discount_by_account,@total_member_discount)
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -55,40 +55,40 @@ class Origami::VoidController < BaseOrigamiController
|
||||
|
||||
# For Print
|
||||
|
||||
member_info = nil
|
||||
rebate_amount = nil
|
||||
# member_info = nil
|
||||
# rebate_amount = nil
|
||||
|
||||
# For Cashier by Zone
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
# # For Cashier by Zone
|
||||
# bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
# if bookings.count > 1
|
||||
# # for Multiple Booking
|
||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
# else
|
||||
# table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
# end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
# cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
# cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(sale.customer_id)
|
||||
# unique_code = "ReceiptBillPdf"
|
||||
# customer= Customer.find(sale.customer_id)
|
||||
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
rebate = MembershipSetting.find_by_rebate(1)
|
||||
if customer.membership_id != nil && rebate
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
end
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# Calculate Food and Beverage Total
|
||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
|
||||
# #shop detail
|
||||
# shop_details = Shop.find(1)
|
||||
# # get member information
|
||||
# rebate = MembershipSetting.find_by_rebate(1)
|
||||
# if customer.membership_id != nil && rebate
|
||||
# member_info = Customer.get_member_account(customer)
|
||||
# rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
# end
|
||||
# # get printer info
|
||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
# # Calculate Food and Beverage Total
|
||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
|
||||
|
||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID")
|
||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
||||
# printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID")
|
||||
|
||||
#end print
|
||||
|
||||
|
||||
Reference in New Issue
Block a user