Hi @Preethin
We had the same situation when we work with multiple shipments. We did the below workaround. After completing the confirmed shipment action, we checked the status of the order, and still shows open, marking the shipment as completed forcefully.
Sample code:
if (docgraph.Document.Current.Status == SOShipmentStatus.Open)
{
bool? iscompleted = false;
foreach (PXResult<SOOrderShipment, SOOrder> result in docgraph.OrderList.Select())
{
SOOrder order = result;
if (order.Status == SOOrderStatus.Completed)
iscompleted = true;
}
if (iscompleted == true && docgraph.Document.Current.Confirmed == true && (docgraph.Document.Current.ShipmentType == INDocType.Issue && docgraph.Document.Current.UnbilledOrderCntr > 0 && docgraph.Document.Current.BilledOrderCntr == 0 && docgraph.Document.Current.ReleasedOrderCntr == 0 || docgraph.Document.Current.ShipmentType == INDocType.Transfer))
{
docgraph.Document.Current.Status = SOShipmentStatus.Confirmed;
docgraph.Document.Update(docgraph.Document.Current);
docgraph.Save.Press();
}
}