Postman collection
Reports Read

pixiReport_StockValue

Returns the stock value report: stock per article and location at a given date, with gross/net sales price, purchase price, gross profit and totals.

Wrapper around the internal report procedure Report_StockValue. All parameters are passed through unchanged.

Steps

  1. The key date is set to the end of the day of ParamDate. If ParamDate is omitted, the end of the current day is used.
  2. The stock is rebuilt from the stock movement log InvBinItemLog. All movements with UpdateDate up to the key date are summed per location (LocID) and article. Only combinations with a non-zero sum are kept, so negative stock is included.
  3. If LocID is given and not empty, only movements of that location are considered. Otherwise all locations are included.
  4. Each stock row is joined to the article (Items). Rows whose article does not exist are dropped.
  5. Per article, the latest supplier information valid at the key date is determined. It provides the sales price Price, the purchase price SupplPrice and the supplier number. The supplier name comes from Suppliers, and the category text comes from TontrArten via Items.ConfigType.
  6. The VAT rate is determined for the default country and the key date, based on the article's MwStSatz:
    • 1 = high rate
    • 2 = low rate
    • any other value = no VAT; the price is treated as net.
  7. Filters:
    • If SupplNr is given and not empty, only articles whose latest supplier is that supplier are returned.
    • If Category is given and not empty, only articles with ConfigType = Category are returned.
  8. One row per article and location is returned, sorted by the internal article key.

Calculated values

  • VK_Netto = gross price divided by (1 + VAT rate)
  • Rohertrag = VK_Netto − EK per unit
  • Sum_* = stock quantity × unit value

The columns par_* echo the effective filter values. Filters that are not set appear as -alle-.

Notes

  • Read-only. Most tables are read WITH (NOLOCK), so the result can contain uncommitted data. Items is read without a hint.
  • The stock is recalculated from the complete movement log up to the key date. This can be slow for large histories; use filters where possible.
  • Only the date part of ParamDate matters, because the time is always moved to the end of the day.
  • The location column of the internal stage table is varchar(3), although LocID accepts up to 10 characters.
  • When SupplNr is set, articles without supplier information are excluded. Without the filter they are returned with NULL prices.
  • Rohertrah (sic, spelled differently from Rohertrag) is the total gross profit. It is 0 for articles whose MwStSatz is neither 1 nor 2, whereas Rohertrag is still calculated for them.
  • The output column MwStSatz contains the VAT rate in percent, not the article's VAT code.
  • The helper functions fPixi_GetLatestSupplierInfo, fPixi_GetVATRate, fPixi_GetDefaultCountryCode, fPixi_GetDateEndOfDay and pixi.GetDatabaseCurrency are not attached. Their exact logic, for example how the "latest" supplier information is chosen, and the data types of the price columns are therefore not documented here.

Tables used

InvBinItemLog · Read Items · Read TontrArten · Read Suppliers · Read
SQL object:
dbo.pipiReport_StockValue
Updated at 2026-10-30