Deep Dive: Allocations and Matching
Introduction
Allocations, often referred to as "matching," are a fundamental part of Zudello's Procure-to-Pay (P2P) automation. This process involves linking related documents together, most commonly Purchase Invoices (PI) with Purchase Orders (PO) and Goods Receipts (GR). Effective matching ensures accuracy, enforces compliance (preventing payment for unordered or unreceived goods), and streamlines the approval process.
Zudello's Enrichment Engine handles automatic allocations based on configured rules, while users can also perform manual matching. This guide explores the mechanics, configuration options, calculations, and automation possibilities related to allocations.
See also: Zudello v3 Architecture Overview, The Enrichment Engine
Core Concepts
- Allocation: The process of linking related documents (e.g., PI to PO).
- 2-Way Matching: Matching a Purchase Invoice (PI) directly to a Purchase Order (PO). Verifies that the invoiced items/amounts align with what was ordered.
- 3-Way Matching: Matching a Purchase Invoice (PI) to both a Purchase Order (PO) and a Goods Receipt (GR). Verifies that the invoiced items/amounts align with what was ordered and what was received.
- Allocation Level: Determines whether matching occurs at the overall document level or line-by-line.
- Document Level: Matches based on header information (e.g., PO number, total amount). Less precise, often used for blanket POs or services.
- Line Level: Matches individual lines on the PI to corresponding lines on the PO/GR based on criteria like SKU, description, quantity, or price. More precise, common for goods/inventory.
- Matching Method (Check Remaining By): Determines whether the system primarily tracks remaining balances and calculates statuses based on Quantity or Amount.
- Quantity: Focuses on matching item quantities. Calculates detailed price variances. Suitable for goods/inventory where quantity is key.
- Amount: Focuses on matching total amounts (exclusive of tax). Less emphasis on quantity/price variances. Suitable for services, blanket POs, or scenarios where only the total value matters.
Configuration: The Allocation Extension
Matching behaviour is primarily configured via the Allocations extension on the relevant Document Type (typically the Purchase Invoice).
- Navigate: Settings > Document Types > Edit Purchase Invoice > Extensions tab.
- Key Settings:
- Allocate To: Select the document types to match against (e.g., Purchase Order, Inventory Receipt).
- Allocation Level: Choose Document or Lines.
- Check remaining by: Choose Quantity or Amount.
- Matchable Statuses: Define which statuses the target documents (PO, GR) must be in to be considered for matching (e.g., PO must be
PLACED
orRECEIVED
, GR must beACTIVE
). - Line Matching Rules: If Allocation Level is Lines, configure which fields to use for matching (SKU, Description, Unit Price, Quantity & Unit Price).
- Autofill: (Optional) Configure if coding from matched PO/GR lines should automatically populate empty fields on the PI lines.
- Trigger Status Update: (Optional) Define which statuses the target documents must be in to trigger a re-evaluation event on the source document when the target document is completed. See Automation with Sentences.
Automatic Matching Process (Enrichment)
During the Enrichment process for an Invoice (after extraction or "Apply Trained Rules"), the allocation logic runs:
- Find Potential Matches:
- Identifies the linked Supplier on the Invoice.
- Searches for POs/GRs linked to the same Supplier.
- Filters potential matches based on the extracted
po_number
on the Invoice matching thedocument_number
of the PO/GR. - Filters potential matches based on the PO/GR being in one of the configured Matchable Statuses.
- Perform Matching (Based on Configuration):
- Document Level: If a single valid PO/GR matches the criteria, it's linked. The system primarily tracks the total amount allocated against the PO/GR total.
- Line Level:
- Iterates through Invoice lines and attempts to find matching PO/GR lines based on the configured Line Matching Rules (SKU, Description, etc.).
- Considers remaining quantities/amounts on PO/GR lines.
- Creates links between matched lines, recording the allocated quantity and amount.
- Calculate Outcomes: After matching, the system calculates and stores statuses and variances (see below).
See Enrichment Engine - Link Transactions.
Manual Matching Process
If automatic matching fails or needs correction, users with appropriate permissions can manually match:
- Initiate: Click the "Match Purchase Order" or "Match Receipt" button/link (location varies by UI version/config).
- Search: A modal appears, pre-filtered by the Invoice's linked Supplier. Search for the correct PO/GR by number or other criteria.
- Select: Choose the correct PO/GR header.
- Match Lines (Line Level):
- The modal displays Invoice lines on one side and PO/GR lines on the other.
- Click matching lines on both sides to link them.
- Alternatively, use auto-match suggestions within the modal.
- Adjust allocated quantities/amounts if necessary (e.g., for partial receipts).
- Confirm: Save the manual allocations.
See Manually Match Invoice to PO/Receipt.
Calculated Outcomes
After allocations are made (automatically or manually), Zudello calculates several key metrics stored against the transaction (e.g., the Invoice) in JSON fields like allocation_status_json
, variance_amount_local_json
, etc. These compare the source document (e.g., Invoice) to the target document (e.g., PO).
- Allocation Status: Indicates the overall matching status relative to the target document.
FULL
: All lines/total amount on the source document are fully allocated to the target document(s).PARTIAL
: Some lines/amount are allocated, but not all. Or, the source is fully allocated, but the target still has remaining quantity/amount.INVALID
: Over-allocation has occurred (more allocated than available on the target).null
(Not Set): No allocation exists between the source and target document type.- See Understanding Allocation Statuses.
- Variance (Quantity Matching Only): Measures the difference in price for the allocated quantities.
variance_amount_local_json
: The total monetary difference (Invoice Price - PO Price) * Allocated Quantity, summed across lines, in local currency. Can be positive (Invoice more expensive) or negative (Invoice cheaper).variance_percentage_json
: The variance amount expressed as a percentage of the allocated PO value.- See Understanding and Resolving Variances.
- Remaining (Quantity & Amount Matching): Measures what's left unallocated on the source document relative to the target.
remaining_amount_local_json
: The total value on the source document that has not been allocated to the target document type.remaining_percentage_json
: The remaining amount expressed as a percentage of the source document's total value.remaining_quantity_json
(Qty Matching): The total quantity on the source document not allocated to the target document type.
- Discrepancy (Quantity & Amount Matching): A combined measure intended to capture the "total difference" for approval routing.
discrepancy_amount_local_json
:- Quantity Matching: Sum of positive Variance Amount + Remaining Amount. (Negative variances are ignored to prevent under-charges masking over-charges).
- Amount Matching: Equal to the Remaining Amount.
discrepancy_percentage_json
: The discrepancy amount expressed as a percentage of the source document's total value.
Leveraging Outcomes in Automation (Sentences)
The calculated Allocation Status, Variance, Remaining, and Discrepancy values are powerful tools for automating workflows using Sentences.
- Triggers: Common triggers include "When a resource is extracted" or "When a resource is submitted".
- Conditions: Use conditions based on the calculated outcomes:
Allocation Status (Order)
|Equals
|FULL
Variance Percentage (Order)
|Greater than
|5
Discrepancy Amount Local (Receipt)
|Less than
|10
Allocation Status (Order)
|Is not set
(i.e., no PO matched)
- Actions: Based on the conditions, perform actions like:
- Set Status to
COMPLETE
(if fully matched with low variance). - Set Status to
REVIEW
(if not matched). - Get Approval from Procurement (if variance > 5%).
- Assign User to investigate.
- Set Status to
This allows for automated routing based on matching results, significantly streamlining the AP process.
Troubleshooting Common Issues
- Invoice Not Auto Matching: Check PO number, supplier match, PO/GR status, remaining quantities/amounts, line details, and extension configuration. Use "Apply Trained Rules". See Enrichment Engine - Link Transactions.
- Cannot Find PO/GR in Manual Matching: Check invoice supplier, PO/GR status, remaining quantities/amounts. See Manually Match Invoice to PO/Receipt.
- Incorrect Allocation Status: Verify matching method (Qty vs Amount), review line-level allocations, check remaining values, refresh/recalculate. See Understanding Allocation Statuses.
- Incorrect Variance: Ensure Quantity Matching is used, verify unit prices on PI/PO, check line matches. See Understanding and Resolving Variances.
- Over-Allocation (
INVALID
Status): Identify affected documents, review line allocations, correct the allocation amounts manually. - Allocations Disappeared: Check if the Supplier was changed on the invoice, review audit history for unmatching or reversions. See Allocations Cleared Unexpectedly.
Understanding Zudello's allocation and matching engine allows administrators to configure the system for optimal automation and users to efficiently handle exceptions, ensuring accurate and compliant P2P processing.