Pricing and Totals
Totals are where a line item document is checked, disputed and paid. They deserve care.
Where to find it
Architect Panel → Forms:
- Dynamic Add Fields — the definitions, then View Fields on a row
- Conditional Forms — show and hide rules
- Line Item Builders — the builders, then View Line Fields on a row
Architect Panel → Data:
- Datastores — where line and header values are stored
Subtotals are per column
Each line field can display a subtotal with its own formatting and decimal places. That gives you a quantity total and a value total on the same grid, each formatted correctly.
Decide where the total is authoritative
Calculated for display, or stored on the record? Both are used and they answer different questions.
A stored total is what you charged; a calculated one is what today’s lines add up to. For anything invoiced, store it — otherwise editing a line changes an invoice you have already sent.
Round at the end, not per line
Rounding each line and then summing gives a different answer from summing and rounding once. Over a long document the difference is real, and it is the difference a customer’s accounts department will find.
Decide which you do, be consistent, and be able to explain it.
Percentages need a base
A discount or a tax percentage applies to something. Being explicit about whether it is before or after other adjustments is what makes a total reproducible.
Two people calculating the same document by hand should get the same answer.
Watch the order of operations
Line discount, then document discount, then tax — or a different order. It changes the answer, and it is exactly what a query about a total turns out to be.
Write it down.
Show the working
A document showing a net total, the discount, the tax and the gross is one somebody can check. A single figure is one they have to trust or query.
Test the awkward cases
- A line with a quantity of zero.
- A negative line, for a credit.
- A very large quantity.
- A hundred-line document.
- A discount taking the total to zero.
Each of those has produced a wrong total somewhere.
Check against a hand calculation
Once, properly, on a document with several lines and a discount. That single check is worth more than reading the configuration, and it is the thing nobody does.
Worked example
An organisation stores document totals rather than recalculating, rounds once at the document level, and writes its order of operations into its finance procedure. A hand check on a five-line order with a discount found a penny difference caused by per-line rounding, which was corrected before invoicing began.
Recommendations
- Store totals on anything invoiced.
- Round once, and be consistent.
- Write down the order of operations.
- Check one document by hand.