Postman collection
Reports Read

pixiReport_StockValue_Hist

Returns the historical stock value per item on a given date, valued at historical supplier prices and net sales prices.

Wrapper around the internal report procedure Report_StockValue_Hist. It always runs with ShowDetails = 0. Supplier matching always uses the main supplier of the item (AllItemsForSupplier = 0).

Steps:

  1. Reference date: ParamDate is moved to the end of that day. If it is omitted, the end of the current day is used.
  2. Item filter: Empty strings for LocID, Category and SupplNr count as "no filter".
    • SupplNr filters on the item's main supplier (Items.SupplNr).
    • Category filters on Items.ConfigType.
  3. Stock at the reference date: For each item, all quantity movements in InvBinItemLog up to the reference date are summed.
    • With LocID, only bins of that location (InvBin.BinLocID) are counted.
    • Movements on bins that were deleted after the reference date are also counted. These bins are found in InvBinHist with remark Deleted.
    • Items whose resulting quantity is 0 are dropped.
  4. Historical supplier prices: The stock quantities are passed to internal helper procedures. These determine historical purchase prices from supplier deliveries, so one item can appear in several rows, one per supplier delivery that makes up the stock.
  5. Sales price:
    • VK_Netto is the gross price Items.Price divided by (1 + VAT rate), rounded to 2 decimals.
    • The VAT rate comes from the item's MwStSatz: 1 = high rate, 2 = reduced rate, any other value = 0. Rates are those of the default country.

The result is sorted by Artikelname, then SupplDelDate, then VAT rate.

Notes

  • All permanent tables are read WITH (NOLOCK), so the result can contain uncommitted data.
  • The historical supplier prices come from Report_SaveSupplierPrices and pixi_HistorySupplierPriceForItems. Their definitions are not attached. Whether they write to permanent tables, and exactly how SupplPriceHist, SupplPriceType and SupplPriceMessage are determined, cannot be seen here.
  • VAT rates are taken for the current date, not for ParamDate. Historical rate changes are therefore not reflected in VK_Netto.
  • Bestand is the total stock of the item on the reference date and is repeated on every delivery row of that item. Use SupplDelQty for per-row sums. Sum_VK_Netto and Sum_SupplPriceHist are already based on SupplDelQty.
  • par_Category and par_SupplNR contain -alle- when no filter is set. Otherwise they contain the category text and the supplier name of the item, not the number.
  • The report evaluates the whole bin movement log and can be slow on large databases.

Tables used

Items · Read AddItems · Read InvBinItemLog · Read InvBin · Read InvBinHist · Read TontrArten · Read Suppliers · Read
SQL object:
dbo.pipiReport_StockValue_Hist
Updated at 2026-10-30