limabean.core.inventory

Functions to build and query an inventory.

build

(build postings acc-booking-fn)

Cumulate postings into inventory indexed by date.

acc-booking-fn is a function which returns the booking method for an account.

build-with-history

(build-with-history postings acc-booking-fn)

Cumulate postings into inventory and inventory history indexed by date.

acc-booking-fn is a function which returns the booking method for an account.

cur-freq

(cur-freq inv)

Return map of frequency of currency use by currency.

diff

(diff inv1 inv2 acc-booking-fn)

Build an inventory whose positions are the difference between two inventories

history-at

(history-at history date)

Return the inventory as of the specified date

merge-position

(merge-position positions pst booking-method)

Merge position in currency order, then by cost attributes.

positions->units

(positions->units ps)

Return positions collapsed down to units only with no costs.

positions->units-of

(positions->units-of ps cur)

Return positions collapsed down to units only of the specified currency with no costs, or zero if none for that currency.

positions-diff

(positions-diff ps1 ps2 booking-method)

sub-accs

(sub-accs inv parent-accs)

Discard all but non-struct sub-accounts of any of parent-accs