pixiExportItemStock
Returns all items with a positive exportable stock for one location or all locations, together with item numbers, EAN, name, manufacturer, prices and category.
Exports a stock list of all items whose calculated stock is greater than 0.
Location selection
- The Pixi setting
ExportStock_locationsis read first. An empty value meansALLand0means001. - If
Locationis not empty, it overrides the setting. Because the default ofLocationisALL, the setting only applies if the caller sends an empty value orNULL. ALLcovers all locations. Any other value is treated as a single location ID (LocID).
Stock calculation
The stock is calculated per item by the function fPixi_GetStockForExport:
- Normal items: the sum of
BinItemQtyover all bins (InvBin) in locations that are not flagged as special stock (SpecialStock <> 1), restricted to the selected location unlessALLis used. - Bundle items (items referenced in
BundleItems):Items.QuantityforALL, otherwiseLocationQuantityfromItemLocationSpecificfor the selected non-special location.
Output
The call reads all items from Items and left-joins TontrArten for the category text. Only rows with Stock > 0 are returned. No item status filter and no sort order are applied.
Notes
- The stock function is called with the fixed value
'N'for its physical-stock flag. The function only subtracts open order quantities (statusANG, orHALwithin the lastHalOrdersActiveDaysdays) or reservations when this flag equals'0'. As a result, no order or reservation quantities are deducted, and the exported value is the physical bin stock. - The settings
StockExportUsePhysicalStockandOldStockExportare read but not used.ReservePrepaymentOrders,ShowLocationStockInItemSearchandHalOrdersActiveDaysare passed to the stock function but have no effect on the result, for the reason above.HalOrdersActiveDays = 0is replaced by 7. - All tables are read with
NOLOCK, exceptInvBinIteminside the stock function, which is read without the hint. - The stock is calculated by a scalar function for every item in
Items. On large item bases this can be slow. - If a location ID that does not exist is passed, the result is empty.
- The join condition
TontrArt = ConfigTypedoes not name the tables. Which column belongs toItemsand which toTontrArtencannot be determined from the code. - The header comment mentions XML input, but the procedure has no XML parameter.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Location
|
varchar(3) string |
ALL |
Location ID whose stock is exported, or Allowed values
Example: |
Response
Result set 1 · Always; contains only items with a stock greater than 0 (may be empty).
One row per item with positive exportable stock.
| Column | Type | Description |
|---|---|---|
ItemNrSuppl
Nullable |
string |
Supplier item number ( |
EANUPC
Nullable |
string |
EAN/UPC barcode of the item. |
ItemName
Nullable |
string |
Item name. |
ItemNrInt
Nullable |
string |
Internal Pixi item number. |
Stock
|
int |
Exportable stock calculated by |
Manufacturer
Nullable |
string |
Manufacturer ( |
Price
Nullable |
decimal |
Sales price ( |
SupplPrice
Nullable |
decimal |
Purchase price ( |
Category
Nullable |
string |
Category text from |
Response example
<SqlRowSet1>
<row>
<ItemNrSuppl>SUP-4711</ItemNrSuppl>
<EANUPC>4006381333931</EANUPC>
<ItemName>Kugelschreiber blau</ItemName>
<ItemNrInt>100245</ItemNrInt>
<Stock>37</Stock>
<Manufacturer>Stabilo</Manufacturer>
<Price>2.9900</Price>
<SupplPrice>1.1000</SupplPrice>
<Category>Schreibwaren</Category>
</row>
<row>
<ItemNrSuppl>SUP-4712</ItemNrSuppl>
<EANUPC>4006381333948</EANUPC>
<ItemName>Kugelschreiber rot</ItemName>
<ItemNrInt>100246</ItemNrInt>
<Stock>12</Stock>
<Manufacturer>Stabilo</Manufacturer>
<Price>2.9900</Price>
<SupplPrice>1.1000</SupplPrice>
<Category>Schreibwaren</Category>
</row>
</SqlRowSet1>
Examples
POST https://apigateway.descartes.com/tms/pixi/
Content-Type: text/xml; charset=utf-8
Authorization: Basic BASE64(USERNAME:PASSWORD)
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiExportItemStock>
<!-- <Location>001</Location> -->
</ns1:pixiExportItemStock>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
curl -X POST 'https://apigateway.descartes.com/tms/pixi/' \
--user 'USERNAME:PASSWORD' \
--header 'Content-Type: text/xml; charset=utf-8' \
--data-binary @- <<'XML'
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://apigateway.descartes.com/tms/pixi/">
<SOAP-ENV:Body>
<ns1:pixiExportItemStock>
<!-- <Location>001</Location> -->
</ns1:pixiExportItemStock>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
XML
<?php
$soapClient = new SoapClient(null, [
'login' => 'USERNAME',
'password' => 'PASSWORD',
'location' => 'https://apigateway.descartes.com/tms/pixi/',
'uri' => 'https://apigateway.descartes.com/tms/pixi/',
]);
$arguments = [
// 'Location' => '001',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiExportItemStock', $soapArguments);
Tables used
- SQL object:
- dbo.pipiExportItemStock