Some tests for invoice binding

This commit is contained in:
Martin Lensment 2015-04-14 19:00:38 +03:00
parent e678e655da
commit 57d23976c7
19 changed files with 206 additions and 25 deletions

View file

@ -27,15 +27,15 @@ class Invoice < ActiveRecord::Base
invoice_items
end
def total_without_vat
items.map(&:item_total_without_vat).sum
def sum_without_vat
items.map(&:item_sum_without_vat).sum
end
def total_vat
total_without_vat * vat_prc
def vat
sum_without_vat * vat_prc
end
def total
total_without_vat + total_vat
def sum
sum_without_vat + vat
end
end