update other charge add to recipt bill and close pdf
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)
|
||||
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)
|
||||
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
|
||||
@@ -80,6 +80,9 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
if shop_details.show_account_info
|
||||
items_account(item_price_by_accounts,printer_settings.precision,delimiter)
|
||||
if other_charges_amount
|
||||
show_other_charges_amount(other_charges_amount,printer_settings.precision,delimiter)
|
||||
end
|
||||
end
|
||||
|
||||
#start for individual payment
|
||||
@@ -536,6 +539,17 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
end
|
||||
|
||||
def show_other_charges_amount(other_amount,precision,delimiter)
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.label_width) do
|
||||
text "Other Charges", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.label_width,y_position], :width =>self.item_description_width) do
|
||||
text "#{number_with_precision(other_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
#individual payment per person
|
||||
def individual_payment(sale_data, survey, precision, delimiter)
|
||||
# per_person = sale_data.grand_total.to_f / survey.total_customer.to_i
|
||||
|
||||
Reference in New Issue
Block a user