check js func: and card balance amount for Paymal payment
This commit is contained in:
@@ -3,7 +3,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
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, :line_move
|
||||
|
||||
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,other_charges_amount,latest_order_no)
|
||||
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,other_charges_amount,latest_order_no,card_balance_amount)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.header_font_size = printer_settings.header_font_size.to_i
|
||||
@@ -73,6 +73,11 @@ class ReceiptBillPdf < Prawn::Document
|
||||
card_sale_data(card_data)
|
||||
end
|
||||
#end card sale trans data
|
||||
#start card blanace amount
|
||||
if !card_balance_amount.nil?
|
||||
card_balance_data(card_balance_amount)
|
||||
end
|
||||
#end card blanace amount
|
||||
|
||||
if discount_price_by_accounts.length > 0 && shop_details.show_account_info
|
||||
discount_account(discount_price_by_accounts,printer_settings.precision,delimiter)
|
||||
@@ -509,9 +514,9 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Total Balance", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(total_balance, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(total_balance, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -707,6 +712,23 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
|
||||
#start card balance data
|
||||
def card_balance_data(card_balance_amount)
|
||||
if card_balance_amount > 0
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
move_down line_move
|
||||
|
||||
y_position = cursor
|
||||
bounding_box([0, y_position], :width =>self.label_width) do
|
||||
text "Card Balance: ",:style => :bold, :size => header_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#check ReceiptBillAltName included
|
||||
def show_alt_name
|
||||
bill_alt_name = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
||||
|
||||
Reference in New Issue
Block a user