Pull from master

This commit is contained in:
San Wai Lwin
2018-05-25 16:22:30 +06:30
parent f906134fbf
commit 578c14ccc3
26 changed files with 536 additions and 358 deletions

View File

@@ -303,12 +303,16 @@ class ReceiptBillA5Pdf < Prawn::Document
end
if sale_data.sale_taxes.length > 0
incl_tax = ""
if sale_data.tax_type == "inclusive"
incl_tax = "Incl."
end
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
text "#{ st.tax_name } ( #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
bounding_box([self.description_width,y_position], :width =>self.label_width) do
text "#{number_with_precision(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right

View File

@@ -290,12 +290,17 @@ class ReceiptBillPdf < Prawn::Document
end
if sale_data.sale_taxes.length > 0
incl_tax = ""
if sale_data.tax_type == "inclusive"
incl_tax = "Incl."
end
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } ( #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
text "#{ st.tax_name } (#{incl_tax} #{ st.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_with_precision(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right