pixiReportGetUnshippableOrders
Returns open order lines that cannot be shipped because of missing stock, either as a summary row or as a per-line detail list.
The call is a wrapper around the internal procedure Report_GetUnshippableOrders. It always passes OrderlineStatus = NULL and ShopId = NULL, so all statuses and all shops are evaluated. It captures the result in a temporary table and returns a subset of the columns.
Selection of order lines
- Order lines must have status
ANGorHAL, a setItemRefandQty > 0. - Only orders are considered that have at least one such line in a location with
SpecialStock = 0. IfLocIDis given, that location must be the one. An empty string counts as no filter. - If
IncludeCustLockis0or not sent, two kinds of orders are excluded:- orders whose customer has
SLockedset to a value other thanN/NULL - orders whose shipping address is locked (
ASlocked = 'Y')
- orders whose customer has
- If
IncludeCustLockis1, locked customers and addresses are included. - For all
ANG/HALlines of the candidate orders, the internal procedurepixi_CalculateStockForOrderLinescalculates whether each line can be shipped. Only lines with reservation info that are not shippable are returned.
Output depending on ViewDetails
0: exactly one summary row with these values:Orders: number of distinct ordersOrderTotal: sum of line pricesShipCost: sum of shipping costs, counted once per orderDiffrentCustomers: number of distinct customersMissingArticles: sum of quantitiesDiffrentArticles: number of distinct itemsdbCurrency
1: one row per unshippable order line. The rows carry no defined sort order.
All amounts are converted into the database currency if the setting MultiCurrencyEnabled is active.
Notes
- Always send
ViewDetailsexplicitly. The wrapper checksViewDetails = 0. A NULL value (the default) therefore takes the detail branch. The inner procedure, however, treats NULL as0and returns the 7-column summary. TheINSERT ... EXECinto the 21-column detail table then most likely fails with a column mismatch error. - The header comment mentions order status OPEN/HOLD and line status
NLB. The code only filters line statusesANGandHALand does not check the order status. - The
LocIDfilter only selects candidate orders. Once an order qualifies, all itsANG/HALlines are evaluated, including lines in other locations. - The shippability logic is in
pixi_CalculateStockForOrderLines, which is not attached. It is called withSkipZeroStockItemsCalc = 1. The exact stock and reservation rules cannot be derived here. OrderTotalandPriceare based on the line fieldPriceand are not multiplied byQty.- In the detail list,
ShipCostrepeats the order's shipping cost on every line. SLockedis not the customer's lock flag. It reflects the parameter:YifIncludeCustLock = 1, otherwiseN.Shippableis always0.dbCurrencyis only filled whenMultiCurrencyEnabledis active, otherwise it is NULL. Amounts are divided by the exchange rate of the matching date. If no rate is found, the value is left unconverted.- In the summary,
OrderTotal,MissingArticlesandDiffrentArticlescan be NULL or 0 when no unshippable lines exist, but a row is still returned. - All reads use
NOLOCK, so uncommitted data may be included.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ViewDetails
|
bit boolean |
NULL |
Selects the output format: summary row or detail list per order line. Should always be sent explicitly (see notes). Allowed values
Example: |
IncludeCustLock
|
bit boolean |
NULL |
Whether orders of locked customers and orders with locked shipping addresses are included. NULL is treated as 0. Allowed values
Example: |
LocID
|
varchar(3) string |
NULL |
Optional location ID. Only orders with at least one relevant line in this location (with Example: |
Result set 1 · If ViewDetails = 0; always exactly one row.
Summary of all unshippable order lines.
| Column | Type | Description |
|---|---|---|
Orders
Nullable |
int |
Number of distinct orders with unshippable lines. |
OrderTotal
Nullable |
money decimal |
Sum of the line prices (not multiplied by quantity), in database currency. |
ShipCost
Nullable |
money decimal |
Sum of shipping costs of the affected orders, counted once per order, in database currency. |
DiffrentCustomers
Nullable |
int |
Number of distinct customers. |
MissingArticles
Nullable |
int |
Sum of the quantities of the unshippable lines. |
DiffrentArticles
Nullable |
int |
Number of distinct items. |
dbCurrency
Nullable |
varchar(3) string |
Database currency code; NULL if multi-currency is disabled. |
Result set 2 · If ViewDetails = 1.
One row per unshippable order line.
| Column | Type | Description |
|---|---|---|
OrderlineKey
Nullable |
int |
Key of the order line. |
OrderNr
Nullable |
int |
Order number. |
Qty
Nullable |
int |
Ordered quantity of the line. |
ItemRef
Nullable |
int |
Item key. |
Status
Nullable |
varchar(3) string |
Order line status ( |
ShipCost
Nullable |
money decimal |
Shipping cost of the order (repeated per line), in database currency. |
Price
Nullable |
money decimal |
Line price in database currency. |
SLocked
Nullable |
varchar(1) string |
|
CustRef
Nullable |
int |
Customer key of the order line. |
Shippable
|
int |
Always 0. |
OrderDate
Nullable |
datetime dateTime |
Order date. |
ItemNrInt
Nullable |
varchar(50) string |
Internal item number. |
dbCurrency
Nullable |
varchar(3) string |
Database currency code; NULL if multi-currency is disabled. |
Response example
<SqlRowSet1>
<row>
<Orders>42</Orders>
<OrderTotal>3189.5000</OrderTotal>
<ShipCost>209.5800</ShipCost>
<DiffrentCustomers>39</DiffrentCustomers>
<MissingArticles>77</MissingArticles>
<DiffrentArticles>25</DiffrentArticles>
<dbCurrency>EUR</dbCurrency>
</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:pixiReportGetUnshippableOrders>
<!-- <ViewDetails>1</ViewDetails> -->
<!-- <IncludeCustLock>0</IncludeCustLock> -->
<!-- <LocID>001</LocID> -->
</ns1:pixiReportGetUnshippableOrders>
</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:pixiReportGetUnshippableOrders>
<!-- <ViewDetails>1</ViewDetails> -->
<!-- <IncludeCustLock>0</IncludeCustLock> -->
<!-- <LocID>001</LocID> -->
</ns1:pixiReportGetUnshippableOrders>
</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 = [
// 'ViewDetails' => '1',
// 'IncludeCustLock' => '0',
// 'LocID' => '001',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReportGetUnshippableOrders', $soapArguments);
- SQL object:
- dbo.pipiReportGetUnshippableOrders