Rabbinatix
Sign inGet started
Store

Invoice total

FreeLogic
@rabbinatix/invoice-total by Rabbinatixupdated Oct 4, 2026

Subtotal, VAT and total of invoice lines, built from three small functions.

Sign in to add

A package can hold several functions. The entry maps a Line total helper over the lines and passes the subtotal to an Add VAT helper with Call Function. Adding the package adds all three to your reusable logic.

Shows: Call Function, Map, a package with helper functions.

How to use it

Add it to your logic, then add a Call Function step in any logic and pick Invoice total. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.

Inputs
lines: List of records
ratePercent: Number
Outputs
subtotal: Number
vat: Number
total: Number
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 3 outputs. step 1 of 5
Invoice total
lines
ratePercent
Map, Collection. 1 input, 1 output. step 2 of 5
Map Line total
array
result
Sum, Collection. 1 input, 1 output. step 3 of 5
Sum
array
sum
Call Function, Functions. 3 inputs, 3 outputs. step 4 of 5
Add VAT
amount
ratePercent
vat
total
Return, Input / output. 4 inputs, 0 outputs. step 5 of 5
Return
subtotal
vat
total

Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.

100%
Examplesrun live against the logic · 2/2 pass
PassedExampleInputOutput
Two lines at 22 %{"lines":[{"price":10,"qty":2},{"price":5,"qty":1}],"ratePercent":22}{"subtotal":25,"vat":5.5,"total":30.5}
No lines{"lines":[],"ratePercent":22}{"subtotal":0,"vat":0,"total":0}
Try it
Versions
In this package
Invoice total (entry)
Line total
Add VAT