pixiReportReceivedOrders
Returns the number of orders created in a time range (default: today from 0:00 until now), optionally filtered by shop and grouped by location.
Dashboard report that counts received orders by their creation date (OrderHeader.CreateDate).
Time range
FromTimedefaults to the start of the current day (0:00).UntilTimedefaults to the current date and time.- Both bounds are inclusive.
Shop filter
- If
ShopIDis set, only orders that have at least one order line withOrdShopID=ShopIDare counted. An empty string or NULL means all shops.
Mode depends on PerLocation
0(default, also used for NULL): counts all orders in the range that have at least one order line (matching the shop filter). The count is returned as a single row with columnReceivedOrdersand is also written to the output parameterReceivedOrders.1: joins orders with their order lines and returns one row perLocationIDof the order lines with the number of distinct orders per location. No sort order is applied.
Notes
- All reads use
NOLOCK, so counts may include uncommitted data. - The output parameter
MinutesSinceRefreshis never set by the procedure and always returns NULL. - In per-location mode the output parameter
ReceivedOrdersis not set. An order with lines in several locations is counted once for each location, so the sum of all rows can exceed the total count of mode0. - Orders without any order lines are never counted.
- Because of
NULLIF(..., '')on datetime values, passing1900-01-01 00:00:00forFromTimeorUntilTimeis treated like NULL and replaced with the default. - The parameter
PerLocationis marked with the code comment "old way".
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
FromTime
|
datetime dateTime |
NULL |
Start of the time range (inclusive) for the order creation date. Defaults to today 0:00. Example: |
UntilTime
|
datetime dateTime |
NULL |
End of the time range (inclusive). Defaults to the current date and time. Example: |
ShopID
|
varchar(3) string |
NULL |
Optional shop filter on Example: |
ReceivedOrders
OUTPUT
|
int | NULL |
Output: number of received orders. Only set when |
MinutesSinceRefresh
OUTPUT
|
int | NULL |
Output parameter that is never set by the procedure; always NULL. |
PerLocation
|
bit boolean |
0 |
Selects the output mode: total count or count per location. NULL is treated as 0. Allowed values
Example: |
Result set 1 · If PerLocation = 0 (default)
Single row with the total number of received orders in the time range.
| Column | Type | Description |
|---|---|---|
ReceivedOrders
|
int |
Number of orders created in the time range that have at least one matching order line. |
Result set 2 · If PerLocation = 1
One row per location of the order lines with the number of distinct orders.
| Column | Type | Description |
|---|---|---|
LocationID
Nullable |
int |
Location of the order lines ( |
ReceivedOrders
|
int |
Number of distinct orders with at least one line in this location. |
Response example
<SqlRowSet1>
<row>
<ReceivedOrders>127</ReceivedOrders>
</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:pixiReportReceivedOrders>
<!-- <FromTime>2024-05-14T00:00:00</FromTime> -->
<!-- <UntilTime>2024-05-14T18:30:00</UntilTime> -->
<!-- <ShopID>ABC</ShopID> -->
<!-- <ReceivedOrders>?</ReceivedOrders> -->
<!-- <MinutesSinceRefresh>?</MinutesSinceRefresh> -->
<!-- <PerLocation>0</PerLocation> -->
</ns1:pixiReportReceivedOrders>
</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:pixiReportReceivedOrders>
<!-- <FromTime>2024-05-14T00:00:00</FromTime> -->
<!-- <UntilTime>2024-05-14T18:30:00</UntilTime> -->
<!-- <ShopID>ABC</ShopID> -->
<!-- <ReceivedOrders>?</ReceivedOrders> -->
<!-- <MinutesSinceRefresh>?</MinutesSinceRefresh> -->
<!-- <PerLocation>0</PerLocation> -->
</ns1:pixiReportReceivedOrders>
</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 = [
// 'FromTime' => '2024-05-14T00:00:00',
// 'UntilTime' => '2024-05-14T18:30:00',
// 'ShopID' => 'ABC',
// 'ReceivedOrders' => '?',
// 'MinutesSinceRefresh' => '?',
// 'PerLocation' => '0',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReportReceivedOrders', $soapArguments);
- SQL object:
- dbo.pipiReportReceivedOrders