Postman collection
Suppliers Read

pixiGetSOrderlines

Returns the lines of a supplier order with item, price, delivery and stock data plus customer demand and sales figures per item.

Returns all lines of the supplier order whose ID is passed in SOrderRef. Internally the call runs Pixi_GetSorderlines with all optional fields enabled, buffers the rows in a temporary table and returns them unchanged.

For each line the result contains:

  • Line data: item name, ordered quantity, status code of the supplier order, comment, estimated delivery date, creator and last editor with timestamps.
  • Item data: EAN (ArtNr), supplier item number and internal item number from the supplier-specific item data of the order's supplier, sales price (VKPrice), order unit, VAT percentage valid at the line's creation date.
  • Purchase prices: EKprice is the supplier price stored on the line. If the order status is flagged as new and the line price is 0 or empty, the supplier price from the supplier-specific item data is used instead. EKValue is quantity × EKprice. FinalPrice is supplier price × quantity minus the line discount.
  • Delivery data: delivered and undelivered quantity of the line and the total received quantity summed over all delivery details (TotalQtyReceived).
  • Stock and demand at the delivery location of the order: location stock, minimum order and minimum stock quantity, quantity in customer order lines with status HAL (Hal_Cust_O) or ANG, BES, BOR (Open_Cust_O), quantity in other open, ordered/confirmed supplier orders (Open_Suppl_O), and sold quantities of the last 30, 120 and 365 days (L30, L120, L365, all customer order lines except status STO).

If OpenOrderlines = 1, only lines are returned whose ordered quantity is greater than delivered plus undelivered quantity. Lines are produced in order of the line ID.

Only lines are returned for which the item, the item's location-specific record at the order's delivery location, the supplier and both the creating and modifying user exist (inner joins).

Notes

  • LocID is passed to the inner procedure but not used in the query. Location-related figures always refer to the delivery location of the supplier order, regardless of LocID.
  • If the setting Include_FUT_StatusInOpenOrdersForSupplierOrdering is 1, customer order lines with status FUT are also counted in Open_Cust_O.
  • All reads use NOLOCK, so figures may include uncommitted data.
  • The query is built as dynamic SQL; the many correlated subqueries (sales of 30/120/365 days, open orders) can make the call slow for large orders.
  • Fixed values: Detail, Detail2 and Price are always 0, ReceiveDate is always empty. StockQty equals SummaryQuantity.
  • SOrderlineNr actually contains the ID of the supplier order (same as SOrderRef), not a line number. Use SOrderlineKey to identify a line.
  • The ordering by line ID is applied in the inner query; the final select from the temporary table has no explicit ORDER BY.
  • Several columns of the internal temporary table are declared NOT NULL (e.g. VKPrice, FinalPrice). If the source data contains NULL there (e.g. a line without supplier price), the insert may fail with an SQL error.
  • If SOrderRef is left out (default 0), no rows are returned.

Tables used

SupplierOrder · Read SupplierOrderLine · Read SupplierOrderStatus · Read UCS_USERS · Read Items · Read ItemLocationSpecific · Read Suppliers · Read SDelDetail · Read AddItems · Read Orderlines · Read
SQL object:
dbo.pipiGetSOrderlines
Updated at 2026-10-30