More Information on Orders from Closed Cash Shifts
In the API V8Preview7, information has been added about whether the order has been deleted, storned, information about which order the current one was storned from, as well as a list of orders that belong to the same group as the current order.
PastOrder.Deleted— whether the order was deleted;PastOrder.Storned— whether the order was storned in the cash shift in which it was paid, or the current order is an order returning an order from a closed cash shift (note: if the original order was not storned in the cash shift in which it was paid and was only returned from a closed cash shift, this property will befalse);PastOrder.SourceOrderInfo— information about the order from which the current order was storned during the stornation or return from a closed cash shift;PastOrder.GroupOrderInfo— information about the order that the current order belongs to (here will be information either about the order from which the current order was storned during the stornation, or about the order that the current order is an additional order to, or about the order that was first as a result of splitting into 2FR, if the listed original orders were themselves first in the group; or about the current order if it is the first (or only) in the group, and if the original order itself was in a group, then the group of the current order will be the group of the original order);PastOrder.GroupPastOrders— a list of orders that belong to the same group as the current order (orders having the same propertyGroupOrderInfoas the current order).
Thus, to understand whether the current order has ever been storned, you need to check its property
Storned,
if it is false, then additionally check if there are any grouped orders referencing the current one through the property
SourceOrderInfo:
if (pastOrder.Storned || pastOrder.GroupPastOrders.Any(o => o.SourceOrderInfo?.OrderId == pastOrder.OrderId)
// This order has already been storned.
When attempting to return
(StornoPastOrder)
an already storned order, SyrveFront will check the new right CAN_STORN_CLOSED_ORDERS_AGAIN ("F_STRNA", "Repeat return of an order from a closed cash shift").