pixiInventoryItemsToRefill
Returns the Artikel that must be moved from a source location to a target location to cover minimum stock and open customer orders, with the source Lagerplätze to pick from.
Builds a replenishment (refill) list between two warehouse locations. The call passes all parameters to the internal procedure CR_InventoryItemsToRefill, which does the work.
Demand in the target location (ToLocID)
- Open customer orders: sum of
Orderlines.Qtyper Artikel inToLocIDwith statusANG,BES,BORandHAL.HALis left out when the settingInventoryItemsToRefill_NoHALis1. - Orders on hold: sum of
Qtyof order lines with statusHALinToLocID. This value is returned for information only. - Stock per location comes from
ItemLocationSpecific(LocationQuantity,MinStockQty,TargetStock).
Which Artikel are selected
- The Artikel has an
ItemLocationSpecificrecord forToLocID. FromLocIDdiffers fromToLocID.- Positive minimum stock plus open customer order quantity is greater than the stock in
ToLocID. - The Artikel is stored on at least one Lagerplatz (
InvBin) ofFromLocID.
Missing quantity
It is calculated as positive MinStockQty + open customer order quantity − stock in ToLocID − stock in AdditionalLocID (the last term only if AdditionalLocID is set).
Allocation to source bins
- All bin entries (
InvBinItem) of the Artikel inFromLocIDare used. Entries that are referenced by a non-expired picklist item (PLitem) are skipped. - The entries are numbered oldest first (
CreateDate). Only the first MissingQty entries are kept. - The result has one row per Artikel and source Lagerplatz.
MissingQtyis the number of entries taken from that bin.FromBinqtyis the total quantity of the Artikel on that bin. ToLocIDbinName/ToLocIDbinSortNumshow one Lagerplatz of the Artikel inToLocID, if there is one.
Sort order
With SortBy = '1' the rows are sorted by ToLocIDbinSortNum, otherwise by FromLocIDbinSortNum. Within that, rows are sorted by ItemName.
Notes
- Read-only. All tables are read
WITH (NOLOCK), so the result can contain uncommitted data. - The allocation counts bin entries (
InvBinItemrows), not quantities. TheMissingQtyreturned per bin is therefore the number of entries taken from that bin. Its sum over all bins of an Artikel can be lower than the calculated shortage if there are fewer entries. - The selection filter does not subtract the stock of
AdditionalLocID, but the missing quantity does. If the additional location covers the shortage, the missing quantity is 0 or less and the Artikel does not appear. ToLocIDbinNameis taken withTOP 1without anORDER BY. If the Artikel has several Lagerplätze inToLocID, which one is shown is not defined.- The setting is read through
fpixi_GetSetting, whose definition is not attached. If it returnsNULLinstead of an empty value,HALis also excluded. FromLocQtyandMinStockQtycan be empty if no matchingItemLocationSpecificvalue exists.- If
FromLocIDequalsToLocID, the result is always empty.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
FromLocID
Required
|
varchar(3) string |
– |
Source location (Lager) from whose Lagerplätze the goods are taken. Example: |
ToLocID
Required
|
varchar(3) string |
– |
Target location to be refilled. Stock, minimum stock and open customer orders are evaluated for this location. Example: |
AdditionalLocID
|
varchar(3) string |
NULL |
Optional additional location whose stock is subtracted from the missing quantity. If NULL or empty, no additional location is considered. Example: |
SortBy
|
varchar(1) string |
0 |
Sort order of the result. Allowed values
Example: |
Result set 1 · Always (can be empty).
One row per Artikel and source Lagerplatz that should be used to refill the target location.
| Column | Type | Description |
|---|---|---|
FromLocIDbinName
Nullable |
varchar(50) string |
Name of the source Lagerplatz in |
FromLocIDbinSortNum
Nullable |
int |
Sort number of the source Lagerplatz. |
ToLocIDbinName
Nullable |
varchar(50) string |
Name of a Lagerplatz of the Artikel in |
ToLocIDbinSortNum
Nullable |
int |
Sort number of that target Lagerplatz. |
EanUpc
Nullable |
varchar(13) string |
EAN/UPC of the Artikel. |
ItemName
Nullable |
varchar(120) string |
Artikel name. |
ToLocQty
|
int |
Stock of the Artikel in the target location (0 if none). |
FromLocQty
Nullable |
int |
Stock of the Artikel in the source location according to |
FromBinqty
Nullable |
int |
Quantity of the Artikel on this source Lagerplatz (sum of |
MissingQty
Nullable |
int |
Number of bin entries to take from this source Lagerplatz to cover the shortage. |
MinStockQty
Nullable |
int |
Minimum stock of the Artikel in the target location. |
SupplPrice
Nullable |
money decimal |
Supplier price (purchase price) of the Artikel. |
OpenCustOrdersQty
|
int |
Quantity in open customer order lines in the target location (status ANG, BES, BOR, and HAL unless excluded by setting). |
OrdersOnHoldQty
|
int |
Quantity in order lines with status HAL in the target location. |
ParFromLocID
Nullable |
varchar(3) string |
Echo of parameter |
ParToLocID
Nullable |
varchar(3) string |
Echo of parameter |
SortBy
Nullable |
varchar(1) string |
Echo of parameter |
PicLinkSmall
Nullable |
varchar(512) string |
Link to the small Artikel picture. |
PicLinkLarge
Nullable |
varchar(512) string |
Link to the large Artikel picture. |
ItemNrInt
Nullable |
varchar(50) string |
Internal Artikel number. |
TargetStock
Nullable |
int |
Target stock of the Artikel in the target location. |
Response example
<SqlRowSet1>
<row>
<FromLocIDbinName>A-01-03</FromLocIDbinName>
<FromLocIDbinSortNum>103</FromLocIDbinSortNum>
<ToLocIDbinName>S-02-01</ToLocIDbinName>
<ToLocIDbinSortNum>201</ToLocIDbinSortNum>
<EanUpc>4012345678901</EanUpc>
<ItemName>Trinkflasche 0,75 l blau</ItemName>
<ToLocQty>2</ToLocQty>
<FromLocQty>40</FromLocQty>
<FromBinqty>12</FromBinqty>
<MissingQty>3</MissingQty>
<MinStockQty>5</MinStockQty>
<SupplPrice>3.4500</SupplPrice>
<OpenCustOrdersQty>0</OpenCustOrdersQty>
<OrdersOnHoldQty>0</OrdersOnHoldQty>
<ParFromLocID>001</ParFromLocID>
<ParToLocID>002</ParToLocID>
<SortBy>0</SortBy>
<PicLinkSmall>https://shop.example.com/img/s/4711.jpg</PicLinkSmall>
<PicLinkLarge>https://shop.example.com/img/l/4711.jpg</PicLinkLarge>
<ItemNrInt>4711</ItemNrInt>
<TargetStock>10</TargetStock>
</row>
</SqlRowSet1>
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:pixiInventoryItemsToRefill>
<FromLocID>001</FromLocID>
<ToLocID>002</ToLocID>
<!-- <AdditionalLocID>003</AdditionalLocID> -->
<!-- <SortBy>0</SortBy> -->
</ns1:pixiInventoryItemsToRefill>
</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:pixiInventoryItemsToRefill>
<FromLocID>001</FromLocID>
<ToLocID>002</ToLocID>
<!-- <AdditionalLocID>003</AdditionalLocID> -->
<!-- <SortBy>0</SortBy> -->
</ns1:pixiInventoryItemsToRefill>
</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 = [
'FromLocID' => '001',
'ToLocID' => '002',
// 'AdditionalLocID' => '003',
// 'SortBy' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiInventoryItemsToRefill', $soapArguments);
- SQL object:
- dbo.pipiInventoryItemsToRefill