BillingPlanPatch
RequestFields to change; only sent fields change. lines and variables are whole lists (see BillingPlanLineInput).
Sent in requests. Its values are closed: anything not listed is refused.
Attributes
16Due on the last day of the invoice date's month, or the next month's last day when issued on month end. Counts from the invoice date on every run, regardless of the billed period. Cannot be combined with due_day_of_next_month; payment_term_days is ignored when true.
Due on this day of the next month instead; null to use payment_term_days.
For object_type plans, the contact properties that name the payer, in order.
The currency (ISO 4217) of the invoices the plan bills from now on: the book currency or another currency the company has activated. On a plan with issued invoices the change is a new revision (effective_from), like any change to what is billed.
The whole list of variables.
11 attributes of each item
number (with a unit) or boolean (reads as 1/0 in formulas).
One of number, boolean
timed: values by period, set on the plan. asked: given at every run. formula: computed from its formula at every run.
One of timed, asked, formula
Required for kind=formula; null otherwise. Uses system values and variables earlier in the submitted variable list; self and forward references are refused. Evaluated after system values, before lines, using Decimal precision 28.
For an asked number only: how a billing run computes the value it takes from a purchase invoice's chosen lines, a formula in the invoice context (see parseBillingFormula), e.g. sum_lines(line.amount / line.quantity) for a price per unit.
Details
Null: the chosen lines' sum, sum_lines(line.amount). Stored normalised; the default written out is stored as null.
For timed variables (may be empty while drafting); empty for asked.
3 attributes of each item
The whole list of lines, in invoice order.
22 attributes of each item
fixed: a quantity and price. formula: quantity formula × price formula per recipient. allocation: a total formula split across recipients by a weight formula.
One of fixed, formula, allocation
An existing line of this plan to keep; omit for a new line (BILLING_PLAN_LINE_NOT_FOUND otherwise).
The item the line bills; with price_source article its price is read at every run.
fixed lines: the price from this line (manual) or from the item (article), read at every run.
One of manual, article
fixed lines with price_source manual: net price per unit; null with article.
formula lines: the quantity per recipient, e.g. consumption.kulm_vesi.
formula lines: the price per unit, e.g. var.water_rate.
allocation lines: the amount to split, evaluated once for the plan; may use sum_objects.
allocation lines: each recipient's weight, e.g. prop.area_m2.
Who the line bills; null (or omitted) = every recipient of the plan.
When a consumption the line uses has no reading: stop the run (block), leave the line off that recipient's invoice (skip_line), or bill the last 3 periods' average, marked as an estimate (estimate).
One of block, skip_line, estimate
Bill a negative period consumption as 0, or with a negative amount.
One of zero, negative
Bill only objects whose boolean property has this value.
Bill only in periods where the plan's boolean variable has this value.
Dimension values on the line, at most one per dimension.