Add Invoice#vat_summary to return a VAT summary grouped by VAT rate
This commit is contained in:
parent
b7f74e23ec
commit
cd29a51680
10
stoptime.rb
10
stoptime.rb
|
@ -367,6 +367,16 @@ module StopTime::Models
|
||||||
return summ
|
return summ
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns a total per VAT rate of the contained tasks (Hash of Float to
|
||||||
|
# Fixnum).
|
||||||
|
def vat_summary
|
||||||
|
vatsumm = Hash.new(0.0)
|
||||||
|
summary.each do |task, summ|
|
||||||
|
vatsumm[task.vat_rate] += summ[3]
|
||||||
|
end
|
||||||
|
return vatsumm
|
||||||
|
end
|
||||||
|
|
||||||
# Returns the invoice period based on the contained tasks (Array of Time).
|
# Returns the invoice period based on the contained tasks (Array of Time).
|
||||||
# See also Task#bill_period.
|
# See also Task#bill_period.
|
||||||
def period
|
def period
|
||||||
|
|
Loading…
Reference in New Issue