mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 20:02:27 +03:00
imp: lib: include adeclarationinfo, if present, in accounts JSON
Note that this does not add the declaration info if it is not already present.
This commit is contained in:
parent
0bfd7f66b0
commit
91d6f8c841
@ -165,20 +165,21 @@ accountKV ::
|
||||
#endif
|
||||
=> Account -> [kv]
|
||||
accountKV a =
|
||||
[ "aname" .= aname a
|
||||
, "aebalance" .= aebalance a
|
||||
, "aibalance" .= aibalance a
|
||||
, "anumpostings" .= anumpostings a
|
||||
, "aboring" .= aboring a
|
||||
[ "aname" .= aname a
|
||||
, "adeclarationinfo" .= adeclarationinfo a
|
||||
, "aebalance" .= aebalance a
|
||||
, "aibalance" .= aibalance a
|
||||
, "anumpostings" .= anumpostings a
|
||||
, "aboring" .= aboring a
|
||||
-- To avoid a cycle, show just the parent account's name
|
||||
-- in a dummy field. When re-parsed, there will be no parent.
|
||||
, "aparent_" .= maybe "" aname (aparent a)
|
||||
, "aparent_" .= maybe "" aname (aparent a)
|
||||
-- Just the names of subaccounts, as a dummy field, ignored when parsed.
|
||||
, "asubs_" .= map aname (asubs a)
|
||||
, "asubs_" .= map aname (asubs a)
|
||||
-- The actual subaccounts (and their subs..), making a (probably highly redundant) tree
|
||||
-- ,"asubs" .= asubs a
|
||||
-- Omit the actual subaccounts
|
||||
, "asubs" .= ([]::[Account])
|
||||
, "asubs" .= ([]::[Account])
|
||||
]
|
||||
|
||||
instance ToJSON Ledger
|
||||
|
Loading…
Reference in New Issue
Block a user