add top level accounts
This commit is contained in:
parent
e74249cc11
commit
14dedcf779
1 changed files with 9 additions and 5 deletions
|
@ -19,13 +19,17 @@ module Ledger
|
||||||
end
|
end
|
||||||
|
|
||||||
def accounts( depth = 9999 )
|
def accounts( depth = 9999 )
|
||||||
run( '', 'accounts' )
|
accounts = run( '', 'accounts' )
|
||||||
.split( "\n" )
|
.split( "\n" )
|
||||||
.map do |a|
|
.map do |a|
|
||||||
a.split( ':' )
|
a.split( ':' )
|
||||||
.each_slice( depth )
|
.each_slice( depth )
|
||||||
.to_a.first
|
.to_a.first
|
||||||
end.uniq
|
end.uniq
|
||||||
|
|
||||||
|
top_level_accounts = accounts.map(&:first).uniq.map { |account| [ account ] }
|
||||||
|
|
||||||
|
( accounts + top_level_accounts ).sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def dates_salaries( category = 'salaire' )
|
def dates_salaries( category = 'salaire' )
|
||||||
|
|
Loading…
Add table
Reference in a new issue