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 the ApAgingImportController for CSV load.

Three-way match#

  1. PO issued (see Purchase Orders).
  2. Receipt posts a received-not-invoiced accrual via PoRecRelGLHelper.
  3. Supplier invoice is entered — ApMasterHelper matches quantity / price against PO + receipt.
  4. On match: the accrual reverses, AP liability posts, and any variance goes to a variance account per ApSetupHelper defaults.

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#

LayerFile
ControllerAccountPayableController, ApAgingImportController
HelperApMasterHelper.cs, ApDetailHelper.cs, ApDmDetlHelper.cs, ApSetupHelper.cs, MnxEFModel/Helper/ApAgingImport/
RelatedPurchase Orders, Payments, GL