Account Receivables - The Money Trail
Account Receivables (AR) is where Billerang tracks who owes you money, who paid, and how it all adds up in your books. If billing is the factory that produces invoices, AR is the warehouse that tracks every dollar until it's collected.
This guide explains the 7 key concepts that make AR work, using a real-world story: Sarah's SaaS company billing her customers.
The Cast of Characters
Before diving in, here's what you're about to meet:
| Concept | One-liner | Real-world analogy |
|---|---|---|
| Accounting Code | A labeled bucket for money | The "Revenue" or "Cash" jar on your shelf |
| Journal | A logbook of transactions | Your company's checkbook register |
| OCC Template | A recipe for recording transactions | A rubber stamp that says "apply this pattern" |
| Account Operation | An actual financial event | A specific invoice sent or payment received |
| Journal Entry | The double-entry bookkeeping line | The actual pen stroke in the ledger |
| Matching | Linking payments to invoices | Crossing off an invoice when the check clears |
| Accounting Scheme | Custom accounting rules (scripted) | A smart accountant who handles edge cases |
1. Accounting Codes - Your Chart of Accounts
An Accounting Code represents a single account in your general ledger (GL). Think of it as a labeled bucket where money flows in or out.
Real-World Example
Sarah's SaaS company has these accounting codes:
| Code | Name | Type | What goes here |
|---|---|---|---|
4110 | Accounts Receivable | ASSET | Money customers owe us |
7000 | SaaS Revenue | REVENUE | Money we earned |
7010 | Professional Services | REVENUE | Consulting revenue |
2110 | Sales Tax Collected | LIABILITY | Tax we collected for the government |
1000 | Bank Account | ASSET | Actual cash in the bank |
6500 | Bad Debt Expense | EXPENSE | Invoices we gave up collecting |
Key Properties
- Code: The GL account number (e.g.,
4110) - Description: Human-readable name
- Chart Type: ASSET, LIABILITY, EQUITY, REVENUE, or EXPENSE
- View Type: BALANCE_SHEET or INCOME_STATEMENT
- Parent Code: For hierarchical reporting (e.g.,
4110under4000 - Current Assets)
Why It Matters
Every financial transaction in Billerang ultimately lands in one or more Accounting Codes. They're the foundation of your financial reports.
2. Journals - The Logbooks
A Journal is a chronological logbook that groups related transactions. Instead of dumping everything into one giant log, you organize by type.
Real-World Example
Sarah uses three journals:
| Journal Code | Name | What it tracks |
|---|---|---|
SALES | Sales Journal | All invoice-related entries |
CASH | Cash Receipts | All incoming payments |
MISC | Miscellaneous | Adjustments, write-offs, manual entries |
Why Separate Journals?
Imagine your accountant needs to audit all payments received in March. With journals, they open the CASH journal and see only payment entries. Without journals, they'd wade through thousands of mixed entries.
Key Properties
- Code: Journal identifier (e.g.,
SALES) - Description: What this journal tracks
Journals are simple master data. Their power comes from organizing the Account Operations and Journal Entries that reference them.
3. OCC Templates - The Recipes
OCC stands for Other Credits and Charges. An OCC Template is a recipe that tells Billerang: "When this type of financial event happens, here's exactly how to record it in the books."
The Rubber Stamp Analogy
Think of an OCC Template as a rubber stamp. When Sarah's billing system creates an invoice, it grabs the "Invoice" stamp and applies it. That stamp says:
"Debit Accounts Receivable (4110), Credit Sales Revenue (7000), use the SALES journal."
Real-World Example
Sarah's company has these OCC Templates:
| Template Code | Category | Primary Account | Contra Account | Journal | Purpose |
|---|---|---|---|---|---|
INV_STANDARD | DEBIT | 4110 (AR) | 7000 (Revenue) | SALES | Standard invoices |
INV_NEGATIVE | CREDIT | 4110 (AR) | 7000 (Revenue) | SALES | Credit notes |
PAY_CHECK | CREDIT | 4110 (AR) | 1000 (Bank) | CASH | Check payments |
PAY_WIRE | CREDIT | 4110 (AR) | 1000 (Bank) | CASH | Wire transfers |
ADJ_WRITEOFF | CREDIT | 4110 (AR) | 6500 (Bad Debt) | MISC | Write-offs |
DUNNING_FEE | DEBIT | 4110 (AR) | 7500 (Late Fees) | MISC | Late payment charges |
The Three Accounting Codes
Each OCC Template can specify up to three GL accounts:
- Primary Accounting Code (
accountingCode): The main account affected. For invoices, this is typically AR (4110). - Contra Accounting Code (
contraAccountingCode): The offset account for double-entry. For invoices, this is Revenue (7000). - Contra Accounting Code 2 (
contraAccountingCode2): Optional second offset for taxes, commissions, etc.
How Double-Entry Works
Every OCC Template has a Category (DEBIT or CREDIT) that determines the direction:
Invoice Template (DEBIT category):
DEBIT 4110 Accounts Receivable $1,000 (primary code)
CREDIT 7000 Sales Revenue $1,000 (contra code)
Translation: "Customer owes us $1,000, and we earned $1,000 in revenue."
Payment Template (CREDIT category):
DEBIT 1000 Bank Account $1,000 (contra code)
CREDIT 4110 Accounts Receivable $1,000 (primary code)
Translation: "$1,000 arrived in the bank, and the customer no longer owes it."
Key Properties
- Code: Template identifier
- Category: DEBIT (increases AR) or CREDIT (decreases AR)
- Accounting Code: Primary GL account
- Contra Accounting Code: Offset GL account
- Contra Accounting Code 2: Secondary offset (taxes/commissions)
- Journal: Which logbook to write in
- Manual Creation Enabled: Can users create AOs manually with this template?
4. Account Operations - The Actual Events
An Account Operation (AO) is the actual financial event. If the OCC Template is the recipe, the Account Operation is the dish you cooked.
Types of Account Operations
Billerang uses single-table inheritance with a discriminator to distinguish types:
| Type | Discriminator | What it represents | Example |
|---|---|---|---|
| RecordedInvoice | I | An invoice posted to AR | Sarah sends a $500 invoice to Acme Corp |
| Payment | P | Money received | Acme Corp pays $500 by wire transfer |
| OtherCreditAndCharge | OCC | Manual adjustments | Sarah adds a $25 late fee to Acme's account |
| Refund | R | Money returned | Sarah refunds $100 for a service issue |
The Lifecycle of an Account Operation
Created (POSTED)
|
|-- Accounting period valid? --YES--> Journal Entries generated
| NO--> Status = REJECTED (CLOSED_PERIOD)
|
|-- Matching process runs
| |
| |-- Fully matched --> matchingStatus = L (Matched)
| |-- Partially matched --> matchingStatus = P
| |-- No match --> matchingStatus = O (Open)
| |-- Disputed --> matchingStatus = I (Litigation)
|
|-- Export to ERP/GL system --> Status = EXPORTED
Real-World Scenario: Acme Corp's Month
Let's follow Acme Corp through a month:
Day 1 - Invoice sent:
Account Operation #1001 (type=I, RecordedInvoice)
Customer Account: ACME_CORP
Amount: $5,000
Status: POSTED
Matching Status: O (Open - nobody paid yet)
Unmatching Amount: $5,000
Day 15 - Partial payment received:
Account Operation #1002 (type=P, Payment)
Customer Account: ACME_CORP
Amount: $3,000
Reference: "Wire transfer #TRF-2024-0315"
Status: POSTED
Matching Status: O (Open - not yet linked to invoice)
Day 15 - Matching runs (automatic or manual):
After matching #1001 and #1002:
AO #1001 (Invoice): matchingAmount=$3,000, unMatchingAmount=$2,000, matchingStatus=P
AO #1002 (Payment): matchingAmount=$3,000, unMatchingAmount=$0, matchingStatus=L
Day 25 - Late fee added:
Account Operation #1003 (type=OCC)
Customer Account: ACME_CORP
OCC Template: DUNNING_FEE
Amount: $50
Status: POSTED
Matching Status: O (Open)
Day 30 - Final payment:
Account Operation #1004 (type=P, Payment)
Customer Account: ACME_CORP
Amount: $2,050 (remaining $2,000 + $50 late fee)
After matching: All AOs are now fully matched (status L). The customer's balance is zero.
Key Fields
| Field | What it means |
|---|---|
amount | Total amount in functional currency |
matchingAmount | How much has been matched against other AOs |
unMatchingAmount | How much is still open (amount - matchingAmount) |
matchingStatus | O=Open, L=Matched, P=Partial, I=Litigation, C=Closed |
status | POSTED, REJECTED, EXPORTED, CLOSED |
dueDate | When payment is expected |
transactionDate | When the event actually happened |
customerAccount | Which customer this belongs to |
5. Journal Entries - The Bookkeeping Lines
A Journal Entry is the actual line written in the accounting ledger. When an Account Operation is created, Billerang automatically generates Journal Entries based on the OCC Template's accounting rules.
The Double-Entry Magic
For every Account Operation, Billerang creates at least two Journal Entries (debits must equal credits):
When Sarah's $5,000 invoice to Acme is posted:
| # | Direction | Account | Amount | Journal | Description |
|---|---|---|---|---|---|
| 1 | DEBIT | 4110 - Accounts Receivable | $5,000 | SALES | Acme owes us |
| 2 | CREDIT | 7000 - SaaS Revenue | $4,500 | SALES | Revenue earned |
| 3 | CREDIT | 2110 - Sales Tax | $500 | SALES | Tax collected |
When Acme's $5,000 payment arrives:
| # | Direction | Account | Amount | Journal | Description |
|---|---|---|---|---|---|
| 1 | DEBIT | 1000 - Bank Account | $5,000 | CASH | Cash received |
| 2 | CREDIT | 4110 - Accounts Receivable | $5,000 | CASH | Acme no longer owes |
Key Properties
- Direction: DEBIT or CREDIT
- Account: The GL account (Accounting Code)
- Amount: The entry amount
- Journal Code: Which journal this belongs to
- Account Operation: The AO that triggered this entry
- Supporting Document: The invoice or payment reference
- Matching Code: Links to the reconciliation (filled when matched)
- Analytic Codes: Cost center/department codes for management reporting
When Are They Generated?
Journal Entries are created automatically:
- Invoice validation -
createFromInvoice()generates AR + Revenue + Tax entries - Payment recording -
createFromPayment()generates Bank + AR reversal entries - OCC creation -
createFromAccountOperation()generates primary + contra entries
They are NOT generated if:
- The accounting period for the operation date is closed (AO gets rejected)
- The AO status is not POSTED
6. Matching - Connecting the Dots
Matching is the process of linking payments to the invoices they pay. In accounting terms, this is called reconciliation or lettrage (French accounting term used in the code as status L).
How It Works: A Play in Three Acts
Act 1: The Setup
AO #1001 (Invoice) - Amount: $1,000 - Open ($1,000 unmatched)
AO #1002 (Payment) - Amount: $1,000 - Open ($1,000 unmatched)
Act 2: The Match
When a user (or the system automatically) matches these two:
- A MatchingCode is created (e.g.,
MC-2024-001) - Two MatchingAmount records link each AO to the MatchingCode
- Both AOs update their
matchingAmountandunMatchingAmount
Act 3: The Result
MatchingCode MC-2024-001:
Total Debits: $1,000
Total Credits: $1,000
AO #1001 (Invoice): matchingStatus=L, matchingAmount=$1,000, unMatchingAmount=$0
AO #1002 (Payment): matchingStatus=L, matchingAmount=$1,000, unMatchingAmount=$0
Invoice: paymentStatus = PAID
Partial Matching
What if Acme only pays $600 of a $1,000 invoice?
After partial matching:
AO #1001 (Invoice): matchingStatus=P, matchingAmount=$600, unMatchingAmount=$400
AO #1002 (Payment): matchingStatus=L, matchingAmount=$600, unMatchingAmount=$0
Invoice: paymentStatus = PPAID (Partially Paid)
The remaining $400 stays open until another payment comes in.
Matching Status Reference
| Code | Label | Meaning |
|---|---|---|
O | Open | Not matched to anything yet |
L | Matched (Lettree) | Fully reconciled |
P | Partial | Partially matched, balance remaining |
C | Closed | Administratively closed |
I | Litigation | Under dispute, matching blocked |
R | Rejected | Matching was rejected |
Unmatching
Made a mistake? Billerang supports unmatching too. This creates an UnMatchingCode record and reverses all the matching amounts, putting the AOs back to their previous state.
7. Accounting Scheme - The Custom Rules Engine
An Accounting Scheme is an optional extensibility mechanism for when the standard OCC Template rules aren't enough. It contains a script (Groovy or JavaScript) that can dynamically determine accounting codes, journals, or other posting rules.
When Do You Need It?
Most companies never need Accounting Schemes. They're for edge cases like:
- Different GL codes based on customer country
- Dynamic tax code selection based on product + region
- Revenue recognition rules that depend on contract type
- Multi-entity accounting where the posting target depends on the seller
How It Works
- Create an Accounting Scheme with a ScriptInstance
- Link it to an OCC Template
- When the OCC Template is used, the script runs and can override:
- Which accounting codes to use
- Which journal to post to
- How amounts are split
Think of it as: "The OCC Template is the standard recipe, and the Accounting Scheme is the chef who can improvise when needed."
Putting It All Together: The Complete Flow
Here's the full journey of a $10,000 invoice for Acme Corp:
1. BILLING CYCLE RUNS
Billerang generates Invoice #INV-2024-001 for Acme Corp ($10,000)
2. INVOICE VALIDATION
System selects OCC Template "INV_STANDARD" based on invoice type
3. ACCOUNT OPERATION CREATED
RecordedInvoice AO #5001 created:
- Amount: $10,000
- Customer: ACME_CORP
- Status: POSTED
- Matching Status: O (Open)
4. JOURNAL ENTRIES GENERATED
JE #1: DEBIT 4110 AR $10,000 (SALES journal)
JE #2: CREDIT 7000 Revenue $9,000 (SALES journal)
JE #3: CREDIT 2110 Sales Tax $1,000 (SALES journal)
5. ACME PAYS $10,000 (15 days later)
Payment AO #5002 created:
- Amount: $10,000
- Reference: "Wire TRF-123"
- Status: POSTED
6. PAYMENT JOURNAL ENTRIES
JE #4: DEBIT 1000 Bank $10,000 (CASH journal)
JE #5: CREDIT 4110 AR $10,000 (CASH journal)
7. MATCHING
MatchingCode MC-001 links AO #5001 and AO #5002
Both marked as MATCHED (L)
Invoice paymentStatus: PAID
8. ACCOUNTING EXPORT
All Journal Entries exported to ERP
AOs marked as EXPORTED
The Balance Sheet Impact
After this complete cycle:
- AR (4110): +$10,000 (invoice) - $10,000 (payment) = $0 (settled)
- Revenue (7000): +$9,000
- Tax (2110): +$1,000
- Bank (1000): +$10,000
Everything balances. That's the beauty of double-entry bookkeeping.
Quick Reference: Where to Find Things in Billerang
| What | Where in the UI |
|---|---|
| View/create Account Operations | Sidebar > Account Receivables > Account Operations |
| Configure OCC Templates | Setup > Billing section > OCC Templates |
| View matching details | Account Operation detail page > Matching Amounts card |
Glossary
| Term | Definition |
|---|---|
| AR | Accounts Receivable - money owed to you by customers |
| GL | General Ledger - the master accounting record |
| OCC | Other Credits and Charges - manual adjustments |
| Matching / Lettrage | Linking payments to invoices |
| Contra Account | The offset account in double-entry bookkeeping |
| Functional Currency | Your company's reporting currency |
| Transactional Currency | The currency the customer actually paid in |
| Accounting Period | A time window (usually monthly) that can be open or closed for posting |