- Documentation
- /
- Sap Ap
- /
- 01 — Quick Reference
01 — Quick Reference
Purchase to pay
| Step | What happens | Who starts it |
|---|---|---|
| 1. Commitment | Every order Purchasing places is posted as a commitment with a SAP PO number; Purchasing records the number on the order (External ERP Reference). | automatic (purchasing.order_placed) |
| 2. Invoice | The supplier's invoice is registered; a second invoice with the same supplier and number is kept as a duplicate (exception) and can never be matched or posted. | finance.register_supplier_invoice |
| 3. Match | SAP AP asks Purchasing for the order and Inventory for its receipts, then compares each invoice line. | finance.run_invoice_match |
| 4. AP liability | Posted only from a matched match (and approved, where the policy requires it): AP document 51…, accounting entries. | finance.post_ap_liability |
| 5. Payment | Paid only with a posted liability; payment entries AP / bank. | finance.update_payment_status |
| 6. Job cost | A closed work order's cost moves from work in progress (180000) to its asset's cost centre and ledger account (the AssetCoding in force on the finish date), one line per cost type. No coding holds the posting for finance; finance.repost_held_work posts it once the asset is coded. One posting for the order at close; a cost that arrives later is a supplement (type supplement, dated the day it is recorded), so an order's postings add up to its cost. When a reopened order closes again, the difference (by cost type, possibly negative) is posted as an amendment; the first posting is never reversed. |
automatic (work.work_closed, work.late_cost_recorded) |
python networks/work_supply/trigger.py p2p runs steps 2–5 for PO-004411 on the live
network (after trigger.py r1c has delivered and accepted the transmission).
Match rules
Per invoice line, in this order:
| Result | When |
|---|---|
| manual_review | no order line matches the invoice line |
| receipt_missing | nothing received against the order line |
| acceptance_missing | goods received but none accepted yet — arrival is never enough |
| quantity_exception | invoiced more than accepted (two-way: ordered), beyond the quantity tolerance; or a partial receipt where the policy forbids it |
| price_exception | invoiced price differs from the order beyond the price tolerance |
| matched | otherwise |
Then the whole invoice: a total value variance beyond the policy's value tolerance is a value exception, even if every line matched. Each non-matched line opens a Match Exception. If goods of the order are later rejected or quarantined, matched but unposted matches go back to exception.
Numbers
| Record | Number | How |
|---|---|---|
| Purchase commitment | PC-000003 … |
assigned when posted |
| SAP PO | 4500881412 … |
continues the ERP series on the seeded orders |
| Invoice match | IM-00002 … |
assigned on save |
| Match exception | MX-00002 … |
assigned when opened |
| AP document | 5100000001 … |
assigned when posted (liabilities, payments, credit memos) |
| Credit memo document | 5200000001 … |
assigned when posted |
| Supplier invoice / credit memo | the supplier's own number | unique per supplier, not across suppliers |
Simulated accounts
| Posting | Debit | Credit |
|---|---|---|
| Invoice | 191100 GR/IR clearing (accepted value), 231000 price variance, 154000 GST | 160000 Accounts payable |
| Payment | 160000 Accounts payable | 113100 Bank |
| Credit memo | 160000 Accounts payable | 285000 Warranty / purchase recovery |
Everyday tasks
| To… | Do this |
|---|---|
| See what blocks an invoice | Matching → Match Exception (or the invoice's Invoice Match tab). |
| Approve a four-way match | Matching → Invoice Match → edit: Approved By / Approved At, then post. |
| Find the SAP number of a record | ERP Commitments → External Document Mapping. |
| See identifiers or every column | Column-set switcher on a list → All fields. |
Running it
python server/run.py sap_ap # alone, http://localhost:5093
python networks/work_supply/network.py start # with the whole Work & Supply network