Mango Billing
Invoicing, collections, revenue recognition, commissions, and tax — the finance motion for the revenue stack.
MangoApps
Overview
Mango Billing owns the finance / AR surface for the revenue stack. AR aging dashboard, automated dunning sequences (day 7/14/30/45), ASC 606 revenue recognition with period close + GL export, tiered-accelerator commission plans with per-rep attainment tracking, Anrok tax integration, and an Ask AI agent for finance questions. Built on the existing Billing::* domain layer (Invoice, Subscription, Stripe, Refund, CreditTransaction). Replaces the sysadmin BillingInvoicesController + CustomerBillingController with a workflow-aware, tenant-scoped surface.
Highlights
Capabilities
Invoices & Collections
-
Invoice list + detail view (tenant-scoped)
-
Mark paid, void, write off, send reminder, download PDF
-
Manual invoice creation for non-Stripe billing
-
Stripe webhook sync (paid / failed / overdue)
-
AR aging dashboard with bucket breakdown
Dunning
-
Per-invoice DunningSequence state machine
-
Configurable cadence (default: day 7 / 14 / 30 / 45)
-
Hourly DunningAdvanceJob advances sequences past thresholds
-
Pause/resume a sequence (e.g., customer in dispute)
-
DunningEvent audit log per sequence transition
Revenue Recognition
-
RevenueSchedule per subscription / contracted invoice
-
Monthly RevenueScheduleEntry rows with period_start/period_end
-
Straight-line recognition across contract term
-
Period-close workflow (stamp recognized_at on entries)
-
Journal-entry CSV export for NetSuite / QuickBooks
Commissions
-
CommissionPlan with nested CommissionPlanTier rows per event type
-
Tiered accelerators (e.g., 8% to $500k, 12% above)
-
Per-rep CommissionAttainment quarterly rollups
-
Auto-fires on ProposalService#mark_won and RenewalProposalGenerator
-
Earnings approval + payout CSV export
Tax (Anrok)
-
Billing::Anrok::Client REST wrapper
-
AnrokSyncJob on invoice creation
-
TaxTransaction audit record per synced invoice
-
Jurisdiction liability summary view
AI Agent & Analytics
-
MangoBillingAgent answers finance questions via Ask AI
-
Tools: AR aging, search invoices, customer financial summary
-
Analytics: DSO, collection rate, aging detail (admin-only)
-
CSV export of invoices, earnings, and journal entries
Limits & Specs
-
Default payment terms: Net 30 (configurable)
-
Default dunning cadence: Day 7 / 14 / 30 / 45
-
Revenue recognition method: Straight-line, monthly
-
Tax provider: Anrok (optional)
-
Payment rail: Stripe (unchanged)
-
Allowed roles: Admin, Super Admin
Use cases
Resources
FAQ
Sysadmin billing is a platform-admin surface designed for MangoApps staff. Mango Billing is a workflow-aware tenant app: it adds dunning, revenue recognition, commissions, and tax on top of the same Billing::Invoice / Billing::Customer domain layer. The sysadmin surface is retired when Mango Billing ships.
No. Mango Billing reads the existing Billing::* tables in place — Invoice, Subscription, Customer, Refund, CreditTransaction, Event. New tables only back dunning, revenue recognition, and commissions; history stays where it is.
Turn off commissions_enabled in Settings. The rest of the app (invoices, dunning, RevRec, tax) still works, and commission plans and earnings stay hidden from the nav.
No. Tax is off by default. Flip tax_enabled and paste an Anrok API key to sync. Without Anrok, invoices still flow — finance can add tax manually on manual invoices.
No. Stripe remains the payment rail. Mango Billing sits on top of the existing Billing::StripeService + WebhookProcessor — webhook events keep updating local Billing::Invoice records as they always have. Mango Billing adds the workflow layers finance owns (dunning, close, commissions).