pixiReport1SS
Returns monthly package statistics from invoices for billing: total packages, single-item packages and packages flagged as 1SS, with size classes.
Runs the internal report procedure Report_1SS, which is used for billing purposes. The call takes no parameters.
How the report is built:
- Every invoice (table
invoices) withtotal >= 0counts as one package. Credit notes with a negative total are excluded. - Invoices are grouped by calendar month, using the month offset between
invdateand the current date.MonthandYearcome from the latest invoice date in each group. - For each month the report counts:
Packages: all invoices.Packages_1item: invoices whose invoice lines (invlines) add up to a totalitemqtyof exactly 1.Packages_1ss: invoices whose flag column1SSequals 1.
- Derived values:
Packages_1item_Percentage: share of single-item packages. The ratio is rounded to two decimals and then multiplied by 100, so the result is a whole percent.Class_1item/Class_1SS: size class of the count. Up to 1000 isSmall, up to 2500Medium, up to 5000Large, up to 10000Extra Large, above thatXXL.Extra10000_1Item/Extra10000_1SS: number of complete blocks of 10,000 (integer division).
There is no date filter, so every month in the invoice history is returned. Rows are sorted by Year, then Month, ascending.
Notes
- All reads use
NOLOCK, so the figures can include uncommitted data. - The report scans the complete
invoicesandinvlinestables without a date filter. On large databases this can be slow. - An invoice counts as a single-item package if the sum of
itemqtyover all its lines is 1. This is also true when several lines add up to 1. Invoices without any lines never count as single-item packages. - Invoices with a NULL
invdateform a separate group, in whichMonthandYearare NULL.
Tables used
This call has no parameters.
Result set 1 · Always
One row per calendar month of the invoice history, sorted by year and month.
| Column | Type | Description |
|---|---|---|
Month
Nullable |
int |
Month (1–12) of the latest invoice date in the group. |
Year
Nullable |
int |
Year of the latest invoice date in the group. |
Packages
|
int |
Number of invoices with a total >= 0 in this month. |
Packages_1item
|
int |
Number of invoices whose line quantities add up to exactly 1. |
Packages_1item_Percentage
|
numeric decimal |
Share of single-item packages in percent. The ratio is rounded to two decimals before it is multiplied by 100. |
Class_1item
|
varchar(11) string |
Size class of |
Packages_1ss
|
int |
Number of invoices with the flag |
Extra10000_1Item
|
int |
Number of complete blocks of 10,000 single-item packages (integer division). |
Class_1SS
|
varchar(11) string |
Size class of |
Extra10000_1SS
|
int |
Number of complete blocks of 10,000 1SS packages (integer division). |
Response example
<SqlRowSet1>
<row>
<Month>4</Month>
<Year>2024</Year>
<Packages>8250</Packages>
<Packages_1item>3120</Packages_1item>
<Packages_1item_Percentage>38.0000</Packages_1item_Percentage>
<Class_1item>Large</Class_1item>
<Packages_1ss>2140</Packages_1ss>
<Extra10000_1Item>0</Extra10000_1Item>
<Class_1SS>Medium</Class_1SS>
<Extra10000_1SS>0</Extra10000_1SS>
</row>
<row>
<Month>5</Month>
<Year>2024</Year>
<Packages>27400</Packages>
<Packages_1item>12650</Packages_1item>
<Packages_1item_Percentage>46.0000</Packages_1item_Percentage>
<Class_1item>XXL</Class_1item>
<Packages_1ss>9800</Packages_1ss>
<Extra10000_1Item>1</Extra10000_1Item>
<Class_1SS>Extra Large</Class_1SS>
<Extra10000_1SS>0</Extra10000_1SS>
</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:pixiReport1SS/>
</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:pixiReport1SS/>
</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 = [
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReport1SS', $soapArguments);
- SQL object:
- dbo.pipiReport1SS