当我们创建发货“Is-Component”字段时,我们在销售订单屏幕中新添加了当我们检查此字段时,并且当我们在发货屏幕中处理发货时,特定的库存数据项不仅仅通过检查“是组件”项, “是组件”项目的未选中项目能够传递到装运屏幕。
[PXOverride]
public IEnumerable Action(PXAdapter adapter, Nullable<Int32> actionID, Nullable<DateTime> shipDate, String siteCD, String operation, String ActionName, ActionDelegate baseMethod)
{
if (actionID == 1)
{
SOShipmentEntry ShipGraph = PXGraph.CreateInstance<SOShipmentEntry>();
PXGraph.InstanceCreated.AddHandler<SOShipmentEntry>((graph) =>
{
ShipGraph.RowInserting.AddHandler<SOShipLine>((sender, e) =>
{
foreach (SOLine line in Base.Transactions.Select())
{
ShipGraph.Transactions.Current = PXSelect<SOShipLine, Where<SOShipLine.shipmentNbr, Equal<Required<SOShipLine.shipmentNbr>>>>.Select(Base, line.InventoryID, line.OrderNbr);
SOShipLine ShipLine = new SOShipLine();
SOLineExt NonStklnExt = line.GetExtension<SOLineExt>();
if (ShipGraph.Transactions.Current == null)
{
//if (NonStklnExt.UsrIsComponent == true || NonStklnExt.UsrIsComponent == false || NonStklnExt.UsrInvFlag == true || NonStklnExt.UsrInvFlag == false || NonStklnExt.UsrStkInventoryID == null || NonStklnExt.UsrStkInventoryID != null)
//{
ShipLine.InventoryID = line.InventoryID;
ShipLine.TranDesc = line.TranDesc;
// }
ShipGraph.Transactions.Insert(ShipLine);
}
}
Base.Transactions.View.RequestRefresh();
});
});
}
return baseMethod(adapter, actionID, shipDate, siteCD, operation, ActionName);
}