CB ECR Integration

This commit is contained in:
phyusin
2018-01-10 18:08:28 +06:30
parent 014a071637
commit 903dddd8cc
37 changed files with 807 additions and 92 deletions

View File

@@ -61,7 +61,7 @@ class Origami::PaymentsController < BaseOrigamiController
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",current_balance)
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",current_balance,nil)
end
def create
@@ -119,6 +119,18 @@ class Origami::PaymentsController < BaseOrigamiController
current_balance = SaleAudit.paymal_search(sale_id)
end
#for card sale data
card_data = Array.new
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
if !card_sale_trans_ref_no.nil?
card_res_date = card_sale_trans_ref_no.res_date.strftime("%Y-%m-%d").to_s
card_res_time = card_sale_trans_ref_no.res_time.strftime("%H:%M").to_s
card_no = card_sale_trans_ref_no.pan.last(4)
card_no = card_no.rjust(19,"**** **** **** ")
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => card_sale_trans_ref_no.batch_no, 'trace' => card_sale_trans_ref_no.trace, 'pan' => card_no, 'app' => card_sale_trans_ref_no.app, 'tid' => card_sale_trans_ref_no.terminal_id, 'app_code' => card_sale_trans_ref_no.app_code, 'ref_no' => card_sale_trans_ref_no.ref_no, 'mid' => card_sale_trans_ref_no.merchant_id})
end
puts "card_data"
puts card_data.to_json
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
# Calculate Food and Beverage Total
@@ -126,7 +138,7 @@ class Origami::PaymentsController < BaseOrigamiController
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",current_balance)
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",current_balance,card_data)
end
end
@@ -240,6 +252,18 @@ class Origami::PaymentsController < BaseOrigamiController
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
current_balance = SaleAudit.paymal_search(sale_id)
end
#for card sale data
card_data = Array.new
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
if !card_sale_trans_ref_no.nil?
card_res_date = card_sale_trans_ref_no.res_date.strftime("%Y-%m-%d").to_s
card_res_time = card_sale_trans_ref_no.res_time.strftime("%H:%M").to_s
card_no = card_sale_trans_ref_no.pan.last(4)
card_no = card_no.rjust(19,"**** **** **** ")
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => card_sale_trans_ref_no.batch_no, 'trace' => card_sale_trans_ref_no.trace, 'pan' => card_no, 'app' => card_sale_trans_ref_no.app, 'tid' => card_sale_trans_ref_no.terminal_id, 'app_code' => card_sale_trans_ref_no.app_code, 'ref_no' => card_sale_trans_ref_no.ref_no, 'mid' => card_sale_trans_ref_no.merchant_id})
end
# get printer info
print_settings=PrintSetting.find_by_unique_code(unique_code)
@@ -248,7 +272,7 @@ class Origami::PaymentsController < BaseOrigamiController
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",current_balance)
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",current_balance,card_data)
end
def foc
@@ -298,7 +322,7 @@ class Origami::PaymentsController < BaseOrigamiController
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",nil)
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",nil,nil)
end
end