.. _maker-template-line: 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. .. py:function:: 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 ``amount`` to move the balance by a fixed amount in each period (or once, with ``at``), ``target`` to hold the balance at a level and let cash absorb the difference, or only ``opening`` to declare a balance that other entries move later. :Parameters: **name** : str Line name; required. It must be unique among the lines of this kind in the entity. **amount** : scalar, 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 ``target`` or ``data``. **at** : int, str, or date, optional Period in which ``amount`` is booked, once. Without ``at``, ``amount`` is booked in every period. **data** : dict, optional Changes of the balance for selected periods as ``{period: amount}``. It does not combine with ``amount`` or ``target``. **target** : scalar, 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 ``amount`` or ``data``. **opening** : scalar, Quantity, Series, or dict, optional Opening balance before the first period, in the entity's currency. Retained earnings balance it unless ``co.bs.opening`` states them. **cf** : str, 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. **tags** : iterable 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. **counterparty** : Entity, optional The other entity of the model that holds the opposite balance. It books a matching line named `` ()`` with the same opening balance, on the opposite side. It requires ``opening`` and does not take ``amount``, ``at``, ``data`` or ``target``. **actuals** : dict, optional Historical closing balances for periods up to ``Model.actual_until``, as ``{period: amount}``. Requires ``Model(..., actual_until=...)``. :Returns: LineItem The new line, valued at its closing balance. Its ``balance`` attribute is the same series, ``opening`` is the balance at the start of each period, and ``change`` is the movement. :Raises: TypeError At construction, if ``amount``, ``data`` and ``target`` are combined (any two of them); if ``counterparty`` is not an entity, lacks ``opening``, or is combined with ``amount``, ``at``, ``data`` or ``target``; 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, ``cf`` is not a cash-flow class, or ``counterparty`` is 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 ``at`` or a period of ``amount``, ``data``, ``target`` or ``opening`` is outside the model timeline. .. rubric:: 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. ``target`` posts whatever cash movement makes the line close at the target after the line's other entries. The opposite balance of a ``counterparty`` has the paired kind where the layout has one: ``receivable`` and ``payable``, and ``other_current_asset`` and ``other_current_liability`` pair with each other; any other kind pairs with ``other_liability`` or ``other_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 `_. .. rubric:: 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 ----------------------------- * :doc:`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_liability`` * :doc:`US 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_liability`` * :doc:`J-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_liability`` * :doc:`bank `: ``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``