pixiCanCancelOrderline2
Returns the status of an order line and a flag that tells whether the order line can still be cancelled.
Checks whether a single order line can be cancelled and returns one row for it.
The order line given in OrderlineKey is read from Orderlines and joined with OrderStates on its status code. The row contains the order line key, the status code, the status text and the flag CanCancel.
CanCancel is 1 only if all of these conditions are true:
- the status is not a final state (
FinalStateof the status isNor empty), - the status is not
EIN, - the order line is not referenced in
BoxItems(no box item exists for it), - the order line is not referenced in
InvLines(it has not been invoiced).
In every other case CanCancel is 0.
The call only checks. It does not cancel anything and does not change any data.
Notes
- All tables are read
WITH (NOLOCK). The result can reflect uncommitted changes, so check again right before you cancel. - The result set is empty if the order line does not exist or if its status code has no entry in
OrderStates(inner join). - The checks against
BoxItemsandInvLinesuseNOT INsubqueries. If one of these tables contains a row with an empty (NULL) order line reference, the condition is never true andCanCancelis0for every order line.
Tables used
| Parameter | Type | Default | Description |
|---|---|---|---|
OrderlineKey
Required
|
int | – |
Key of the order line to check ( Example: |
Result set 1 · If the order line exists and its status exists in OrderStates; otherwise empty.
One row with the status of the order line and the cancellation flag.
| Column | Type | Description |
|---|---|---|
OrderlineKey
|
int |
Key of the order line. |
Status
|
string |
Current status code of the order line. |
StateText
Nullable |
string |
Text of the status from |
CanCancel
|
int |
|
Response example
<SqlRowSet1>
<row>
<OrderlineKey>123456</OrderlineKey>
<Status>AUF</Status>
<StateText>Auftrag angelegt</StateText>
<CanCancel>1</CanCancel>
</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:pixiCanCancelOrderline2>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiCanCancelOrderline2>
</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:pixiCanCancelOrderline2>
<OrderlineKey>123456</OrderlineKey>
</ns1:pixiCanCancelOrderline2>
</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 = [
'OrderlineKey' => '123456',
];
$soapArguments = [];
foreach ($arguments as $name => $value) {
$soapArguments[] = new SoapVar($value, XSD_STRING, '', '', $name);
}
$response = $soapClient->__soapCall('pixiCanCancelOrderline2', $soapArguments);
- SQL object:
- dbo.pipiCanCancelOrderline2