public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { ServiceRoute requiredRoute = facts.SalesOrder.RequiredServiceRoute; if (requiredRoute == null) { return(false); } ServiceRouteDisposition disposition = Scout.Core.Service <IShopfloorService>() .GetRouteDisposition(facts.Item, requiredRoute); if (disposition == null) { var error = string.Format("Shipment Cancelled: This unit did not complete the {0} route", requiredRoute.Name); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { var lineItem = facts.SalesOrder.GetLineByPart(facts.Item.Part); if (lineItem == null) { messageBuilder.AddMessage("No sales order line item found for this part", UserMessageType.Validation); return(true); } if (lineItem.Status != LineItemStatus.Open) { messageBuilder.AddMessage("This line item is not open and cannot be shipped against.", UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.ShipQty > facts.Item.Qty) { var error = string.Format("{0} exceeds the available quantity for this lot.", facts.ShipQty); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.Item.RoutingRequired && facts.Item.CurrentProcess != null) { var error = "Routing Required: This unit has not finished processing on its route and cannot be shipped."; messageBuilder.AddMessage(error, UserMessageType.Validation); return(false); } return(true); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.Item.Hold != null) { var error = "Unit is on hold and cannot be shipped."; messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.SalesOrder.ExpectedQtyForPart(facts.Item.Part.Id) <= 0) { var error = string.Format("Part number {0} is not expected on this order.", facts.Item.PartNumber); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.SalesOrder.ShipmentDomainStatus != null & !facts.Item.Domain.Status.Equals(facts.SalesOrder.ShipmentDomainStatus)) { var error = string.Format("Incorrect domain status. This unit needs to be in a [{0}] domain", facts.SalesOrder.ShipmentDomainStatus); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (!facts.Item.Domain.IsShippable) { var error = string.Format( "This unit is in a non shippable domain ({0}) and cannot be processed.", facts.Item.Domain); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.SalesOrder.ExpectedQtyForPart(facts.Item.Part.Id) < facts.ShipQty) { var error = string.Format( "Shipping {0} units of part number {1} will exceed the qty expected.", facts.ShipQty, facts.Item.PartNumber); messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (facts.SalesOrder.Shopfloorline == null) { return(true); } if (facts.Item.Shopfloorline.Id != facts.SalesOrder.Shopfloorline.Id) { var error = "Shipment Cancelled: This unit is not on the " + facts.SalesOrder.Shopfloorline + " shopfloorline."; messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }
public bool IsBroken(ShipmentFacts facts, IUserMessageBuilder messageBuilder) { if (string.IsNullOrEmpty(facts.SalesOrder.RequiredProgram)) { return(true); } if (facts.Item.ShopfloorProgram == null || !facts.Item.ShopfloorProgram.Equals(facts.SalesOrder.RequiredProgram)) { var error = "Shipment Cancelled: This unit is not associated to the required program of " + facts.SalesOrder.RequiredProgram; messageBuilder.AddMessage(error, UserMessageType.Validation); return(true); } return(false); }