Sample output from the Duplicate Payment & Credit Recovery Ledger prompt in the Sonar AI Prompt Library, run against a NetSuite test account. Every name and number here is test data. Back to the post · The library
TD3016323  ·  Commercial Analytics  ·  Vol. IV

Duplicate Payment & Credit Recovery Ledger
Paid Twice, Credited Never — The Full Evidence Chain

Duplicate-obligation hunt across bill numbers, subsidiaries, and supplier records — plus a complete trace of every credit agreed, return made, and refund owed, flagging what was never received or never applied. One recoverable ledger, every item evidenced.
ANALYSIS WINDOW: SEP 2024 – AUG 2026  ·  PREPARED: AUG 26, 2026  ·  SOURCE: NETSUITE PRODUCTION (SUITEQL, LINE LEVEL)  ·  COMPANION TO VOL. III
1,017
Vendor bills tested for duplication
$3.40M · 5 detection passes
0
Confirmed duplicate payments
13 candidate pairs, all cleared by PO chain
$33,700
Near-miss double payment —
caught by void, evidence preserved
$369.88
Open recovery ledger: credits
never received or never applied

01Executive Summary

Five detection passes hunted the same obligation paid twice: same-vendor amount/date collisions, cross-vendor collisions (re-onboarded supplier records), cross-subsidiary collisions, bills carrying more than one payment, and vendor-master duplicate records. The verdict: zero confirmed duplicate payments in $3.40M of vendor billing. Thirteen candidate pairs matched on vendor + amount + date proximity — every one dissolved under the evidence chain: each bill traces to its own purchase order with its own item receipt. What looked like duplicates is a business that orders identical replenishment baskets on rhythm (the currency axis collapses by configuration: this is a single-currency USD instance, verified).

The hunt still produced two things worth money and attention. First, a $33,700 near-miss: bill VB05 (Generation N) briefly carried two $33,700 payments — the original was voided the same day the replacement posted. The control worked; the evidence chain (kept in §03) shows exactly what a real duplicate will look like when one eventually survives. Second, the credit-side trace found a live recovery ledger of $369.88: a supplier credit agreed 54 days ago and never issued, a credit received but never applied to any bill, an unapplied credit tied to the Vol. III anomaly, and a paid vendor prepayment awaiting offset. Small dollars — but each is a process leak, and one of them connects directly to the VB397 investigation.

Honest scale statement
This account's P2P controls are strong: 99.6% PO linkage (Vol. III), disciplined three-way matching, and a void process that caught its one double-payment attempt. The recoverable ledger is correspondingly small. The value of this exercise is the verdict, the evidence-chain method, and five standing detectors that will catch the first real duplicate on the day it posts — not a windfall.
Contents
02 — Duplicate Hunt: Five Passes, Full Results 03 — The Near-Miss: Anatomy of a Caught Double Payment 04 — Credits, Returns & Rebates: The Full Trace 05 — The Recoverable Ledger (Evidence Chains) 06 — Recommendations 07 — Methodology, Assumptions & Data Quality 08 — Appendix: Source Queries (Standing Detectors)

02Duplicate Hunt: Five Passes, Full Results

PassHunts forCandidatesConfirmedVerdict
P1 — Same vendor, same amount, ±5 daysClassic re-keyed bill13 pairs0CLEARED BY PO CHAIN
P2 — Different vendor records, same amount, ±3 daysRe-onboarded supplier duplicates2 pairs0DIFFERENT GOODS
P3 — Same vendor, same amount, different subsidiary, ±10 daysCross-entity double entry00CLEAN
P4 — One bill, multiple paymentsSame obligation paid twice1 (VB05)0NEAR-MISS — VOIDED
P5 — Vendor-master duplicate recordsSame supplier onboarded twice1 pattern0 with billsHYGIENE FLAG

Why the 13 same-vendor pairs cleared

Every candidate pair traces to two distinct purchase orders, each with its own item receipt — the goods arrived twice because they were ordered twice, deliberately. The clearest proof: Health & Beauty Supplies shows four $310.00 pairs spread across two years (Sep 2024, Mar 2025, Oct 2025, Apr 2026). Those are two different standing baskets — a body-care basket (PO791 lineage) and a cosmetics basket (PO985 lineage) — that both happen to total $310.00 and re-order on the same ~6-month rhythm. Same-amount collision, entirely different goods.

Candidate pairVendorAmountEvidence that cleared it
Bills of Aug 9 + Aug 10, 2026Broyhill$2,780.00PO1141 + PO1142 — identical 13-line furniture baskets, separate receipts; sequential store replenishment CONFIRM CADENCE
Bills of Jul 9 + Jul 14, 2026Broyhill$2,780.00PO1125 + PO1130 — same pattern, 5 days apart, separate receipts
Bills of Apr 12 + Apr 12, 2026Hestra$2,600.00PO908 + PO911 — same day, but different size/color quantity mixes (40 units each); separate receipts
Bills of Jul 3 + Jul 6, 2026Core4Solutions$1,758.00PO1195 + PO1196 — distinct POs, separate receipts (PCB materials)
4 × $310.00 pairs, 2024–2026Health & Beauty$310.00Two different standing baskets that coincidentally total $310; line detail differs entirely
4 further pairs, $114–$785Various—All: distinct POs, distinct receipts, line-level differences
P2's two cross-vendor hits were coincidences (a $1,500 Crown Equipment chair vs. five $300 Bedline box springs; a $1,000 Well jacket order vs. a Flexsteel interco allocation). P5's pattern: 18 inactive "Tax Agency XX" vendor records shadowed by 18 active "XX Department of Revenue" records — a deliberate migration, not risky duplication (zero bills on the old records), but the vendor file should retire them formally.

03The Near-Miss: Anatomy of a Caught Double Payment

Finding A — VB05: two $33,700 payments, one voided (control worked)
Bill VB05 (id 26767) · Generation N · Jan 31, 2026 · $33,700 · one of the off-PO bills VB01–VB08 flagged in Vol. III → Payment 00000005/1-12102024-181841 (id 41132) · Feb 1, 2026 · $33,700 · applied to VB05 · STATUS: VOIDED · memo "Demo Ex" → Payment 00000005/1 (id 41135) · Feb 1, 2026 · $33,700 · applied to VB05 · ACTIVE → VB05 today: status Paid In Full, unpaid $0.00 — exactly one live payment stands.

Both payments were created the same day against the same bill; the duplicate was voided rather than deleted, preserving the audit trail. No recovery is due. This is retained in the ledger as the reference specimen: the P4 detector (§08, Q4) exists precisely because next time the void step might not happen — and it is also the second time the off-PO bill family from Vol. III appears at the center of a payment-control event.

04Credits, Returns & Rebates: The Full Trace

Every credit-side instrument in the account, traced end-to-end: vendor return authorizations (returns made), bill credits (credits agreed), vendor prepayments, and refund checks. No rebate program exists in this account (no rebate items, accruals, or credit memos referencing rebates) — stated as a scope boundary, not silently skipped.

InstrumentVendorAmountDateStatus (NS)Trace Result
VRMA21 return authGeneration N$149.95Jul 3, 2026Pending CreditCREDIT NEVER RECEIVED — 54 days
VRMA20 return auth → bill creditGeneration N$89.97Jul 16, 2026Credited / credit openRECEIVED, NEVER APPLIED to any bill
Bill credit 4433911592582809Generation N$29.99Aug 24, 2026OpenUNAPPLIED — and tied to the VB397 case
Vendor prepayment 354Generation N$99.97Aug 24, 2026PaidCASH OUT — NOT YET OFFSET against a bill
VRMA22 return authGeneration N$119.96Aug 2, 2026Pending ReturnPIPELINE — goods not yet shipped back
VRMA23 return authGeneration N$29.99Aug 10, 2026Pending ApprovalPIPELINE — approve or cancel
Check 363 (refund in)—$29.99Aug 24, 2026PostedSame-day, same-amount counterpart of the credit above — see §05 item 3
Every credit-side instrument in this account belongs to ONE vendor: Generation N — the same vendor behind the off-PO bill channel (Vol. III), the VB397 anomaly, and the VB05 near-miss. The returns process with this supplier is demonstrably leaky at every stage: agreed credits arrive late or never, and credits that do arrive sit unapplied.
The Credit Pipeline — where each instrument is stuck
RETURN AUTHORIZED GOODS RETURNED CREDIT RECEIVED APPLIED / RECOVERED VRMA23 · $29.99 VRMA22 · $119.96 VRMA21 · $149.95 54 DAYS VRMA20 · $89.97 Credit ···2809 · $29.99 ← owed ← apply ← resolve
Red = money stopped short of recovery. VRMA21's credit has been owed for 54 days; VRMA20's credit exists in the system but reduces no bill; credit ···2809 is unapplied and entangled with the VB397 investigation. Gray = pipeline items not yet claims.

05The Recoverable Ledger

#ItemAmountAction to RecoverEvidence Chain
1Credit agreed, never received
VRMA21 · Generation N
$149.95Demand bill credit from vendor; 54 days outstandingVRMA21 (id 40426, Jul 3) status Pending Credit → goods returned (memo "DIG - R2D") → no VendCred references it → credit owed
2Credit received, never applied
VRMA20 credit · Generation N
$89.97Apply against next Generation N bill (AP action, 5 minutes)VRMA20 auth (id 40423) status Credited → VendCred (id 40425, Jul 16) exists, open → applied-to-bills = $0.00 → sits idle while new bills are paid gross
3Unapplied credit — VB397-linked
Credit ···2809 · Generation N
$29.99Resolve within the VB397 investigation; apply or match to refund check 363VendCred id 27973 (Aug 24) tranid = 4433911592582809 — the same card-formatted string in VB397's memo (Vol. III) → same-day Check 363 for $29.99 → neither applied to any bill → untangle as one case
4Prepayment paid, not offset
VPrep 354 · Generation N
$99.97Apply against open Generation N bills or claw backVPrep id 27963 (Aug 24) status Paid → $99.97 cash out → no application lines to any bill → vendor holds the cash
5Pipeline: VRMA22 (return not shipped)($119.96)Ship the return or cancel the authorizationId 40427, Aug 2, status Pending Return — becomes item-1-style leakage if it stalls
6Pipeline: VRMA23 (awaiting approval)($29.99)Approve or reject — 16 days in queueId 40429, Aug 10, status Pending Approval
Recoverable now (items 1–4)$369.88+ $149.95 pipeline at risk (items 5–6) · + $2,984.52 VB397 claim already open in Vol. III
Ledger construction: an item enters only with a full transaction-id chain and a specific recovery action. Items 1–4 are actionable today. The Vol. III VB397 claim ($2,984.52) is cross-referenced, not double-counted — combined open recovery across both reports: $3,354.40, all of it involving Generation N.
The pattern that matters more than the dollars
Every entry in this ledger — the near-miss, all four recoverables, both pipeline items, and Vol. III's $2,984.52 anomaly — involves one supplier: Generation N. Individually each item is small; together they describe a vendor relationship transacting outside the account's otherwise excellent controls: off-PO bills, a voided double payment, returns that don't convert to credits, credits that don't get applied, and one wrong bill 285× reference price. This vendor file deserves a focused review, not item-by-item whack-a-mole.

06Recommendations

  1. Work the four-line ledger this week. Apply the two idle credits ($119.96 combined — minutes of AP work), demand the VRMA21 credit ($149.95, 54 days overdue), and offset or recover the $99.97 prepayment. Total: $369.88.
  2. Run a single consolidated Generation N review. Fold in the open VB397 claim ($2,984.52), this ledger, the off-PO channel ($373K exposure, Vol. III), and the near-miss. One meeting, one vendor, every exhibit already evidenced across Vols. III–IV.
  3. Install the five duplicate detectors (§08) as monthly controls. Today they return zero confirmed duplicates — that is the baseline. Q4 (multi-payment) is the one that catches a VB05-style event if the void step is ever missed.
  4. Add a credit-aging control. The gap this report exposes is not duplicates — it is credit latency: nothing in the current process notices a Pending Credit at 54 days or an unapplied credit at 41 days. Q6 ages every open credit instrument; anything > 30 days goes on the AP huddle agenda.
  5. Retire the 18 inactive "Tax Agency" vendor shells superseded by the Department-of-Revenue records — zero transactions, pure file hygiene, and it keeps P5's re-onboarding detector signal clean.
  6. Do not buy a recovery-audit service on this evidence. Two years, $3.4M billed, zero surviving duplicates: the classic contingency-fee recovery pitch has nothing to find here. The leaks are credit-side and vendor-specific — fix the process, keep the detectors.

07Methodology, Assumptions & Data Quality

Method

Duplicates: five passes over all 1,017 VendBills — (P1) same vendor + |Δamount| < $0.005 + ≤5 days; (P2) different vendors, same amount, ≤3 days, ≥$500; (P3) same vendor + amount, different subsidiary (via mainline transactionline.subsidiary), ≤10 days; (P4) bills with >1 non-void payment or applied total > bill total (payment links via transactionline.createdfrom on VendPymt lines); (P5) vendor-master scan on normalized name/email. Candidates cleared only by evidence: distinct POs with distinct item receipts and line-level differences — never by assumption. Credits: full census of VendAuth, VendCred, VPrep, Check; each traced from authorization → credit issuance → application lines → residual, with NetSuite display statuses decoded (VendAuth: A=Pending Approval, B=Pending Return, F=Pending Credit, G=Credited).

Assumptions & boundaries

(1) Single currency (USD, verified) — the cross-currency duplicate axis is structurally empty in this account; the P1–P3 queries carry the FX variant in comments for multi-currency instances. (2) No rebate program exists in the account (no rebate items/accruals found) — "rebates earned" is out of scope by absence, stated rather than skipped. (3) Amount-tolerance $0.005 and date windows (5/3/10 days) are the detection envelope; widening them found no additional candidates at 2× windows. (4) The Broyhill PO1141/PO1142 identical-basket pattern cleared on separate receipts but is flagged to confirm the ordering cadence with purchasing — near-identical POs a day apart is also what a re-keyed PO looks like. (5) One SuiteQL artifact handled: payment-application joins fan out across payment lines; per-payment dedup (COUNT DISTINCT payment id, MAX not SUM per doc) prevents false "overpaid" hits — the naive join showed VB01 "paid $341K" until deduped to its single payment.

Data quality

(i) A bill credit's tranid is a 16-digit card-formatted number — same string as VB397's memo; both belong to the same case file and the number should be redacted from both records. (ii) The voided payment retains its full application trail — good void hygiene worth keeping. (iii) 18 inactive Tax Agency vendor shells (see Rec. 05). (iv) All credit instruments cluster in Jul–Aug 2026, suggesting the returns process is newly in use — early enough to fix its latency before volume grows.

08Appendix: Source Queries (Standing Detectors)

Q1 — P1: Same-vendor duplicate candidates (amount + date collision)
SELECT b1.id, b1.tranid, b2.id, b2.tranid, v.companyname,
       TO_CHAR(b1.trandate,'YYYY-MM-DD') AS date1, TO_CHAR(b2.trandate,'YYYY-MM-DD') AS date2,
       ROUND(ABS(b1.foreigntotal),2) AS amount, b1.status, b2.status
FROM transaction b1
JOIN transaction b2 ON b2.entity = b1.entity AND b2.id > b1.id
  AND ABS(b2.foreigntotal - b1.foreigntotal) < 0.005
  AND ABS(b2.trandate - b1.trandate) <= 5
JOIN vendor v ON v.id = b1.entity
WHERE b1.type = 'VendBill' AND b2.type = 'VendBill' AND ABS(b1.foreigntotal) >= 100
ORDER BY ABS(b1.foreigntotal) DESC
-- Clear candidates ONLY via the PO chain: each bill's createdfrom → distinct PO → own ItemRcpt.
-- Multi-currency instances: compare on base-currency totals or join currency and match per-pair.
Q2 — P2/P5: Cross-vendor collisions & vendor-master duplicate scan
-- P2: same amount, different vendor records, tight date window (re-onboarded supplier signature)
SELECT b1.id, v1.companyname, b2.id, v2.companyname,
       TO_CHAR(b1.trandate,'YYYY-MM-DD') AS d1, TO_CHAR(b2.trandate,'YYYY-MM-DD') AS d2,
       ROUND(ABS(b1.foreigntotal),2) AS amount
FROM transaction b1
JOIN transaction b2 ON b2.entity <> b1.entity AND b2.id > b1.id
  AND ABS(b2.foreigntotal - b1.foreigntotal) < 0.005 AND ABS(b2.trandate - b1.trandate) <= 3
JOIN vendor v1 ON v1.id = b1.entity
JOIN vendor v2 ON v2.id = b2.entity
WHERE b1.type = 'VendBill' AND b2.type = 'VendBill' AND ABS(b1.foreigntotal) >= 500

-- P5: vendor-master audit — names, emails, created dates, bill counts; eyeball near-matches
SELECT v.id, v.entityid, v.companyname, v.email, v.isinactive,
       (SELECT COUNT(*) FROM transaction t WHERE t.entity = v.id AND t.type='VendBill') AS bills
FROM vendor v ORDER BY UPPER(COALESCE(v.companyname, v.entityid))
Q3 — P3: Cross-subsidiary duplicate scan
SELECT v.companyname, b1.id, tl1.subsidiary AS sub1, b2.id, tl2.subsidiary AS sub2,
       ROUND(ABS(b1.foreigntotal),2) AS amount, ABS(b2.trandate - b1.trandate) AS days_apart
FROM transaction b1
JOIN transactionline tl1 ON tl1.transaction = b1.id AND tl1.mainline='T'
JOIN transaction b2 ON b2.entity = b1.entity AND b2.id > b1.id
  AND ABS(b2.foreigntotal - b1.foreigntotal) < 0.005 AND ABS(b2.trandate - b1.trandate) <= 10
JOIN transactionline tl2 ON tl2.transaction = b2.id AND tl2.mainline='T'
  AND tl2.subsidiary <> tl1.subsidiary
JOIN vendor v ON v.id = b1.entity
WHERE b1.type='VendBill' AND b2.type='VendBill'
-- transaction.subsidiary is NOT_EXPOSED in this account; the mainline line carries it.
Q4 — P4: Bills carrying multiple payments (the one that catches a live double-pay)
SELECT b.id, b.tranid, v.companyname, ROUND(ABS(b.foreigntotal),2) AS bill_total,
       COUNT(DISTINCT p.id) AS payment_count
FROM transaction b
JOIN vendor v ON v.id = b.entity
JOIN transactionline ptl ON ptl.createdfrom = b.id
JOIN transaction p ON p.id = ptl.transaction AND p.type = 'VendPymt' AND p.status <> 'V'
WHERE b.type = 'VendBill'
GROUP BY b.id, b.tranid, v.companyname, b.foreigntotal
HAVING COUNT(DISTINCT p.id) > 1
-- CRITICAL: count DISTINCT payment ids — the line join fans out and a naive SUM of line
-- amounts reports fictitious overpayment. Exclude voided (status 'V') payments, but ALSO run
-- WITH voids included to find near-misses like VB05 (two payments, one voided).
Q5 — Credit-instrument census & application trace
-- Census: every credit-side instrument and its NS status
SELECT t.id, t.tranid, t.type, t.status, BUILTIN.DF(t.status) AS status_name,
       TO_CHAR(t.trandate,'YYYY-MM-DD') AS dt, v.companyname,
       ROUND(t.foreigntotal,2) AS total
FROM transaction t
LEFT JOIN vendor v ON v.id = t.entity
WHERE t.type IN ('VendAuth','VendCred','VPrep','Check')
ORDER BY t.trandate
-- Application trace per credit: which bills (if any) it reduces
SELECT c.id, c.tranid, ROUND(c.foreigntotal,2) AS credit_total,
       ROUND(SUM(CASE WHEN app.type='VendBill' THEN ABS(ctl.foreignamount) ELSE 0 END),2) AS applied
FROM transaction c
LEFT JOIN transactionline ctl ON ctl.transaction = c.id AND ctl.createdfrom IS NOT NULL
LEFT JOIN transaction app ON app.id = ctl.createdfrom
WHERE c.type = 'VendCred'
GROUP BY c.id, c.tranid, c.foreigntotal
-- applied = 0 on an open credit → "received, never applied" ledger item.
-- VendAuth status letters here: A=Pending Approval, B=Pending Return, F=Pending Credit, G=Credited.
Q6 — Credit-aging control (Rec. 04 — run monthly)
SELECT t.type, t.tranid, v.companyname, ROUND(ABS(t.foreigntotal),2) AS amount,
       BUILTIN.DF(t.status) AS status_name,
       TRUNC(SYSDATE) - TRUNC(t.trandate) AS age_days
FROM transaction t
LEFT JOIN vendor v ON v.id = t.entity
WHERE (t.type = 'VendAuth' AND t.status IN ('A','B','F'))   -- stuck before credit
   OR (t.type = 'VendCred' AND t.status = 'Y')              -- credit open/unapplied
   OR (t.type = 'VPrep'    AND t.status = 'B')              -- prepayment paid, not offset
ORDER BY age_days DESC
-- Anything over 30 days = AP huddle agenda. Current hits: VRMA21 (54d), VRMA20 credit (41d),
-- credit ···2809 (2d), VPrep 354 (2d), VRMA22 (24d), VRMA23 (16d).
DISCLAIMERS & LIMITATIONS. Duplicate detection tested amount/date/entity collisions within stated windows and tolerances; duplicates engineered to differ in amount (split bills, altered totals) require line-fingerprint matching beyond this scope. Candidate clearance relies on PO-and-receipt lineage via transactionline.createdfrom; bills outside that lineage (0.4% of lines, Vol. III) cannot be cleared the same way and were individually reviewed. Single-currency instance: cross-currency duplication is structurally excluded here; queries carry multi-currency adaptations in comments. No rebate program exists in the account — rebate tracking is out of scope by absence. Credit statuses decoded from live BUILTIN.DF values. The Generation N pattern observation is evidence-based but intent is not concluded — items are process findings pending vendor review. Prepared by Sonar AI from NetSuite production data, account TD3016323, Aug 26, 2026. Figures rounded.
TD3016323 · COMMERCIAL ANALYTICS · SONAR AI