AR Collections & Aging Analysis pipeline for QBO clients. Produces a 7-tab Excel workbook with AR aging buckets (Current/1-30/31-60/61-90/90+), DSO, collecti...
Runs the AR Collections & Aging Analysis pipeline ( scripts/pipelines/ar-collections.py) to produce a controller-level accounts receivable workbook from QBO data.
Produces:
Use when:
Do NOT use when:
The pipeline automatically checks the client SOP before pulling any data:
sb-paulson → exits gracefully with explanation (POS collection, no AR)To add a new client's AR status, update CLIENT_AR_CONFIG in the pipeline, OR add these markers to their clients/{slug}/sop.md:
text
**AR Aging:** ❌ Not applicable (POS collection)
bash
# Standard run — as of end of month
python3 scripts/pipelines/ar-collections.py --slug <client-slug> --as-of 2026-03-31
# With custom output directory
python3 scripts/pipelines/ar-collections.py --slug <client-slug> --as-of 2026-03-31 --out ~/Desktop/reports
# Skip GL pull (faster, no payment pattern analysis)
python3 scripts/pipelines/ar-collections.py --slug <client-slug> --as-of 2026-03-31 --skip-gl
# QBO sandbox
python3 scripts/pipelines/ar-collections.py --slug <client-slug> --as-of 2026-03-31 --sandbox
# Client with no AR — exits gracefully
python3 scripts/pipelines/ar-collections.py --slug sb-paulson --as-of 2026-03-31
Default location: reports/ar-collections/ar-collections_{slug}_{as-of}.xlsx
Tabs:
TabContentsAR SummaryAging snapshot by bucket, key metrics, concentration riskAging DetailInvoice-level list: customer, date, due date, balance, bucketCollection PrioritySorted action list: HIGH/MEDIUM/LOW/MONITOR with recommended actionsPayment PatternsAvg days to pay per customer, vs. terms, reliability ratingBad Debt ReservePercentage-of-aging reserve calc + suggested journal entryDSO AnalysisCurrent and rolling 3-month DSO, monthly revenue detailCDC LogChanges since last run: improved / deteriorated / new / cleared
PriorityCriteriaRecommended ActionHIGH90+ days past due OR balance > $5KEscalate / demand letter / write-off reviewMEDIUM61-90 days OR balance > $2.5KFollow-up callLOW31-60 daysSend email reminderMONITORCurrent or 1-30 daysStandard review next cycle
BucketRateCurrent1%1-303%31-6010%61-9025%90+50%
Cached at: .cache/ar-collections/{slug}.json
Each run saves customer balances and worst buckets. Next run computes:
bash
pip install openpyxl
# Node.js QBO client must be auth'd
node bin/qbo info {slug} # from your QBO integration directory
pl-deep-analysis.py — GL drill-down, P&L variance, accrual proposalsclient-dashboard.py — KPI dashboard (includes DSO as a KPI)bank-reconciliation.py — Bank rec (not AR-specific)budget-vs-actual.py — BvA (revenue-side context for AR)Configure AR applicability per client in CLIENT_AR_CONFIG or via clients/{slug}/sop.md.