Added additional rounding #2783

This commit is contained in:
Priit Tark 2015-08-13 15:44:51 +03:00
parent 964fb1734c
commit 07f89f8ce5
2 changed files with 4 additions and 4 deletions

View file

@ -126,14 +126,14 @@ class Invoice < ActiveRecord::Base
end end
def sum_without_vat def sum_without_vat
items.map(&:item_sum_without_vat).sum (items.map(&:item_sum_without_vat).sum).round(2)
end end
def vat def vat
sum_without_vat * vat_prc (sum_without_vat * vat_prc).round(2)
end end
def sum def sum
sum_without_vat + vat (sum_without_vat + vat).round(2)
end end
end end

View file

@ -3,6 +3,6 @@ class InvoiceItem < ActiveRecord::Base
belongs_to :invoice belongs_to :invoice
def item_sum_without_vat def item_sum_without_vat
amount * price (amount * price).round(2)
end end
end end