pixiReportShippedOrders
Returns dashboard counts of shipped invoices for the given day, the previous day, the current month up to the end date and the previous month.
Counts shipments for a dashboard. A shipment is a record in Invoices with a ScanOutDate. Only invoices with at least one order line (Orderlines.InvRef) are counted. Each invoice counts once, so the values are invoice counts, not order counts.
How the parameters work:
EndDatedefaults to the current date and time (GETDATE()). It is the reference date for all periods.StartDatedefaults to the first day of the month beforeEndDate. It is only used for the given-day value, and only if it is on the same calendar day asEndDate. IfStartDateis later thanEndDate, it is set toEndDate.ShopIDlimits the count to invoices that have at least one order line withOrdShopID=ShopID. An empty value orNULLmeans all shops.
The call first collects all matching invoices whose ScanOutDate lies between the start of the previous month and the end of the EndDate day. It then returns one row with four counts (all ranges include both ends):
ShipoutOnGivenDay: fromStartDate(same day) or else midnight of theEndDateday, up toEndDate.ShipoutOnPreviousDay: the whole calendar day beforeEndDate.ShipoutInGivenMonth: from the 1st of theEndDatemonth, 00:00, up toEndDate.ShipoutInPreviousMonth: the whole previous calendar month.
Notes
- All four counts are uppercase-free strings in SQL terms: they are stored in
varchar(10)variables, so they come back as strings, not integers. - The counts run up to
EndDateitself, not to the end of that day. IfEndDateis passed without a time (midnight),ShipoutOnGivenDayonly counts invoices scanned exactly at midnight, andShipoutInGivenMonthleaves out the wholeEndDateday. Pass a time such as 23:59:59, or omitEndDateto use the current time. StartDatecannot be used for a range over several days. If it is on another day thanEndDate, it is ignored and the given-day count starts at midnight of theEndDateday.- Reads use
NOLOCK, so the counts can include uncommitted data. - If an error occurs, the message is only printed and the procedure returns -1 without any result set.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
StartDate
|
datetime dateTime |
NULL |
Start time for the given-day count. Only used if it is on the same calendar day as Example: |
EndDate
|
datetime dateTime |
NULL |
Reference date and time. All periods are calculated from it, and the given-day and given-month counts run up to this moment. Default: current date and time. Example: |
ShopID
|
varchar(3) string |
– |
Shop filter. Only invoices with at least one order line of this shop ( Example: |
Result set 1 · On success (not returned if an error occurs inside the TRY block)
One row with the four shipment counts.
| Column | Type | Description |
|---|---|---|
ShipoutOnGivenDay
|
varchar(10) string |
Number of invoices with |
ShipoutOnPreviousDay
Nullable |
varchar(10) string |
Number of invoices scanned out on the whole calendar day before |
ShipoutInGivenMonth
Nullable |
varchar(10) string |
Number of invoices scanned out from the 1st of the |
ShipoutInPreviousMonth
Nullable |
varchar(10) string |
Number of invoices scanned out in the whole previous calendar month. |
Response example
<SqlRowSet1>
<row>
<ShipoutOnGivenDay>142</ShipoutOnGivenDay>
<ShipoutOnPreviousDay>318</ShipoutOnPreviousDay>
<ShipoutInGivenMonth>4127</ShipoutInGivenMonth>
<ShipoutInPreviousMonth>8954</ShipoutInPreviousMonth>
</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:pixiReportShippedOrders>
<!-- <StartDate>2024-05-15T08:00:00</StartDate> -->
<!-- <EndDate>2024-05-15T17:30:00</EndDate> -->
<!-- <ShopID>SHP</ShopID> -->
</ns1:pixiReportShippedOrders>
</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:pixiReportShippedOrders>
<!-- <StartDate>2024-05-15T08:00:00</StartDate> -->
<!-- <EndDate>2024-05-15T17:30:00</EndDate> -->
<!-- <ShopID>SHP</ShopID> -->
</ns1:pixiReportShippedOrders>
</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 = [
// 'StartDate' => '2024-05-15T08:00:00',
// 'EndDate' => '2024-05-15T17:30:00',
// 'ShopID' => 'SHP',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReportShippedOrders', $soapArguments);
- SQL object:
- dbo.pipiReportShippedOrders