Accounts Payable (AP)#
AP tracks what we owe suppliers and drives supplier payment. Invoices land here from PO receipts (three-way match), debit memos come from DMR, and payments are cut on a schedule based on terms.
Structure#
APMASTER— AP invoice / debit-memo header (supplier, dates, terms, amount, status).APDETAIL— line-level breakdown, GL account per line.APDMDetail— DMR-linked debit memo detail (ApDmDetlHelper).- AP aging is a snapshot / import (
ApAgingImport) with theApAgingImportControllerfor CSV load.
Three-way match#
- PO issued (see Purchase Orders).
- Receipt posts a received-not-invoiced accrual via
PoRecRelGLHelper. - Supplier invoice is entered —
ApMasterHelpermatches quantity / price against PO + receipt. - On match: the accrual reverses, AP liability posts, and any variance goes to a variance account per
ApSetupHelperdefaults.
Variances outside a configured tolerance route to buyer review.
Debit memos#
Raised from a DMR when material is returned or credit is owed for out-of-spec receipt. ApDmDetlHelper links the memo to the specific DMR and receipt lines so the audit trail is preserved.
Business rules#
- Terms drive due date (
PmtTerms). Discount date is computed from terms; taking a discount past the discount date is blocked unless overridden. - 1099 suppliers get 1099 tracking on each AP line — year-end reporting reads directly from AP.
- Invoice cannot be posted with any line missing a GL account.
- Reversing a posted AP invoice creates a reversing journal entry, not a delete.
Where it lives#
| Layer | File |
|---|---|
| Controller | AccountPayableController, ApAgingImportController |
| Helper | ApMasterHelper.cs, ApDetailHelper.cs, ApDmDetlHelper.cs, ApSetupHelper.cs, MnxEFModel/Helper/ApAgingImport/ |
| Related | Purchase Orders, Payments, GL |