fix get_order_items_details method in order_item and add taxes in receipt

This commit is contained in:
Yan
2017-06-15 17:57:58 +06:30
parent e085adab74
commit 03feae5b0f
6 changed files with 48 additions and 22 deletions

View File

@@ -165,16 +165,32 @@ class ReceiptBillPdf < Prawn::Document
text "( " +"#{sale_data.total_discount}" +" )" , :size => self.item_font_size,:align => :right
end
move_down 5
y_position = cursor
if sale_data.sale_taxes.length > 1
sale_data.sale_taxes.each do |st|
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "( " +"#{ st.tax_payable_amount }" +" )" , :size => self.item_font_size,:align => :right
end
end
else
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Total Tax", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "( " +"#{sale_data.total_tax}" +" )" , :size => self.item_font_size,:align => :right
end
# move_down 5
# y_position = cursor
# bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
# text "Total Tax", :size => self.item_font_size,:align => :left
# end
# bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
# text "( " +"#{sale_data.total_tax}" +" )" , :size => self.item_font_size,:align => :right
# end
move_down 5
y_position = cursor
move_down 5