pixiReportInventoryItemsToRefillMinStock
Returns a pick list of items to move from a source location to a target location, with the quantity per source bin, computed by one of three refill modes.
The call passes all parameters unchanged to the internal report procedure Report_InventoryItemsToRefillMinStock and returns its result.
Step 1 – candidate items
An item is a candidate only if:
FromLocIDandToLocIDare different,- the item has an
ItemLocationSpecificrecord for bothFromLocIDandToLocID, - the item is assigned to at least one bin (
InvBinItem/InvBin) atFromLocID, - the calculated missing quantity is greater than 0.
Open order quantities are summed from Orderlines of the item at an order location. The order location is ToLocID for Type 1 and 3 and FromLocID otherwise. Statuses ANG, BES and BOR count as open customer orders, HAL counts as orders on hold. If the setting InventoryItemsToRefill_NoHAL is 1, on-hold quantities are ignored in the calculations.
The available stock at the source is the location quantity at FromLocID, minus the minimum stock of FromLocID (only if MinStock = 1 and Type = 2), minus the open customer order quantity (only if the order location is FromLocID), minus the on-hold quantity (unless the setting excludes it).
The missing quantity at the additional location is minimum stock minus location quantity at AdditionalLocID, or 0 if it is not below minimum.
The missing quantity depends on Type:
1: demand = open customer orders atToLocID+ on-hold quantity + minimum stock ofToLocID(only ifMinStock= 1). If the demand fits into the available stock, the target is missing quantity at the additional location + demand, otherwise the available stock. The result is the target minus the current stock atToLocID, never below 0.2: the missing quantity at the additional location, limited to the available stock at the source.3: only if the minimum stock atToLocIDis 0, the stock atAdditionalLocIDis 0, the stock atFromLocIDis greater than 0 and there are open customer orders atToLocID. The result is the smaller value of open customer orders and stock atFromLocID.
Step 2 – distribution over bins
For each candidate, the item's InvBinItem records in bins at FromLocID are numbered by InvBinItemKey. Only the first n records are used, where n is the missing quantity. The rows are grouped per source bin. In the output, MissingQty is the number of these records in that bin. This equals a piece count if each bin record stands for one piece. One bin at ToLocID is added as the target bin, if there is one.
Sort order
If SortBy = 1, rows are sorted by the sort number of the target bin, otherwise by the sort number of the source bin. Within that, rows are sorted by ItemName.
Notes
- The header comment of the wrapper describes it as calling the 1SS Report for billing purposes.
Typedefaults toNULLin the wrapper. WithNULLor any value other than 1, 2 or 3, the missing quantity isNULLand the call returns no rows. Always passType.- The missing quantity at the additional location comes from an outer join. If
AdditionalLocIDisNULLor the item has noItemLocationSpecificrecord there, the value isNULL, not 0:Type2 andType3 then return no row for the item.Type1 only returns a row if the demand exceeds the available stock.
- The target bin is taken with
TOP 1without anORDER BY. For items with several bins atToLocID, the bin shown is not deterministic. - The value of the setting
InventoryItemsToRefill_NoHALis read at runtime viafPIXI_GetSetting; that function is not attached. - All reads use
NOLOCK, so results can include uncommitted data. - The call only reads data. It uses a temporary table internally.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
FromLocID
Required
|
varchar(3) string |
– |
Source location from which stock is taken. The item must have bins and an Example: |
MinStock
|
bit boolean |
1 |
Controls whether minimum stock is considered. For Allowed values
Example: |
ToLocID
Required
|
varchar(3) string |
– |
Target location to be refilled. Must differ from Example: |
AdditionalLocID
|
varchar(3) string |
NULL |
Additional location whose shortfall below minimum stock is included ( Example: |
SortBy
|
varchar(1) string |
NULL |
Sort order of the result. The value is also returned in the Allowed values
Example: |
Type
|
int | NULL |
Calculation mode for the missing quantity. Without a valid value, no rows are returned. Allowed values
Example: |
Result set 1 · Always; empty if no item qualifies, if FromLocID = ToLocID or if Type is not 1, 2 or 3
One row per item and source bin with the quantity to move from that bin.
| Column | Type | Description |
|---|---|---|
FromLocIDbinName
|
string |
Name of the source bin at |
FromLocIDbinSortNum
Nullable |
int |
Sort number of the source bin |
ToLocIDbinName
Nullable |
string |
Name of a bin of the item at |
ToLocIDbinSortNum
Nullable |
int |
Sort number of the target bin |
EanUpc
Nullable |
string |
EAN/UPC of the item |
ItemName
Nullable |
string |
Item name |
ToLocQty
|
int |
Current location quantity at |
FromLocQty
Nullable |
int |
Current location quantity at |
MinStockQty
Nullable |
int |
Minimum stock of |
SupplPrice
Nullable |
decimal |
Supplier price of the item ( |
OpenCustOrdersQty
|
int |
Quantity in order lines with status |
OrdersOnHoldQty
|
int |
Quantity in order lines with status |
ParFromLocID
|
varchar(3) string |
Echo of parameter |
ParToLocID
|
varchar(3) string |
Echo of parameter |
SortBy
Nullable |
varchar(1) string |
Echo of parameter |
MissingQty
|
int |
Number of bin records of the item in this source bin that are used to cover the missing quantity |
FromBinqty
Nullable |
int |
Total quantity of the item in this source bin (sum of |
PicLinkSmall
Nullable |
string |
Link to the small item picture |
PicLinkLarge
Nullable |
string |
Link to the large item picture |
Response example
<SqlRowSet1>
<row>
<FromLocIDbinName>A-01-03</FromLocIDbinName>
<FromLocIDbinSortNum>103</FromLocIDbinSortNum>
<ToLocIDbinName>S-12-01</ToLocIDbinName>
<ToLocIDbinSortNum>1201</ToLocIDbinSortNum>
<EanUpc>4012345678901</EanUpc>
<ItemName>Trinkflasche 750 ml</ItemName>
<ToLocQty>2</ToLocQty>
<FromLocQty>40</FromLocQty>
<MinStockQty>5</MinStockQty>
<SupplPrice>3.20</SupplPrice>
<OpenCustOrdersQty>4</OpenCustOrdersQty>
<OrdersOnHoldQty>0</OrdersOnHoldQty>
<ParFromLocID>002</ParFromLocID>
<ParToLocID>001</ParToLocID>
<SortBy>1</SortBy>
<MissingQty>7</MissingQty>
<FromBinqty>12</FromBinqty>
<PicLinkSmall>https://shop.example.com/img/s/4711.jpg</PicLinkSmall>
<PicLinkLarge>https://shop.example.com/img/l/4711.jpg</PicLinkLarge>
</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:pixiReportInventoryItemsToRefillMinStock>
<FromLocID>002</FromLocID>
<!-- <MinStock>1</MinStock> -->
<ToLocID>001</ToLocID>
<!-- <AdditionalLocID>003</AdditionalLocID> -->
<!-- <SortBy>1</SortBy> -->
<!-- <Type>1</Type> -->
</ns1:pixiReportInventoryItemsToRefillMinStock>
</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:pixiReportInventoryItemsToRefillMinStock>
<FromLocID>002</FromLocID>
<!-- <MinStock>1</MinStock> -->
<ToLocID>001</ToLocID>
<!-- <AdditionalLocID>003</AdditionalLocID> -->
<!-- <SortBy>1</SortBy> -->
<!-- <Type>1</Type> -->
</ns1:pixiReportInventoryItemsToRefillMinStock>
</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' => '002',
// 'MinStock' => '1',
'ToLocID' => '001',
// 'AdditionalLocID' => '003',
// 'SortBy' => '1',
// 'Type' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReportInventoryItemsToRefillMinStock', $soapArguments);
- SQL object:
- dbo.pipiReportInventoryItemsToRefillMinStock