Postman collection
Returns Read

pixiGetReturnItems

Returns the lines of a return case with item, invoice line, bin location and translated reason and quality classification.

Returns all return lines (pixi.ReturnLine) that belong to the return case given in ReturnId.

Steps:

  1. Loads the translations of code table values (DBObjectName = 'CodeTableValue') for the language LanguageId into a temporary table.
  2. Selects every return line of the return case and joins:
    • the invoice line (Invlines) and its item (items), which provide item number, EAN, name and internal item number,
    • the return reason code (ReasonId) with its code and translated description,
    • the item quality classification code (ItemQualityClassificationId) with its code and translated description,
    • the bin item log entry (InvBinItemLog), which provides quantity, location, bin, best-before date and batch number.

All joins are inner joins, so a line only appears if all referenced records exist and both the reason and the classification have a translation in the requested language.

No explicit sort order is applied.

Notes

  • Most tables are read with NOLOCK, so uncommitted data may be returned; the join to the quality classification (CodeTableValue as ct2) is read without NOLOCK.
  • If a reason or classification has no translation for the given LanguageId, the whole line is missing from the result. Use a language for which translations exist (default 1).
  • The temporary table is dropped via util.TempTableDrop, whose definition is not attached.
  • If the return case does not exist or has no lines, an empty result set is returned; no error is raised.

Tables used

Translation · Read ReturnLine · Read Invlines · Read items · Read CodeTableValue · Read InvBinItemLog · Read
SQL object:
dbo.pipiGetReturnItems
Updated at 2026-10-30