pixiReport_InvoicesList
Returns a detailed list of invoices and credit notes in a date range, with amounts, VAT, purchase values, address and payment data.
Wrapper around the internal report procedure Report_InvoicesList. Empty strings in ShopID, Payment, ShipCountry and DocumentType are treated as NULL (no filter). The report always returns one row per invoice; the sum mode and the unpaid-only filter of the internal procedure are not available through this call.
Processing steps:
- The supplier price cache is refreshed first (
Report_SaveSupplierPrices). DateFromis moved to the start of its day andDateToto the end of its day. Invoices withInvDatein this range are selected.- Optional filters:
ShopID: only invoices whose shipping address belongs to this shop (AddrShopID). Invoices without a shipping address are then excluded.Payment: only invoices with this payment method code.ShipCountry: only invoices whose shipping address has this country code.DocumentType:R= invoices only (no reference invoice),G= credit notes only (with reference invoice).
- Currency of the amounts:
- With
ShopID: amounts are in the invoice's base currency (divided by the invoice exchange rate if multi-currency is enabled);BaseCurrencyis that currency code. - Without
ShopID: amounts are converted to the database currency using the exchange rate of the database source for the same date and currency;BaseCurrencyis the database currency code.
- With
- Per invoice, the item quantity (
SumQtyItems) and the purchase value (SumEKItems, quantity × historical supplier price) are summed from the invoice lines. The external order number is determined via the order linked to the invoice (for credit notes via the referenced invoice). - Net amounts and VAT amounts are rounded to the number of decimal places from the setting
NumberOfDecimalPlacesForPrices(default 2).TotalandTotal_ShipCostare not rounded.
Name, address, phone and fax come from the shipping address; Country, CountryName and usStID come from the billing address. Missing text values are returned as /. The result is sorted by InvoiceNR. The par_* columns echo the effective filter values (-alle- if no filter was set).
Notes
- Side effect: before reading, the internal procedure
Report_SaveSupplierPricesis executed, which according to the code comment fills a cache table (presumably the supplier price history). Its definition is not attached, so the exact writes are unknown. - All reads use
NOLOCK; the result may contain uncommitted data. - Invoices without a matching exchange rate record are not returned (inner joins on
pixi.ExchRate). WithoutShopID, an exchange rate of the database source for the same date and currency must exist. - A
DocumentTypeother thanRorGreturns no rows. payedis returned as1900-01-01T00:00:00for unpaid invoices, becauseNULLis replaced by an empty string on a datetime column.SumEKItemsis 0 or incomplete if no supplier price history exists for the invoice lines.- If the order lookup function returns several orders for one invoice, the invoice can appear in several rows.
- The behaviour depends on the settings
MultiCurrencyEnabledandNumberOfDecimalPlacesForPrices. - Large date ranges can be slow because all invoice lines are aggregated.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
DateFrom
Required
|
datetime dateTime |
– |
Start of the invoice date range; the time is set to the start of the day. Example: |
DateTo
Required
|
datetime dateTime |
– |
End of the invoice date range; the time is set to the end of the day. Example: |
ShopID
|
char(3) string |
NULL |
Shop of the shipping address. If set, only invoices of this shop are returned and amounts are in the invoice base currency; otherwise in the database currency. Empty = all shops. Example: |
Payment
|
char(1) string |
NULL |
Payment method code of the invoice. Empty = all payment methods. Example: |
ShipCountry
|
varchar(3) string |
NULL |
Country code of the shipping address. Empty = all countries. Example: |
DocumentType
|
char(1) string |
NULL |
Document type filter. Empty = invoices and credit notes. Allowed values
Example: |
Result set 1 · Always (one row per matching invoice, can be empty)
Invoice list sorted by InvoiceNR.
| Column | Type | Description |
|---|---|---|
InvoiceKey
|
int |
Internal invoice key. |
RefInvoiceNR
|
varchar(20) string |
Number of the referenced invoice for credit notes, otherwise empty. |
payed
|
datetime dateTime |
Payment date; 1900-01-01 if not paid. |
InvDate
Nullable |
datetime dateTime |
Invoice date. |
InvoiceNR
Nullable |
varchar(20) string |
Invoice number. |
Total
Nullable |
decimal(19,9) decimal |
Gross total (not rounded). |
Total_NoVAT
Nullable |
decimal(19,9) decimal |
Net total, rounded. |
Total_Items_NoVAT
Nullable |
decimal(19,9) decimal |
Net total without net shipping cost, rounded. |
ShipCost_NoVAT
Nullable |
decimal(19,9) decimal |
Net shipping cost, rounded. |
Total_ShipCost
Nullable |
decimal(19,9) decimal |
Gross shipping cost (not rounded). |
VATHigh
Nullable |
decimal(19,9) decimal |
VAT at the high rate incl. shipping and return costs, rounded. |
VATLow
Nullable |
decimal(19,9) decimal |
VAT at the reduced rate incl. shipping and return costs, rounded. |
VATHighPerc
Nullable |
numeric(18,4) decimal |
High VAT rate in percent. |
VATLowPerc
Nullable |
numeric(18,4) decimal |
Reduced VAT rate in percent. |
SumQtyItems
|
int |
Total item quantity of the invoice lines. |
Order_Nr_Extern
Nullable |
varchar(50) string |
External order number of the related order. |
SumEKItems
|
decimal(19,9) decimal |
Purchase value: sum of quantity × historical supplier price. |
AccountNR
Nullable |
varchar(10) string |
DATEV account number of the customer. |
Anrede
|
varchar(60) string |
Salutation (shipping address), |
Name
|
varchar(121) string |
Name (shipping address), |
FirstName
|
varchar(60) string |
First name (shipping address). |
LastName
|
varchar(60) string |
Last name (shipping address). |
Name2
|
varchar(60) string |
Care-of line (shipping address). |
Address
|
varchar(110) string |
Street (shipping address). |
ZIP
|
varchar(10) string |
Postal code (shipping address). |
City
|
varchar(50) string |
City (shipping address). |
Country
|
varchar(3) string |
Country code of the billing address. |
CountryName
Nullable |
varchar(60) string |
Country name of the billing address, |
Phone
|
varchar(60) string |
Phone (shipping address). |
Fax
|
varchar(60) string |
Fax (shipping address). |
ShipCountry
|
varchar(3) string |
Country code of the shipping address. |
ShipCountryName
Nullable |
varchar(60) string |
Country name of the shipping address, |
AddrShopID
|
varchar(3) string |
Shop of the shipping address. |
PaymentText
|
varchar(120) string |
Name of the payment method, |
usStID
|
varchar(20) string |
VAT ID of the billing address. |
par_DateFrom
|
datetime dateTime |
Effective start of the date range. |
par_DateTo
|
datetime dateTime |
Effective end of the date range. |
par_ShopID
|
char(10) string |
Shop filter or |
par_Payment
|
char(10) string |
Payment filter or |
par_ShipCountry
|
varchar(10) string |
Shipping country filter or |
Par_DocumentType
|
char(10) string |
Document type filter or |
BaseCurrency
Nullable |
varchar(3) string |
Currency of the amounts: invoice base currency (with |
Response example
<SqlRowSet1>
<row>
<InvoiceKey>48211</InvoiceKey>
<RefInvoiceNR/>
<payed>2024-01-12T00:00:00</payed>
<InvDate>2024-01-10T14:22:05</InvDate>
<InvoiceNR>RE2024-00123</InvoiceNR>
<Total>119.000000000</Total>
<Total_NoVAT>100.000000000</Total_NoVAT>
<Total_Items_NoVAT>95.800000000</Total_Items_NoVAT>
<ShipCost_NoVAT>4.200000000</ShipCost_NoVAT>
<Total_ShipCost>5.000000000</Total_ShipCost>
<VATHigh>19.000000000</VATHigh>
<VATLow>0.000000000</VATLow>
<VATHighPerc>19.0000</VATHighPerc>
<VATLowPerc>7.0000</VATLowPerc>
<SumQtyItems>2</SumQtyItems>
<Order_Nr_Extern>100045678</Order_Nr_Extern>
<SumEKItems>54.300000000</SumEKItems>
<AccountNR>10023</AccountNR>
<Anrede>Herr</Anrede>
<Name>Max Mustermann</Name>
<FirstName>Max</FirstName>
<LastName>Mustermann</LastName>
<Name2>/</Name2>
<Address>Musterstr. 1</Address>
<ZIP>80331</ZIP>
<City>München</City>
<Country>DE</Country>
<CountryName>Deutschland</CountryName>
<Phone>/</Phone>
<Fax>/</Fax>
<ShipCountry>DE</ShipCountry>
<ShipCountryName>Deutschland</ShipCountryName>
<AddrShopID>SHP</AddrShopID>
<PaymentText>Vorkasse</PaymentText>
<usStID>/</usStID>
<par_DateFrom>2024-01-01T00:00:00</par_DateFrom>
<par_DateTo>2024-01-31T23:59:59.997</par_DateTo>
<par_ShopID>-alle- </par_ShopID>
<par_Payment>-alle- </par_Payment>
<par_ShipCountry>-alle-</par_ShipCountry>
<Par_DocumentType>R </Par_DocumentType>
<BaseCurrency>EUR</BaseCurrency>
</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:pixiReport_InvoicesList>
<DateFrom>2024-01-01T00:00:00</DateFrom>
<DateTo>2024-01-31T00:00:00</DateTo>
<!-- <ShopID>SHP</ShopID> -->
<!-- <Payment>V</Payment> -->
<!-- <ShipCountry>DE</ShipCountry> -->
<!-- <DocumentType>R</DocumentType> -->
</ns1:pixiReport_InvoicesList>
</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:pixiReport_InvoicesList>
<DateFrom>2024-01-01T00:00:00</DateFrom>
<DateTo>2024-01-31T00:00:00</DateTo>
<!-- <ShopID>SHP</ShopID> -->
<!-- <Payment>V</Payment> -->
<!-- <ShipCountry>DE</ShipCountry> -->
<!-- <DocumentType>R</DocumentType> -->
</ns1:pixiReport_InvoicesList>
</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 = [
'DateFrom' => '2024-01-01T00:00:00',
'DateTo' => '2024-01-31T00:00:00',
// 'ShopID' => 'SHP',
// 'Payment' => 'V',
// 'ShipCountry' => 'DE',
// 'DocumentType' => 'R',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiReport_InvoicesList', $soapArguments);
- SQL object:
- dbo.pipiReport_InvoicesList