receipt bill pdf taxes

This commit is contained in:
Thein Lin Kyaw
2020-08-26 11:14:48 +06:30
parent e0cbe57245
commit b492633c2d

View File

@@ -369,33 +369,6 @@ class ReceiptBillPdf < Prawn::Document
if incl_tax if incl_tax
service_tax_rate = st.tax_rate.to_i service_tax_rate = st.tax_rate.to_i
end end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{service_tax_amount.to_i + @sub_total.to_i}" , :size => self.item_font_size,:align => :right
end
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ com_tax_desc } (#{incl_tax} #{ com_tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_format(com_tax_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
else
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
if st.tax_rate.to_i == st.tax_payable_amount.to_i
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
else
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_format(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
end end
if (st.tax_name.include? "Commercial") if (st.tax_name.include? "Commercial")
com_tax_desc = st.tax_name com_tax_desc = st.tax_name
@@ -509,6 +482,7 @@ class ReceiptBillPdf < Prawn::Document
where sa.sale_id='#{sale_data.sale_id}')) = 0 where sa.sale_id='#{sale_data.sale_id}')) = 0
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id) THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
.group("payment_method") .group("payment_method")
<<<<<<< HEAD
end end
sale_payments.each do |payment| sale_payments.each do |payment|
@@ -528,7 +502,9 @@ class ReceiptBillPdf < Prawn::Document
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
end end
end end
=======
end end
>>>>>>> r-1902001-01
sale_payments.each do |payment| sale_payments.each do |payment|
y_position = cursor y_position = cursor