Skip to content

Rebuilding a NetSuite A/R aging you can reproduce

Updated 6 min readFor collections, AR and finance systems teams on NetSuite

A NetSuite A/R aging total depends on the Aging Reports Use preference, which ages by due date or by transaction date, on the cutoff, on bucket boundaries and on how credits and unapplied payments are treated. Oracle says the A/R Aging Detail report selects transactions, credit memos included, by the date they are closed, as opposed to the date they are applied. A query that groups today’s unpaid amounts by an old date is therefore a current balance, and calling it a historical aging is an error.

Check one preference before writing anything

NetSuite has an account-wide accounting preference called Aging Reports Use, under the General subtab of Accounting Preferences. It offers Due Date or Transaction Date. Oracle’s Cash 360 prerequisites require the Due Date option for that product’s aging, which tells you both settings exist in real accounts. Find out which yours uses before you touch a query, because a SuiteQL aging on duedate will never match a report aged on transaction date, however careful the rest of the logic is.

The difference can be large. Take five synthetic open invoices at a September 30 cutoff, each on net-30 terms apart from one on net-60. By due date only three are overdue, and by transaction date all five have aged. Same customers, same balances, two collection queues.

Synthetic invoiceTrandateDue dateOpen at Sep 30Age by due dateAge by trandate
ASep 10Oct 1020,000Not due20 days
BAug 31Sep 3015,0000 days30 days
CAug 30Sep 2910,0001 day31 days
DJul 15Sep 1330,00017 days77 days
EJun 20Jul 205,00072 days102 days
Over 30 days, by due date5,000Over 30 days, by trandate45,000Total open80,000Over 30 days, by due date5,000Over 30 days, by trandate45,000Total open80,000
Synthetic data: the two aging bases give different totals for the over-30-day bucket, 5,000 by due date and 45,000 by transaction date.

Boundary days will find you

Invoice B falls due on the cutoff itself and invoice C one day before. Under one common convention, B is current with zero days past due and C sits in the first overdue bucket. Move the boundary rule by a day and 15,000 changes bucket. Write down whether zero days past due counts as current, and whether 30 belongs to the 1 to 30 bucket or the next. Oracle’s report documentation defines Age as the number of days past due but leaves bucket conventions to the report you run, so test them on your own report using an invoice that lands on each edge.

Time zones are a smaller version of the same problem. A cutoff expressed as midnight in one place can move a document across a day in another. Dates on transactions are usually day-level, so this mainly bites when someone computes age from a timestamp in an external tool after extraction. Compute on the date as the source has it.

The transactions the report counts

Oracle’s description of the A/R Aging Detail report has a sentence worth reading twice: the report shows transactions based on the date they are closed, as opposed to the date they are applied, and this includes credit memos. When a payment dated after your cutoff closes an invoice, the report’s treatment turns on that closing date. A home-built version that subtracts every application it can see may disagree with it, and the disagreement will concentrate around cutoffs.

Several other documented behaviors will show up as variances. Entries listed under No Customer/Project are journal entries, so a query that only reads invoices and credit memos will miss them. Debit and credit journal entries against identical accounts for the same entity don’t appear, since they have no general ledger impact. With Consolidated Payments on, the report shows the un-consolidated balance for each subcustomer, and totals roll up the customer hierarchy. Each of those needs a line in your reconciliation.

  • Journal entriesManual A/R journals appear under No Customer/Project. Decide whether collections should see them, and don’t let them drop out unannounced.
  • Unapplied payments and creditsOracle’s Customer 360 definitions expose unapplied amounts from the accounting line field paymentAmountUnused, separate from amountUnpaid. A customer can have an old open invoice and a larger unapplied credit, and a queue built on invoices alone would chase them for money they have already sent.
  • SubcustomersAging by the parent customer and aging by the billed subcustomer give different rows and the same total. Pick one before ranking anyone by exposure.
  • CurrencyOpen amounts across subsidiaries need the conversion rules that apply to accounting lines. A total across currencies with no stated basis is unusable.

A query for today’s position, labeled as today’s

Oracle’s Customer 360 analytical record is a good template for receivables. Its ReceivablesLineLevel definition reads main lines with an entity, requires a posted accounting line on an accounts receivable account, restricts to the primary accounting book, and takes the due date from the transaction and the unpaid amount from the accounting line. The sketch below follows that shape. It answers one question well: what is open now, aged to a date you supply.

It cannot answer what was open on June 30. The unpaid amount reflects today’s state, so an invoice settled on July 2 shows zero and drops out of a June 30 picture, and the June 30 total comes out understated. To get a historical position, use the report’s as-of behavior if your report offers it, a saved snapshot taken at the time, or reconstruct from application history and accept the validation work that follows. A retained month-end snapshot is the cheapest of the three by far, and it needs to be started before the day someone asks.

-- Pass the cutoff, then the A/R account type value used in your account.
SELECT BUILTIN.DF(tl.entity) AS customer,
       t.tranid,
       t.type,
       t.duedate,
       tal.amountunpaid,
       tal.paymentamountunused,
       CASE
         WHEN t.duedate IS NULL THEN 'no due date'
         WHEN t.duedate >= TO_DATE(?, 'YYYY-MM-DD') THEN 'current'
         WHEN TO_DATE(?, 'YYYY-MM-DD') - t.duedate <= 30 THEN '1-30'
         WHEN TO_DATE(?, 'YYYY-MM-DD') - t.duedate <= 60 THEN '31-60'
         ELSE 'over 60'
       END AS bucket
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN transactionaccountingline tal
  ON tal.transaction = tl.transaction AND tal.transactionline = tl.id
WHERE tl.mainline = 'T'
  AND tl.entity IS NOT NULL
  AND tal.posting = 'T'
  AND tal.accounttype = ?;
-- Multi-Book accounts: also restrict to the primary accounting book.
-- This is a current position, and it should be labeled that way.

Can this tool answer the historical question

I’d put this decision in front of anyone asked to produce a past aging. Asking it first prevents the most common failure in this area, where a precise table for a past date turns out to be today’s balances filtered by old invoice dates.

In a sample test, include one invoice paid just after the cutoff. On a true historical aging it stays open at the cutoff. On a current-state query it disappears. That single row tells you which kind of answer you have, and it takes minutes to check.

Which date is theaging for?TodayCurrent queryLabel it as a current positionPast, snapshot keptUse the snapshotNote when it was takenPast, report hasas-ofUse report as referenceTest closed-date behaviorPast, neitherReconstruct or declineNever relabel current balancesWhich date is the aging for?TodayCurrent queryLabel it as a current positionPast, snapshot keptUse the snapshotNote when it was takenPast, report has as-ofUse report as referenceTest closed-date behaviorPast, neitherReconstruct or declineNever relabel current balances
A past aging needs past state. Label current-state answers plainly and decline a past date when no source can support it.

Evidence versus what to do about it

An aging tells you what is overdue. It says nothing about why, or about who should call whom. Dispute status, promises to pay and account relationships usually live elsewhere. Read any collection priority from an assistant as a suggestion built on data it can see, and check that it kept the observed balance separate from its reasoning.

The best receivables test for an AI analytics tool is a small one: one invoice on each boundary, one partial payment, one unapplied credit, one journal entry, and one invoice paid after the cutoff. Have collections write the expected bucket for each, then compare. Hold us to the same fixture, and see whether the answer says what it left out. The catalog at nexatron.io/connectors shows which systems can be brought to that test.

Bring three business questions

Explore your sources, definitions, and review criteria with our team. Please keep credentials and sensitive records out of the inquiry.