Methodology · published rules
Every figure in DueWise can be reproduced by hand.
Balances, ageing, priorities and forecasts are deterministic. The same records always produce the same result. Keeping the ledger deterministic means financial figures are never invented. The AI layer works on top of these verified results to explain them, and never changes them.
01
Settlement
balance = invoice.amount − Σ completed payments
status = paid if balance ≤ 0.005
partially_paid if payments > 0
overdue if due_date < today (display)Drafts are excluded from receivables. Pending or failed payments never reduce a balance.
02
Receivables ageing
days_overdue = max(0, today − due_date) bucket = Current | 1–30 | 31–60 | 60+
Ageing uses remaining balances, so partial payments reduce the amount in each bucket.
03
Customer payment behaviour
delay = settlement_date − due_date (per fully paid invoice) on_time_rate = count(delay ≤ 0) / n median_delay = max(0, median(delay)) sufficient = n ≥ 3
Settlement date is the date of the payment that completed the invoice.
04
Collection likelihood
p = 0.40 + 0.55 × on_time_rate if sufficient p = 0.75 otherwise p × 0.85 if 1–30 days overdue p × 0.70 if 31–60 days overdue p × 0.50 if 60+ days overdue p clamped to [0.20, 0.95]
Customers with fewer than 3 settled invoices are shown as lower-confidence estimates.
05
Cash-flow forecast (7/30/90 days)
scheduled = balance on due_date (overdue → today) expected_date = max(today, due_date + median_delay) expected = balance × p if expected_date ≤ horizon at_risk = scheduled − expected
7- and 30-day views use daily buckets; the 90-day view uses weekly buckets.
06
Forecast confidence
low_share = scheduled from customers without sufficient history / scheduled confidence = min(90, 35 + 45 × (1 − low_share) + min(10, completed_payments))
Labelled “Lower-confidence estimate” when low_share > 50%.
07
Collections priority
High if days_overdue > 30, or overdue with balance ≥ $5,000 Medium if overdue, or balance ≥ $10,000 Normal otherwise sort: priority → days_overdue → balance
Every worklist item shows the rule that placed it.
Worked example