mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Added additional rounding #2783
This commit is contained in:
parent
964fb1734c
commit
07f89f8ce5
2 changed files with 4 additions and 4 deletions
|
@ -126,14 +126,14 @@ class Invoice < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def sum_without_vat
|
||||
items.map(&:item_sum_without_vat).sum
|
||||
(items.map(&:item_sum_without_vat).sum).round(2)
|
||||
end
|
||||
|
||||
def vat
|
||||
sum_without_vat * vat_prc
|
||||
(sum_without_vat * vat_prc).round(2)
|
||||
end
|
||||
|
||||
def sum
|
||||
sum_without_vat + vat
|
||||
(sum_without_vat + vat).round(2)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,6 @@ class InvoiceItem < ActiveRecord::Base
|
|||
belongs_to :invoice
|
||||
|
||||
def item_sum_without_vat
|
||||
amount * price
|
||||
(amount * price).round(2)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue