mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Some tests for invoice binding
This commit is contained in:
parent
e678e655da
commit
57d23976c7
19 changed files with 206 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue