mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2024-12-26 09:59:18 +01:00
wip
This commit is contained in:
parent
d9b4d922cc
commit
5abdf3eabf
1 changed files with 15 additions and 1 deletions
|
@ -63,6 +63,7 @@ module Ledger
|
|||
period = period.nil? ? '' : "-p '#{period}'"
|
||||
depth = depth.nil? ? '' : "--depth #{depth}"
|
||||
operation = cleared ? 'cleared' : 'balance'
|
||||
|
||||
run( "--flat --no-total --exchange '#{CURRENCY}' #{period} #{depth}", operation, categories )
|
||||
.split( "\n" )
|
||||
.map do |line|
|
||||
|
@ -73,6 +74,19 @@ module Ledger
|
|||
end
|
||||
end
|
||||
|
||||
# def int_treefied_balance( node )
|
||||
# return { name: node[:account], size: node[:amount] } unless node[:account].include( ':' )
|
||||
|
||||
# { name: node[:account].split(':').first,
|
||||
# children: int_treefied_balance( ... ) }
|
||||
# end
|
||||
|
||||
# def treefeid_balance( cleared = false, depth = nil, period = nil, categories = '' )
|
||||
# bal = balance( cleared, depth, period, categories )
|
||||
|
||||
|
||||
# end
|
||||
|
||||
def cleared
|
||||
run( "--flat --no-total --exchange '#{CURRENCY}'", 'cleared', 'Assets Equity' )
|
||||
.split( "\n" )
|
||||
|
|
Loading…
Reference in a new issue