Postman collection
Reports Read

pixiReport_LogisticQuality_Details

Returns the logistic quality report: days from order creation to shipment per order, or a percentage distribution for the shipping seal.

Measures how many days (in 24-hour steps) it took to ship orders created in the last DaysBack days.

Date range: FromDate is the start of the day DaysBack days ago, ToDate is the end of today.

Order selection:

  • Orders whose header CreateDate is on or after FromDate.
  • The order's creation date is the earliest ANG entry in OrderHistory within the date range. The ship date is the earliest ShipDate of its order lines.
  • The order header ShipDate must be NULL.
  • At least one order line must have status ANG or AUS. If ShopID is set, that line must also belong to this shop (OrdShopID).
  • Orders of customers that were locked (HSLocked = 'Y') in CustomersHist after FromDate are excluded.

Further exclusions (the whole order is removed if one line qualifies):

  • Order lines created more than 5 minutes apart. Such orders count as changed manually after the import.
  • Not enough stock on the order date. Demand is accumulated per item from order creation and shipment events. Stock is calculated from InvBinItemLog in locations without special stock (SpecialStock = 0). If demand is greater than or equal to stock, the order is removed.
  • Lines on ANG whose available stock is <= 1. Available stock is ItemLocationSpecific.LocationQuantity if special-stock locations exist, otherwise Items.Quantity. With CalcSeal = 0, reservations made earlier by open orders (non-final states except EIN, FUT, FUS) are subtracted.

Date adjustments:

  • Orders created on Friday, Saturday or Sunday are moved to the following Monday. The time of day is kept.
  • Holidays are taken as days without invoices that have a positive total. An order is moved to the first invoice time of the next day with invoices if one of these applies:
    • its creation day has no such invoices;
    • the following day has no such invoices.

Output (only orders with a ship date):

  • CalcSeal = 0 (pixi* Report client): one row per order with DaysToShip, order number and dates, sorted by DaysToShip and CreateDate. With ExcludeZeros = 1, only orders with DaysToShip > 0 are returned.
  • CalcSeal = 1 (Seal / Dashboard apps): one row per DaysToShip value with the order count, its share of all packages and the total. An extra row with DaysToShip = 99 and zero values is always added. The rows are sorted by DaysToShip.

Notes

  • The parameter OnlyItemsOnStock is declared but not used anywhere in the code.
  • All permanent tables are read with NOLOCK, so results can include uncommitted data.
  • SET DATEFIRST 1 is applied inside the procedure. Weekdays 5–7 are Friday to Sunday.
  • The reported CreateDate is the adjusted date (weekend/holiday shift), not the original order date.
  • Orders whose header ShipDate is set are not included. The ship date used is the earliest line ShipDate.
  • Orders whose ANG lines have no matching ItemLocationSpecific row for the line's location are not removed by the reservation-stock check.
  • Holiday detection depends on invoices with total > 0. Days without invoices are treated as holidays.
  • The code comment states that changes must also be applied to pixiReport_LogisticQuality_NonCached.
  • The calculation runs over many temporary tables and window functions. Large DaysBack values can be slow.

Tables used

Location · Read OrderHeader · Read Orderlines · Read OrderHistory · Read CustomersHist · Read Reservation · Read InvBinItemLog · Read OrderStates · Read ItemLocationSpecific · Read Items · Read Invoices · Read
SQL object:
dbo.pipiReport_LogisticQuality_Details
Updated at 2026-10-30