CB ECR Integration
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance)
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.margin = 0
|
||||
@@ -65,6 +65,12 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
customer(customer_name)
|
||||
|
||||
#start card sale trans data
|
||||
if card_data != nil
|
||||
card_sale_data(card_data)
|
||||
end
|
||||
#end card sale trans data
|
||||
|
||||
if discount_price_by_accounts.length > 0 && shop_details.show_account_info
|
||||
discount_account(discount_price_by_accounts,printer_settings.precision,delimiter)
|
||||
end
|
||||
@@ -503,5 +509,26 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
move_down 5
|
||||
end
|
||||
|
||||
#start card sale trans data
|
||||
def card_sale_data(card_data)
|
||||
move_down 5
|
||||
stroke_horizontal_rule
|
||||
move_down 5
|
||||
|
||||
y_position = cursor
|
||||
if !card_data[0].nil?
|
||||
if card_data[0]['app'] == 'CUP'
|
||||
card_data[0]['app'] = 'UNIONPAY'
|
||||
elsif card_data[0]['app'] == 'MASTERCARD'
|
||||
card_data[0]['app'] = 'MASTER'
|
||||
end
|
||||
text "DATE/TIME: #{card_data[0]['res_date']} #{card_data[0]['res_time']} ", :size => @item_font_size, :align => :left
|
||||
text "BATCH NUM: #{card_data[0]['batch_no']} TRACE#: #{card_data[0]['trace']}",:size => @item_font_size, :align => :left
|
||||
text "RREF NUM: #{card_data[0]['ref_no']} APPR CODE: #{card_data[0]['app_code']} ",:size => @item_font_size, :align => :left
|
||||
text "TID: #{card_data[0]['tid']} ",:size => @item_font_size, :align => :left
|
||||
text "#{card_data[0]['app']} #{card_data[0]['pan']} ",:size => @item_font_size, :align => :left
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user