pixiGetShippableOrders
Returns the order lines of orders that can be shipped completely from stock, or a summary of those orders.
Wrapper around pipiReportGetShippableOrders. ShowDetails is converted to a bit and passed as @ViewDetails. The remaining options are fixed: no partial deliveries, no shop filter, @IncludeOrdersWithAnyShipDate = 0, per-location output off.
Which orders are considered
- Order lines with status
ANGorEIN, an item reference (ItemRefnot NULL) andQty > 0. - The order must belong to an existing customer.
- Neither the shipping address nor the billing address of the order may be locked (
ASlocked = 'Y'). - The order must not be locked (
OhSLocked = 'Y'). - The ship date must be empty or earlier than tomorrow. Orders with a ship date in the future are excluded.
Stock check
- Stock is calculated per line by
pixi_CalculateStockForOrderLines, using the locations withSpecialStock = 0. - Only complete orders are returned. If a single line of an order is not shippable, the whole order is left out.
Output
ShowDetails≠ 0 (default1): one row per order line, sorted byOrderNrandOrderlineRef.ShowDetails= 0 or NULL: a single summary row with the number of orders, the order total (sum ofPrice * Qty), the summed shipping cost and the number of picks (sum ofQty).
Currency
- If the setting
MultiCurrencyEnabledis active, prices and shipping costs are converted into the database currency. The conversion uses the exchange rate of the same date, and the currency code is returned indbCurrency. - Otherwise the values stay in the order currency and
dbCurrencyis NULL.
Notes
- All reads use
NOLOCK, so results may include uncommitted data. - The stock calculation in
pixi_CalculateStockForOrderLinesis not attached, so its exact rules (reservations, minimum stock) cannot be documented here. It is called with@SkipZeroStockItemsCalc = 1. - With multi-currency enabled, the code divides by 1 if no matching exchange rate is found. In that case the value silently stays in the order currency.
- In detail mode,
ShipCostis the shipping cost of the whole order and is repeated on every line. Do not add it up per line. - In summary mode, shipping costs are summed over distinct
OrderNr/ShipCostpairs. - If no orders qualify, the summary row still returns
Orders = 0andShipCost = 0;OrderTotalandPicksare then NULL. - For partial deliveries, shop filters or per-location output, call
pixiReportGetShippableOrdersdirectly.
Related calls
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
ShowDetails
|
int | 1 |
Controls the output. Any non-zero value returns one row per order line; 0 or NULL returns one summary row. Allowed values
Example: |
Result set 1 · If ShowDetails is not 0 and not NULL (default)
One row per order line of completely shippable orders, sorted by OrderNr and OrderlineRef.
| Column | Type | Description |
|---|---|---|
OrderlineRef
|
int |
Key of the order line |
OrderNr
Nullable |
int |
Order number |
Qty
|
int |
Ordered quantity of the line |
ItemRef
|
int |
Item reference |
Status
Nullable |
varchar(3) string |
Line status ( |
ShipCost
Nullable |
money decimal |
Shipping cost of the whole order, repeated on each line; converted to the database currency if multi-currency is enabled |
Price
Nullable |
money decimal |
Unit price of the line; converted to the database currency if multi-currency is enabled |
Shippable
|
int |
Always 1 |
dbCurrency
Nullable |
varchar(3) string |
Database currency code if multi-currency is enabled, otherwise NULL |
Result set 2 · If ShowDetails is 0 or NULL
A single summary row over all completely shippable orders.
| Column | Type | Description |
|---|---|---|
Orders
|
int |
Number of distinct shippable orders |
OrderTotal
Nullable |
money decimal |
Sum of |
ShipCost
|
money decimal |
Sum of the shipping costs of the orders (counted once per order) |
Picks
Nullable |
int |
Sum of the quantities of all lines |
dbCurrency
Nullable |
varchar(3) string |
Database currency code if multi-currency is enabled, otherwise NULL |
Response example
<SqlRowSet1>
<row>
<OrderlineRef>50211</OrderlineRef>
<OrderNr>10234</OrderNr>
<Qty>2</Qty>
<ItemRef>1622</ItemRef>
<Status>ANG</Status>
<ShipCost>4.9000</ShipCost>
<Price>19.9900</Price>
<Shippable>1</Shippable>
</row>
<row>
<OrderlineRef>50212</OrderlineRef>
<OrderNr>10234</OrderNr>
<Qty>1</Qty>
<ItemRef>1730</ItemRef>
<Status>ANG</Status>
<ShipCost>4.9000</ShipCost>
<Price>9.5000</Price>
<Shippable>1</Shippable>
</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:pixiGetShippableOrders>
<!-- <ShowDetails>1</ShowDetails> -->
</ns1:pixiGetShippableOrders>
</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:pixiGetShippableOrders>
<!-- <ShowDetails>1</ShowDetails> -->
</ns1:pixiGetShippableOrders>
</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 = [
// 'ShowDetails' => '1',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetShippableOrders', $soapArguments);
- SQL object:
- dbo.pipiGetShippableOrders