|
@@ -166,6 +166,18 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
|
Allocations.RemoveAll(x => !Items.Contains(x.Item1));
|
|
|
}
|
|
|
|
|
|
+ protected override void DoValidate(PurchaseOrderItem[] items, List<string> errors)
|
|
|
+ {
|
|
|
+ base.DoValidate(items, errors);
|
|
|
+ foreach(var item in items)
|
|
|
+ {
|
|
|
+ if(Allocations.Any(x => x.Item1 == item && x.Item2.JobRequisitionItem.ID == Guid.Empty && x.Item2.Job.ID == item.Job.ID))
|
|
|
+ {
|
|
|
+ errors.Add("At least one allocation on this purchase order item is invalid due to having the same [Job] as the purchase order item.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public override void AfterSave(object item)
|
|
|
{
|
|
|
base.AfterSave(item);
|