pixiGetMatchesForDeliveredItem
Returns the supplier order lines that are matched to one item line of a supplier delivery document, with ordered, received, open and matched quantities.
Returns the matches (BuyingMatch records) between one line of a supplier delivery document and the supplier order lines it was booked against.
- Only matches whose delivery reference equals
SDelDkeyare considered. - Each match is joined to its supplier order line and the supplier order. Matches without an existing order line or order are not returned.
- The rows are grouped by order date and supplier order line, so there is one row per matched order line:
OrderNris the internal number of the supplier order,OrderIdits ID.OrderQty,QtyReceivedandQtyNotDeliveredcome from the order line (QtyNotDeliveredis0if no value is stored).BuyingMatchQtyis the sum of all matched quantities of this delivery line for the order line.SupplNameis the name of the supplier taken from the supplier number stored on the match.
The call is a wrapper: it runs the internal procedure Pixi_Buy_GetMatchesForDeliveredItem, buffers its rows in a temporary table and returns them.
Notes
- All reads use
NOLOCK, so uncommitted data may be returned. - If
SDelDkeyis omitted (defaultNULL), no rows are returned because the filter compares with=. - The internal procedure sorts by order date and ordered quantity, but the wrapper selects from its temporary table without
ORDER BY. The row order is therefore not guaranteed; sort on the client if needed. - All quantity columns are stored as
intin the buffer table; decimal quantities would be truncated.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
SDelDkey
|
int | NULL |
Key of the supplier delivery document line (item line) whose matches to supplier order lines are returned. Example: |
Result set 1 · Always; empty if no matches exist for SDelDkey or it is NULL.
One row per supplier order line matched to the delivery line.
| Column | Type | Description |
|---|---|---|
OrderNr
Nullable |
int |
Internal number of the supplier order. |
SOrderLineRef
Nullable |
int |
ID of the matched supplier order line. |
SupplName
Nullable |
varchar(60) string |
Name of the supplier stored on the match. |
OrderDate
Nullable |
datetime dateTime |
Date of the supplier order. |
OrderQty
Nullable |
int |
Ordered quantity of the order line. |
QtyReceived
Nullable |
int |
Quantity already delivered for the order line. |
QtyNotDelivered
|
int |
Quantity of the order line not yet delivered; 0 if no value is stored. |
BuyingMatchQty
Nullable |
int |
Sum of the quantities of this delivery line matched to the order line. |
OrderId
Nullable |
int |
ID of the supplier order. |
Response example
<SqlRowSet1>
<row>
<OrderNr>10452</OrderNr>
<SOrderLineRef>88213</SOrderLineRef>
<SupplName>Muster Großhandel GmbH</SupplName>
<OrderDate>2024-03-12T00:00:00</OrderDate>
<OrderQty>50</OrderQty>
<QtyReceived>30</QtyReceived>
<QtyNotDelivered>20</QtyNotDelivered>
<BuyingMatchQty>30</BuyingMatchQty>
<OrderId>7731</OrderId>
</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:pixiGetMatchesForDeliveredItem>
<!-- <SDelDkey>154872</SDelDkey> -->
</ns1:pixiGetMatchesForDeliveredItem>
</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:pixiGetMatchesForDeliveredItem>
<!-- <SDelDkey>154872</SDelDkey> -->
</ns1:pixiGetMatchesForDeliveredItem>
</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 = [
// 'SDelDkey' => '154872',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetMatchesForDeliveredItem', $soapArguments);
- SQL object:
- dbo.pipiGetMatchesForDeliveredItem