Balance-sheet lines (line)#
One signature and one documentation text are shared by every maker listed at the end of this page. The call is shown for co.bs.receivable; the other kinds take the same arguments.
- co.bs.receivable(name, amount=None, at=None, *, data=None, target=None, opening=None, cf=None, tags=(), counterparty=None, actuals=None)#
Add a balance-sheet line of this kind: an opening balance, a movement against cash, or a target balance.
The line’s value is its closing balance in each period. Give
amountto move the balance by a fixed amount in each period (or once, withat),targetto hold the balance at a level and let cash absorb the difference, or onlyopeningto declare a balance that other entries move later.- Parameters:
- namestr
Line name; required. It must be unique among the lines of this kind in the entity.
- amountscalar, Quantity, Series, or dict, optional
Change of the balance in each period, in the entity’s currency per period; cash takes the other side. A positive amount raises an asset and lowers cash, and raises a liability or equity line and raises cash. A dict maps period labels, indices, or dates to amounts and books 0 in the other periods. A quantity per time is integrated by period length. It does not combine with
targetordata.- atint, str, or date, optional
Period in which
amountis booked, once. Withoutat,amountis booked in every period.- datadict, optional
Changes of the balance for selected periods as
{period: amount}. It does not combine withamountortarget.- targetscalar, Quantity, Series, or dict, optional
Closing balance to hold in each period, in the entity’s currency. Cash absorbs the difference between the target and what other entries leave. It does not combine with
amountordata.- openingscalar, Quantity, Series, or dict, optional
Opening balance before the first period, in the entity’s currency. Retained earnings balance it unless
co.bs.openingstates them.- cfstr, optional
Cash-flow class of the line’s cash movements:
"operating","investing","financing"or"fx". The default is the cash-flow class of the kind.- tagsiterable of str, default=()
Labels added to the account’s tags, besides the tags of the kind. boki reads tags to recognize special accounts; most models do not need them.
- counterpartyEntity, optional
The other entity of the model that holds the opposite balance. It books a matching line named
<name> (<this entity>)with the same opening balance, on the opposite side. It requiresopeningand does not takeamount,at,dataortarget.- actualsdict, optional
Historical closing balances for periods up to
Model.actual_until, as{period: amount}. RequiresModel(..., actual_until=...).
- Returns:
- LineItem
The new line, valued at its closing balance. Its
balanceattribute is the same series,openingis the balance at the start of each period, andchangeis the movement.
- Raises:
- TypeError
At construction, if
amount,dataandtargetare combined (any two of them); ifcounterpartyis not an entity, lacksopening, or is combined withamount,at,dataortarget; or if an amount has a type boki cannot use in an expression.- ValueError
At construction, if a line with this name already exists for this kind,
cfis not a cash-flow class, orcounterpartyis this entity or belongs to another model.- UnitError
At construction, if an amount is in a unit other than the entity’s currency.
- IndexError
At evaluation, if
ator a period ofamount,data,targetoropeningis outside the model timeline.
Notes
The documentation of each maker starts this section with the maker’s kind, its side, and the section and cash-flow class of the kind; the layout pages list them.
An asset moves with a debit to the line and a credit to cash, and a liability or equity line moves with a debit to cash and a credit to the line; a negative amount reverses the entry.
targetposts whatever cash movement makes the line close at the target after the line’s other entries. The opposite balance of acounterpartyhas the paired kind where the layout has one:receivableandpayable, andother_current_assetandother_current_liabilitypair with each other; any other kind pairs withother_liabilityorother_asset.Kinds whose mechanism is not a plain line use another template: fixed assets, construction in progress, loans, capital, and dividends.
See the balance-sheet rows and opening balances with a counterparty.
Examples
Hold receivables at half of each month’s sales, starting from an opening balance of 30:
>>> import boki as b >>> months = ["2027-01", "2027-02", "2027-03"] >>> m = b.Model("Receivables", start="2027-01", periods=3, step=b.month) >>> co = m.entity("A", standard=b.IFRS) >>> co.bs.opening(cash=1000) >>> sales = co.pl.revenue("Sales", 100) >>> receivable = co.bs.receivable("Receivable", target=sales * 0.5, opening=30) >>> r = m.render() >>> [round(r.value(receivable, month)) for month in months] [50, 50, 50] >>> [round(r.value(co.bs.cash, month)) for month in months] [1080, 1180, 1280]
Book a deposit once, in the second month, with
at:>>> m = b.Model("Deposit", start="2027-01", periods=3, step=b.month) >>> co = m.entity("A", standard=b.IFRS) >>> co.bs.opening(cash=1000) >>> deposit = co.bs.deposit("Deposit", 20, at="2027-02") >>> r = m.render() >>> [round(r.value(deposit, month)) for month in months] [0, 20, 20]
Makers that use this template#
IFRS general:
co.bs.receivable,co.bs.inventory,co.bs.prepaid,co.bs.working_capital,co.bs.other_current_asset,co.bs.deposit,co.bs.other_asset,co.bs.deferred_tax_asset,co.bs.payable,co.bs.accrued,co.bs.deferred_revenue,co.bs.other_current_liability,co.bs.lease_liability,co.bs.other_liability,co.bs.deferred_tax_liabilityUS GAAP general:
co.bs.receivable,co.bs.inventory,co.bs.prepaid,co.bs.working_capital,co.bs.other_current_asset,co.bs.deposit,co.bs.other_asset,co.bs.deferred_tax_asset,co.bs.payable,co.bs.accrued,co.bs.deferred_revenue,co.bs.other_current_liability,co.bs.lease_liability,co.bs.other_liability,co.bs.deferred_tax_liabilityJ-GAAP general:
co.bs.receivable,co.bs.inventory,co.bs.prepaid,co.bs.working_capital,co.bs.other_current_asset,co.bs.deposit,co.bs.other_asset,co.bs.deferred_tax_asset,co.bs.payable,co.bs.accrued,co.bs.deferred_revenue,co.bs.other_current_liability,co.bs.lease_liability,co.bs.other_liability,co.bs.deferred_tax_liabilitybank:
co.bs.earning_asset,co.bs.allowance,co.bs.other_asset,co.bs.deferred_tax_asset,co.bs.deposits,co.bs.other_liability,co.bs.deferred_tax_liability