Requisition to Vendor Bill Calculations
Understanding how Procore requisitions are transformed into NetSuite vendor bills
Requisition to Vendor Bill Calculations
When a Procore requisition (payment application/invoice) is synchronized to NetSuite, Kurrent.AI transforms the data into one or more NetSuite vendor bills. This document explains the calculations used for each component.
Overview
A single Procore requisition can result in multiple NetSuite transactions:
- Item Receipt - Records the receipt of goods/services against the purchase order
- Vendor Bill - The main invoice with work completed, stored materials, and retainage held
- Vendor Credit - Created when there are negative adjustments
- Retainage Release Vendor Bill - Created when retainage is released without new work
Line Item Calculations
Each line item in the requisition is processed to calculate the following values.
Work Completed This Period
The amount of work completed during the current billing period.
Source Field: work_completed_this_period
This value is taken directly from the Procore requisition line and represents the dollar amount of work performed.
Stored Materials (Net Change)
Tracks the change in materials stored on-site during the current period.
Calculation:
Stored Materials Net Change = materials_presently_stored - materials_movedSource Fields:
materials_presently_stored(ortotal_materials_presently_stored) - Current value of materials on-sitematerials_moved- Materials that were installed/used this period
Interpretation:
- Positive value = Net increase in stored materials (more materials delivered than installed)
- Negative value = Net decrease in stored materials (more materials installed than delivered)
- Zero = No change in stored materials
Example:
| Scenario | Materials Presently Stored | Materials Moved | Net Change |
|---|---|---|---|
| New delivery | $50,000 | $0 | +$50,000 |
| Materials installed | $30,000 | $20,000 | +$10,000 |
| All materials used | $0 | $50,000 | -$50,000 |
Retainage Held
Retainage is an amount withheld from payment until project completion. Retainage held is aggregated by cost code (WBS code) and appears as negative line items on the vendor bill.
Calculation:
Retainage Held = work_completed_retainage_retained_this_period + total_materials_stored_retainageSource Fields:
work_completed_retainage_retained_this_period- Retainage held on work completedtotal_materials_stored_retainage(ormaterials_stored_retainage_currently_retained) - Retainage held on stored materials
How it appears in NetSuite:
- Retainage is aggregated by cost code (WBS code)
- Creates negative line items on the vendor bill using item ID 2029 (Retainage item)
- Reduces the total vendor bill amount by the retainage being held
Example:
| Cost Code | Work Retainage | Materials Retainage | Total Retainage Held |
|---|---|---|---|
| 01-100 | $5,000 | $500 | $5,500 |
| 01-200 | $3,000 | $0 | $3,000 |
| Total | $8,000 | $500 | $8,500 |
Retainage Released
When previously held retainage is released back to the contractor.
Calculation:
Retainage Released = work_completed_retainage_released_this_period + materials_stored_retainage_released_this_periodSource Fields:
work_completed_retainage_released_this_period- Retainage released on completed workmaterials_stored_retainage_released_this_period- Retainage released on stored materials
How it appears in NetSuite:
- When a requisition has no work completed but retainage is released, a separate vendor bill is created
- External ID format:
VB-RETREL-[requisitionId] - Creates positive line items using item ID 2029 (Retainage item)
- Aggregated by cost code (WBS code)
When Retainage Release Vendor Bill is Created:
- Work completed this period = $0 (no new work)
- Retainage released this period > $0 (retainage being released)
Aggregation by Cost Code
Both retainage held and retainage released are aggregated by cost code (WBS code) before being written to NetSuite. This means:
- Multiple requisition lines with the same cost code are combined
- A single retainage line is created per cost code
- The line description indicates the cost code: "Retainage for Item Code [costCode]"
Example Aggregation:
| Requisition Line | Cost Code | Retainage Held |
|---|---|---|
| Detail Item 1 | 01-100 | $2,000 |
| Detail Item 2 | 01-100 | $1,500 |
| Detail Item 3 | 01-200 | $3,000 |
Result on Vendor Bill:
| Cost Code | Aggregated Retainage |
|---|---|
| 01-100 | -$3,500 |
| 01-200 | -$3,000 |
Transaction Types Summary
Main Vendor Bill
Created when there is work completed this period.
Contains:
- Positive line items for work completed (referencing PO lines)
- Negative line items for retainage held (aggregated by cost code)
- Custom field
custcol_adpi_new_materials_storedfor stored materials
External ID: VB-[requisitionId]
Retainage Release Vendor Bill
Created when retainage is released but no new work is performed.
Contains:
- Positive line items for retainage being released
- Aggregated by cost code
External ID: VB-RETREL-[requisitionId]
Vendor Credit
Created when there are negative adjustments (credits).
Contains:
- Positive amounts representing credits back to the company
External ID: VC-[requisitionId]
Field Mapping Reference
| Procore Field | Description | Used For |
|---|---|---|
work_completed_this_period | Work done this period | Line item quantity |
materials_presently_stored | Current stored materials value | Stored materials calculation |
materials_moved | Materials installed this period | Stored materials calculation |
work_completed_retainage_retained_this_period | Retainage held on work | Retainage held calculation |
total_materials_stored_retainage | Retainage held on materials | Retainage held calculation |
work_completed_retainage_released_this_period | Retainage released on work | Retainage released calculation |
materials_stored_retainage_released_this_period | Retainage released on materials | Retainage released calculation |
wbs_code_flat_code | Cost code | Line item grouping |
description_of_work | Line description | Vendor bill line description |
Troubleshooting
Retainage Values Don't Match
Check:
- Verify the source fields in Procore contain the expected values
- Confirm the cost codes are being resolved correctly
- Review the aggregation - multiple lines may be combined
Missing Retainage Release Vendor Bill
This only creates when:
- Total work completed = $0
- Retainage released > $0
If work was also completed, the retainage release will be part of the main vendor bill flow.
Stored Materials Showing Unexpected Values
Remember:
- Stored materials is a net change calculation
- Positive = increase in stored materials
- Negative = decrease (materials used)
- Check both
materials_presently_storedANDmaterials_movedvalues
FAQ
Q: Why is retainage aggregated by cost code? A: NetSuite requires retainage to be tracked at the cost code level for proper job costing and reporting. Aggregating ensures each cost code has a single retainage line.
Q: Can retainage held and released both appear on the same requisition? A: Yes. When work is performed AND retainage is released, both are processed. The main vendor bill handles work completed and new retainage held, while retainage release may create a separate transaction if there's no work.
Q: What happens if a cost code is missing? A: Lines without a cost code are grouped under "DEFAULT" for aggregation purposes.
Q: How do I verify the calculations?
A: Use the API Test page at /developer/api-test to call the combined-invoice-data endpoint and see the raw Procore data being used for calculations.