Developer ToolsFree generatorPDF, Excel, Word exportInfor SyteLineAll Infor SyteLine (CloudSuite Industrial) tools

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.

Generated code
Download:

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.

Was this tool useful?

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.

      ArchRay builder
      Design the on-prem AI stack for Infor SyteLine: model, GPUs, RAG pipeline, guardrails
      See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
      Open the builder

      Keep exploring

      Free tools

      ERP fixes and how-tos

      Runs with your ERP

      Guides

      AI on your ERP