pixiEstimatedDeliveryUpdates
Recalculates the estimated delivery dates of order lines and items for an order, a shop order number or an item, and queues changed items for export.
Wrapper around the internal procedure Pixi_EstimatedDeliveryUpdates.
OrderNr = 0,ShopOrderNr = ''andItemRef = 0are treated as NULL.- If all three parameters are NULL, the call ends immediately and does nothing. A full recalculation for all items cannot be started through this call.
- Otherwise the internal procedure runs with the given values.
Selection of items
OrderNr: items of the order lines of this Auftrag (not deleted,OrderNr <> 0) with statusANGorHAL, or lines that belong to a bundle line.ShopOrderNr: the same, matched onOrderlines.OrderNrExternal.ItemRef: the item itself. If it is a bundle, its components are added and the bundle is recalculated too.- Only non-bundle items are calculated directly. If no item is found, the procedure ends without changes.
Calculation (setting EstimatedDeliveryCalcUsesFIFO)
1(FIFO): stock units in locations withParticipateInEstDelivery = 1and open quantities of confirmed supplier order lines (IsOrderedConfirmed = 1, with an estimated delivery date, at participating locations) are assigned unit by unit to open order lines with statusANG/HAL. The lines are sorted byAutoReservationDonedescending, order date and order line key. Each order line gets the date of its last assigned unit and the supplier order line used (RealSorderlineRef). Stock and past dates become today. The item gets the date of the next unit that is still free after all open lines, or NULL.0(MAX) /2(MIN): the latest or earliest estimated delivery date of confirmed supplier order lines with a participating delivery location. It is used only if the date is after today and open quantity remains. All order lines of the item and the item itself get this date.- Any other value calculates nothing.
Cleanup and bundles
- Unless all three parameters are filled, existing entries in
Orderline_EstimatedDeliveryandItem_EstimatedDelivery(non-bundle items) that were not recalculated are set to NULL, which deletes them. - Bundles get the latest date of their components. If one component has no date, the bundle gets no date.
Saving
Item_EstimatedDeliveryandOrderline_EstimatedDeliveryare updated with MERGE. A NULL result deletes the row, a changed value is updated with a new update date, a new item or line is inserted.- Changed bundles, and changed items that already have an
InvBinItemLogentry, are written topixi.ItemRecalculateStockQueuewithForceToExport = 1. - Changed items without any
InvBinItemLogentry get a log row with quantity 0 andUpdateEmp = 'AutoEstDelExp', so that they are exported.
The call returns no result set.
Notes
- Pitfall: the cleanup step is not limited to the selected order or item. Unless
OrderNr,ShopOrderNrandItemRefare all filled, every entry inOrderline_EstimatedDeliveryandItem_EstimatedDelivery(non-bundle items) that was not recalculated in this run is deleted, across the whole system. - If no bundle is involved in the selection, all bundles in the system are recalculated from the current results.
- In MAX/MIN mode all order lines of the item get the date, regardless of their status. In FIFO mode only open lines with status
ANG/HALare considered. - The calculation mode comes from the setting
EstimatedDeliveryCalcUsesFIFO, read at runtime throughfpixi_GetSetting. Its definition is not attached. - The procedure returns 0 if nothing was done and 1 otherwise. The SOAP response does not contain this return value as a row.
- There is no explicit transaction. Reads use
NOLOCK. - The FIFO mode expands quantities into single units using
dbo.Numbers. This can be slow for large quantities.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderNr
|
int | NULL |
Pixi order number. Items of the open order lines of this Auftrag are recalculated. 0 is treated as NULL. Example: |
ShopOrderNr
|
varchar(50) string |
NULL |
External shop order number, matched on Example: |
ItemRef
|
int | NULL |
Item key ( Example: |
This call returns no result set.
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:pixiEstimatedDeliveryUpdates>
<!-- <OrderNr>104523</OrderNr> -->
<!-- <ShopOrderNr>SHOP-2024-000815</ShopOrderNr> -->
<!-- <ItemRef>5871</ItemRef> -->
</ns1:pixiEstimatedDeliveryUpdates>
</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:pixiEstimatedDeliveryUpdates>
<!-- <OrderNr>104523</OrderNr> -->
<!-- <ShopOrderNr>SHOP-2024-000815</ShopOrderNr> -->
<!-- <ItemRef>5871</ItemRef> -->
</ns1:pixiEstimatedDeliveryUpdates>
</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 = [
// 'OrderNr' => '104523',
// 'ShopOrderNr' => 'SHOP-2024-000815',
// 'ItemRef' => '5871',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiEstimatedDeliveryUpdates', $soapArguments);
- SQL object:
- dbo.pipiEstimatedDeliveryUpdates