SyteLine Open Purchase Order Report Query Generator
This generator writes a read-only SQL Server query for open and late purchase order lines in Infor SyteLine 9 and 10 (CloudSuite Industrial on-prem), plus a vendor on-time summary built from PO receipt transactions. Fill the fields, copy the SQL into SSMS or your report tool, and export the result to Excel.
Fill in
The site_ref value of the site you are reporting on.
Use % for all vendors. Vendor numbers can be stored right-justified with leading spaces, so prefer a leading % (for example %V1001).
0 returns lines due today or earlier. Use -9999 to return every open line, including future due dates.
Quoted, comma separated stat values. O = Ordered. Add 'P' to include planned lines.
1. Open and late PO lines
-- Open and late purchase order lines, SyteLine 9/10 (run on a read-only login)
DECLARE @Site nvarchar(20) = N'MAIN';
DECLARE @DaysLate int = 0;
SELECT
p.po_num,
pi.po_line,
pi.po_release,
p.vend_num,
va.name AS vendor_name,
p.buyer,
pi.whse,
pi.item,
pi.qty_ordered,
pi.qty_received,
pi.qty_ordered - pi.qty_received AS qty_open,
pi.item_cost,
(pi.qty_ordered - pi.qty_received) * pi.item_cost AS open_value,
pi.due_date,
DATEDIFF(day, pi.due_date, GETDATE()) AS days_late
FROM po_mst p
JOIN poitem_mst pi
ON pi.site_ref = p.site_ref
AND pi.po_num = p.po_num
JOIN vendaddr_mst va
ON va.site_ref = p.site_ref
AND va.vend_num = p.vend_num
WHERE p.site_ref = @Site
AND pi.stat IN ('O')
AND pi.qty_ordered > pi.qty_received
AND p.vend_num LIKE N'%'
AND ISNULL(p.buyer, N'') LIKE N'%'
AND pi.whse LIKE N'%'
AND DATEDIFF(day, pi.due_date, GETDATE()) >= @DaysLate
ORDER BY pi.due_date, p.vend_num;2. Vendor on-time percentage from PO receipts
-- Receipt transactions (ref_type P, trans_type R) compared with the PO line due date
DECLARE @Site nvarchar(20) = N'MAIN';
DECLARE @Lookback int = 90;
SELECT
p.vend_num,
va.name AS vendor_name,
COUNT(*) AS receipts,
SUM(CASE WHEN CAST(m.trans_date AS date) <= CAST(pi.due_date AS date) THEN 1 ELSE 0 END) AS on_time_receipts,
CAST(100.0 * SUM(CASE WHEN CAST(m.trans_date AS date) <= CAST(pi.due_date AS date) THEN 1 ELSE 0 END) / COUNT(*) AS decimal(5,1)) AS on_time_pct
FROM matltran_mst m
JOIN poitem_mst pi
ON pi.site_ref = m.site_ref
AND pi.po_num = m.ref_num
AND pi.po_line = m.ref_line_suf
AND pi.po_release = m.ref_release
JOIN po_mst p
ON p.site_ref = pi.site_ref
AND p.po_num = pi.po_num
JOIN vendaddr_mst va
ON va.site_ref = p.site_ref
AND va.vend_num = p.vend_num
WHERE m.site_ref = @Site
AND m.ref_type = 'P'
AND m.trans_type = 'R'
AND m.qty > 0
AND m.trans_date >= DATEADD(day, -@Lookback, GETDATE())
AND p.vend_num LIKE N'%'
GROUP BY p.vend_num, va.name
ORDER BY on_time_pct, receipts DESC;Verify on your SyteLine 9/10 database before relying on it: the stat values in use on poitem_mst (check against the PO line status list in your forms), and whether item_cost is in vendor currency for foreign vendors before summing open_value across vendors. Blanket POs carry due dates at release level, so read them by po_release. In a multi-site database every join must include site_ref. Run it on a reporting copy or a read-only login.
Want this as a scheduled report?
Send us your site setup and statuses and we will review the query against your SyteLine version and turn it into a scheduled Excel or SSRS report.
Optional. The tool and every export work without this. No spam.
How to use it
Enter the site_ref of the site you report on, then narrow by vendor, buyer and warehouse with LIKE patterns (% means all). Minimum days late controls the main filter: 0 returns lines due today or earlier, 7 returns lines at least a week late, and -9999 returns the whole open book including future due dates. Statuses default to O (Ordered); add P if planned lines matter to your buyers. Pick a sort order and copy block 1. Block 2 uses the same site and vendor filter and a lookback window to compute on-time delivery per vendor. Paste either block into SQL Server Management Studio connected to a reporting copy, or use it as the dataset of an SSRS report or an Excel data connection.
- Block 1: one row per open PO line or release, with open quantity, open value and days late
- Block 2: receipts in the lookback window per vendor, on-time count and percentage
- Both blocks join on site_ref, which is required in multi-site databases
Where the data lives in SyteLine
The PO header is po_mst (po_num, vend_num, buyer, stat) and its lines and releases are poitem_mst (po_line, po_release, item, whse, qty_ordered, qty_received, item_cost, due_date, stat). The vendor name comes from vendaddr_mst. Receipts post to the material transaction table matltran_mst with ref_type P and trans_type R, where ref_num, ref_line_suf and ref_release point back to the PO line and release. The Purchase Orders and Purchase Order Lines forms read the same rows, so you can spot-check any line by opening it in the form. Open quantity is simply ordered minus received; returns and rejected quantities are not netted out in this version, which keeps the logic easy to audit.
- po_mst: header, vendor, buyer, status
- poitem_mst: line and release, quantities, cost, due date, status
- vendaddr_mst: vendor name and address
- matltran_mst: posted receipts used for on-time measurement
Worked example
A buyer wants every line at least five days late in warehouse MAIN. Set days late to 5, warehouse to MAIN and keep status O. A line ordered for 400 pieces with 150 received at an item_cost of 3.20 returns qty_open 250 and open_value 800.00. If its due_date was ten days ago, days_late is 10. For the on-time block with a 90 day lookback, a vendor with 40 receipts of which 34 arrived on or before the PO line due date shows 85.0 percent. A receipt dated the same day as the due date counts as on time because the comparison casts both to date.
Gotchas and version notes
Order and vendor numbers in SyteLine are often stored right-justified with leading spaces, so an exact match such as vend_num = 'V1001' can return nothing; use LIKE with a leading % or LTRIM. Blanket POs keep the agreement on the blanket line and the dated quantities on releases, so always read due_date at po_release level. On-time is measured against due_date; if your buyers maintain a promise date and want supplier performance against it, swap the column after confirming it in your schema. GETDATE returns server time; sites in other time zones may want the site-local date. Partial receipts create several receipt rows for one line, and each is scored separately.
Frequently Asked Questions
How do I build a custom purchase order report in SyteLine?
Start from a tested SQL dataset like block 1, then publish it as an SSRS report or an Excel connection on a reporting copy. For a report inside SyteLine itself, wrap the logic in a stored procedure and register it as a report through the normal custom report process. Keep site_ref in every join and filter.
Can I export SyteLine PO reports to Excel?
Yes. Most SyteLine forms can export grid rows to Excel, which is fine for a quick list. For a repeatable report, connect Excel to SQL Server with a read-only login and paste the generated query as the data source, so the sheet refreshes with one click instead of manual exports.
Which table holds SyteLine PO line due dates?
poitem_mst holds due_date per line and release, together with qty_ordered, qty_received, item_cost and stat. The header po_mst holds vendor, buyer and header status. Join them on site_ref and po_num, and on po_line and po_release when matching to receipt transactions in matltran_mst.
Why does my vendor filter return no rows?
Vendor and order numbers are usually padded with leading spaces to a fixed width. An equality or a LIKE pattern without a leading % will miss them. Use LIKE N'%V1001' or compare LTRIM(p.vend_num) to the value you typed.
If you want buyers to ask SyteLine which POs are late and why in plain English on your own servers, we can set up a private AI layer that runs queries like this read-only.
Related Tools
SyteLine Job and Order Status Codes Reference
Look up what Planned, Firm Planned, Released, Stopped, Complete and the other SyteLine status codes mean and how they behave in planning and shipping.
Infor SyteLineSyteLine Database Tables Reference
Searchable lookup of the main SyteLine SQL tables, what each holds and its usual business key, for writing queries and reports.
Developer ToolsSyteLine Incremental Extract Query Generator
Writes the watermark table, delta SELECT, watermark update, delete detection and MERGE for loading one SyteLine table into a staging database with SSIS or any ETL tool.
Developer ToolsSyteLine SQL Query Generator for Item, Job and Order Tables
Fill in site, item prefix, job status and date to produce read-only SQL for item master, jobs and open customer order lines.
More Developer Tools tools
See all- SyteLine IDO REST Request Generator
- SyteLine SQL Blocking and Long Running Query Script Generator
- SyteLine Custom Table CREATE Script Generator
- SyteLine Mongoose Framework Events Reference
- SyteLine Event Action Types Reference
- SyteLine Event Action Parameter Functions Reference
- SyteLine WinStudio Standard Form Events Reference
- SyteLine Mongoose API Options Reference
- SyteLine SQL User-Defined Data Types Reference
Keep exploring
Free tools
- SyteLine SQL Query Generator for Item, Job and Order TablesFill in site, item prefix, job status and date to produce read-only SQL for item master, jobs and open customer order lines.
- Late Purchase Order Lines SQL GeneratorGenerates a SQL query that lists open PO lines past their promise date with days late, plus a roll-up by supplier. Table names are yours to fill in.
- SyteLine SQL Blocking and Long Running Query Script GeneratorBuilds read-only SQL Server diagnostic scripts for blocking, head blockers, open transactions and slow requests on a SyteLine database.
ERP fixes and how-tos
- How to Receive a Purchase Order and Return Goods to a Vendor in SyteLineReceive a purchase order line in SyteLine PO Receipts, correct a wrong receipt, and process a return to vendor with an RMA number and AP debit memo.
- SyteLine customer on-time shipments: which dates to compare and how to report OTDHow to measure customer on-time shipments in Infor SyteLine: which dates to compare (due, promise, ship), standard reports, and a SQL query for OTD percent.
- How to Search for Items, Purchase Orders and Records in SyteLineFind items, purchase orders and any record in Infor SyteLine / CSI using Filter in Place, form search, lookups and query-by-example, with wildcard tips.
Guides
- SyteLine Purchase Order Automation and Approval WorkflowsAutomate SyteLine purchase order creation and approval workflows. Configure PO generation rules, approval routing, and vendor integration in CloudSuite Industrial.
- SyteLine Subcontract Purchase Order Configuration GuideConfigure SyteLine subcontract purchase orders for outside processing. Set up subcontract operations, material shipment, and cost tracking in CloudSuite Industrial.
- How to Set Up Purchasing Parameters in Infor SyteLineStep-by-step guide to setting up purchasing parameters in Infor SyteLine. Configure purchase order defaults, approval workflows, and vendor management settings.
AI on your ERP
- AI for SyteLine Purchasing: Open POs, Late Vendors and Planned Order ReleaseAI for Infor SyteLine purchasing: answer PO, vendor lead time and late-receipt questions from live data, draft expedite notes, and flag planned orders worth releasing.
- AI Purchase Order Automation: Supplier Follow-Up and Expedite Without a Buyer Chasing EmailAI drafts routine PO confirmation and expedite messages from open ERP order data, with a buyer approving every message and change before it goes out.