BillingPlanVariableInput
RequestA plan variable (KÜ2 D65/D70), referenced from the plan's formulas as var.<key> and from line conditions. kind=timed holds dated segments; kind=asked has none and is asked at every billing run; kind=formula computes from earlier variables and system values. The key (^[a-z][a-z0-9_]*$, unique per plan) is locked once any line uses it or a billing run has recorded a value for it (BILLING_PLAN_VARIABLE_KEY_LOCKED). Variables are sent as a whole list, in display order: id keeps a variable, a variable left out is removed unless a line uses it (BILLING_PLAN_VARIABLE_IN_USE).
Sent in requests. Its values are closed: anything not listed is refused.
Attributes
11number (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.