pixiGetSOrdersBySupplier
Returns confirmed supplier orders of one supplier for a delivery location, or the list of suppliers with such orders, as a basis for delivery templates.
The call forwards both parameters to the internal procedure Pixi_GetSOrdersBySupplier. It helps select supplier orders from which a delivery template (supplier delivery) can be created.
Pre-filter: Supplier orders that already have at least one order line referenced by a supplier delivery in status NEW (SDelHeader.SDelHStatus = 'NEW') are excluded in both modes.
Status filter: Only orders whose status has IsConfirmed = 1 are considered. If the setting ConfirmOrderedDocumentOnDelivery is 1, orders whose status has IsOrderedConfirmed = 1 are included as well.
Location filter: The delivery location of the order (DeliveryLocationId) must match LocID.
Mode depends on SupplNr:
SupplNris set: returns the matching orders of this supplier (OrderNr,ExternalCode,Code,OrderDate), sorted by internal order number descending. The status codeBESis returned asORD.SupplNrisNULL: returns the distinct suppliers (SupplNr,SupplName) that have at least one matching order at the location.
Notes
- Both parameters have no default in this wrapper, so they must be sent. The supplier-list mode is only reached if
SupplNris explicitly passed as NULL; an empty string is not NULL and returns no orders. - If
LocIDis NULL, no rows are returned, because the comparisonlo.LocID = @LocIDnever matches NULL. - The wrapper does not pass
@LanguageID, so the inner procedure always uses1:BESbecomesORD; the translation ofCONtoBGT(language 2) never applies. - All reads use
NOLOCK, so uncommitted data may be returned. - The setting
ConfirmOrderedDocumentOnDeliveryis read at runtime viafpixi_GetSetting.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
SupplNr
Required
|
varchar(4) string |
– |
Supplier number. If set, the orders of this supplier are returned; if NULL, the list of suppliers with matching orders is returned. Example: |
LocID
Required
|
varchar(3) string |
– |
Location ID of the delivery location of the supplier orders. Example: |
Result set 1 · If SupplNr is not NULL
Confirmed supplier orders of the supplier at the location without a NEW supplier delivery, sorted by OrderNr descending.
| Column | Type | Description |
|---|---|---|
OrderNr
|
string |
Internal number of the supplier order ( |
ExternalCode
Nullable |
varchar(50) string |
External code of the supplier order. |
Code
Nullable |
string |
Status code of the order; |
OrderDate
Nullable |
datetime dateTime |
Order date. |
Result set 2 · If SupplNr is NULL
Distinct suppliers that have at least one matching supplier order at the location.
| Column | Type | Description |
|---|---|---|
SupplNr
Nullable |
string |
Supplier number. |
SupplName
Nullable |
string |
Supplier name. |
Response example
<SqlRowSet1>
<row>
<OrderNr>100245</OrderNr>
<ExternalCode>AB-2024-0815</ExternalCode>
<Code>ORD</Code>
<OrderDate>2024-03-12T00:00:00</OrderDate>
</row>
<row>
<OrderNr>100198</OrderNr>
<ExternalCode>AB-2024-0790</ExternalCode>
<Code>CON</Code>
<OrderDate>2024-03-05T00:00:00</OrderDate>
</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:pixiGetSOrdersBySupplier>
<SupplNr>L001</SupplNr>
<LocID>001</LocID>
</ns1:pixiGetSOrdersBySupplier>
</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:pixiGetSOrdersBySupplier>
<SupplNr>L001</SupplNr>
<LocID>001</LocID>
</ns1:pixiGetSOrdersBySupplier>
</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 = [
'SupplNr' => 'L001',
'LocID' => '001',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiGetSOrdersBySupplier', $soapArguments);
- SQL object:
- dbo.pipiGetSOrdersBySupplier