receipt bill pdf taxes
This commit is contained in:
@@ -369,33 +369,6 @@ class ReceiptBillPdf < Prawn::Document
|
||||
if incl_tax
|
||||
service_tax_rate = st.tax_rate.to_i
|
||||
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
|
||||
if (st.tax_name.include? "Commercial")
|
||||
com_tax_desc = st.tax_name
|
||||
@@ -509,26 +482,29 @@ class ReceiptBillPdf < Prawn::Document
|
||||
where sa.sale_id='#{sale_data.sale_id}')) = 0
|
||||
THEN payment_method!='creditnote' ELSE 1 END) AND sale_id = ?", sale_data.sale_id)
|
||||
.group("payment_method")
|
||||
end
|
||||
<<<<<<< HEAD
|
||||
end
|
||||
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
if payment.payment_method == "paypar"
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
elsif printed_status == 'credit_payment'
|
||||
text "#{payment.payment_method.capitalize} Payment on #{payment.updated_at.strftime('%d-%m-%Y')}", :left_margin => -10, :size => self.item_font_size,:align => :left
|
||||
else
|
||||
payment_method = payment.payment_method.capitalize
|
||||
if payment.payment_method == "paymal"
|
||||
payment_method ='Card'
|
||||
end
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
if payment.payment_method == "paypar"
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
elsif printed_status == 'credit_payment'
|
||||
text "#{payment.payment_method.capitalize} Payment on #{payment.updated_at.strftime('%d-%m-%Y')}", :left_margin => -10, :size => self.item_font_size,:align => :left
|
||||
else
|
||||
payment_method = payment.payment_method.capitalize
|
||||
if payment.payment_method == "paymal"
|
||||
payment_method ='Card'
|
||||
end
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
end
|
||||
=======
|
||||
end
|
||||
>>>>>>> r-1902001-01
|
||||
|
||||
sale_payments.each do |payment|
|
||||
y_position = cursor
|
||||
|
||||
Reference in New Issue
Block a user