sale item report and rebate balance

This commit is contained in:
Aung Myo
2017-06-19 11:54:34 +06:30
parent faa6beb243
commit 675d83c80f
16 changed files with 391 additions and 137 deletions

View File

@@ -33,7 +33,7 @@ class ReceiptBillPdf < Prawn::Document
all_total(sale_data)
if member_info != nil
member_info(member_info)
member_info(member_info,customer_name)
end
footer
end
@@ -61,14 +61,14 @@ class ReceiptBillPdf < Prawn::Document
end
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
text "Customer:", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width =>self.item_width) do
text "#{customer_name}" , :size => self.item_font_size,:align => :left
end
move_down 5
# y_position = cursor
# bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
# text "Customer:", :size => self.item_font_size,:align => :left
# end
# bounding_box([self.label_width,y_position], :width =>self.item_width) do
# text "#{customer_name}" , :size => self.item_font_size,:align => :left
# end
# move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.label_width, :height => self.item_height) do
@@ -203,19 +203,32 @@ class ReceiptBillPdf < Prawn::Document
end
# show member information
def member_info(member_info)
def member_info(member_info,customer_name)
move_down 7
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Customer", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ customer_name }" , :size => self.item_font_size,:align => :right
end
move_down 5
if member_info["status"] == true
member_info["data"].each do |res|
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ res["accountable_type"] }", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right
if res["accountable_type"]== "RebateAccount"
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Rebate Balance", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right
end
end
end