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|
|
||||
|
@ -72,7 +73,20 @@ module Ledger
|
|||
amount: line_array[ 0 ].tr( SEPARATOR, '.' ).to_f }
|
||||
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