|
@@ -50,6 +50,7 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
HiddenColumns.Add(x => x.Product.Code);
|
|
HiddenColumns.Add(x => x.Product.Code);
|
|
HiddenColumns.Add(x => x.Product.Name);
|
|
HiddenColumns.Add(x => x.Product.Name);
|
|
HiddenColumns.Add(x => x.Style.ID);
|
|
HiddenColumns.Add(x => x.Style.ID);
|
|
|
|
+ HiddenColumns.Add(x => x.Job.ID);
|
|
|
|
|
|
HiddenColumns.Add(x => x.TaxCode.ID);
|
|
HiddenColumns.Add(x => x.TaxCode.ID);
|
|
HiddenColumns.Add(x => x.TaxCode.Code);
|
|
HiddenColumns.Add(x => x.TaxCode.Code);
|
|
@@ -178,31 +179,23 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
.And(x => x.ID).NotInList(_allocations.ToArray(x => x.ID)),
|
|
.And(x => x.ID).NotInList(_allocations.ToArray(x => x.ID)),
|
|
Columns.None<PurchaseOrderItemAllocation>()
|
|
Columns.None<PurchaseOrderItemAllocation>()
|
|
.Add(x => x.ID)
|
|
.Add(x => x.ID)
|
|
- .Add(x => x.Job.ID).Add(x => x.JobRequisitionItem.ID).Add(x => x.Quantity).Add(x => x.Nominated))
|
|
|
|
|
|
+ .Add(x => x.Job.ID).Add(x => x.JobRequisitionItem.ID).Add(x => x.Quantity))
|
|
.ToObjects<PurchaseOrderItemAllocation>());
|
|
.ToObjects<PurchaseOrderItemAllocation>());
|
|
}
|
|
}
|
|
var items = _allocations.ToList(SupplierPurchaseOrderItemSplit.FromAllocation);
|
|
var items = _allocations.ToList(SupplierPurchaseOrderItemSplit.FromAllocation);
|
|
if (SupplierPurchaseOrderItemSplitWindow.Execute(poi.Qty, items, out var value))
|
|
if (SupplierPurchaseOrderItemSplitWindow.Execute(poi.Qty, items, out var value))
|
|
{
|
|
{
|
|
var newLine = CreateItem();
|
|
var newLine = CreateItem();
|
|
- newLine.BillLine.ID = poi.BillLine.ID;
|
|
|
|
- newLine.BillLine.Synchronise(poi.BillLine);
|
|
|
|
- newLine.StockLocation.ID = poi.StockLocation.ID;
|
|
|
|
- newLine.StockLocation.Synchronise(poi.StockLocation);
|
|
|
|
- newLine.Consignment.ID = poi.Consignment.ID;
|
|
|
|
- newLine.Consignment.Synchronise(poi.Consignment);
|
|
|
|
- newLine.PurchaseGL.ID = poi.PurchaseGL.ID;
|
|
|
|
- newLine.PurchaseGL.Synchronise(poi.PurchaseGL);
|
|
|
|
- newLine.CostCentre.ID = poi.CostCentre.ID;
|
|
|
|
- newLine.CostCentre.Synchronise(poi.CostCentre);
|
|
|
|
- newLine.Product.ID = poi.Product.ID;
|
|
|
|
- newLine.Product.Synchronise(poi.Product);
|
|
|
|
- newLine.Style.ID = poi.Style.ID;
|
|
|
|
- newLine.Style.Synchronise(poi.Style);
|
|
|
|
- newLine.TaxCode.ID = poi.TaxCode.ID;
|
|
|
|
- newLine.TaxCode.Synchronise(poi.TaxCode);
|
|
|
|
- newLine.PurchaseOrderLink.ID = poi.PurchaseOrderLink.ID;
|
|
|
|
- newLine.PurchaseOrderLink.Synchronise(poi.PurchaseOrderLink);
|
|
|
|
|
|
+ newLine.BillLine.CopyFrom(poi.BillLine);
|
|
|
|
+ newLine.StockLocation.CopyFrom(poi.StockLocation);
|
|
|
|
+ newLine.Consignment.CopyFrom(poi.Consignment);
|
|
|
|
+ newLine.PurchaseGL.CopyFrom(poi.PurchaseGL);
|
|
|
|
+ newLine.CostCentre.CopyFrom(poi.CostCentre);
|
|
|
|
+ newLine.Product.CopyFrom(poi.Product);
|
|
|
|
+ newLine.Style.CopyFrom(poi.Style);
|
|
|
|
+ newLine.Job.CopyFrom(poi.Job);
|
|
|
|
+ newLine.TaxCode.CopyFrom(poi.TaxCode);
|
|
|
|
+ newLine.PurchaseOrderLink.CopyFrom(poi.PurchaseOrderLink);
|
|
newLine.Dimensions.CopyFrom(poi.Dimensions);
|
|
newLine.Dimensions.CopyFrom(poi.Dimensions);
|
|
|
|
|
|
// Copying across the posted reference; this would be a problem if we were to try to sync via a Poster two purchase order items with the
|
|
// Copying across the posted reference; this would be a problem if we were to try to sync via a Poster two purchase order items with the
|
|
@@ -233,7 +226,6 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
var newAllocation = new PurchaseOrderItemAllocation();
|
|
var newAllocation = new PurchaseOrderItemAllocation();
|
|
newAllocation.Job.CopyFrom(allocation.Job);
|
|
newAllocation.Job.CopyFrom(allocation.Job);
|
|
newAllocation.JobRequisitionItem.CopyFrom(allocation.JobRequisitionItem);
|
|
newAllocation.JobRequisitionItem.CopyFrom(allocation.JobRequisitionItem);
|
|
- newAllocation.Nominated = allocation.Nominated;
|
|
|
|
|
|
|
|
newAllocation.Quantity = allocation.Quantity - item.SplitQuantity;
|
|
newAllocation.Quantity = allocation.Quantity - item.SplitQuantity;
|
|
allocation.Quantity = item.SplitQuantity;
|
|
allocation.Quantity = item.SplitQuantity;
|
|
@@ -597,15 +589,8 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
poi.CostCentre.CopyFrom(sp.Product.CostCentre);
|
|
poi.CostCentre.CopyFrom(sp.Product.CostCentre);
|
|
poi.PurchaseGL.CopyFrom(sp.Product.PurchaseGL);
|
|
poi.PurchaseGL.CopyFrom(sp.Product.PurchaseGL);
|
|
poi.Description = sp.Product.Name;
|
|
poi.Description = sp.Product.Name;
|
|
|
|
+ poi.Job.CopyFrom(sp.Job);
|
|
result.Add(poi);
|
|
result.Add(poi);
|
|
-
|
|
|
|
- if(sp.Job.ID != Guid.Empty)
|
|
|
|
- {
|
|
|
|
- var poia = new PurchaseOrderItemAllocation();
|
|
|
|
- poia.Job.CopyFrom(sp.Job);
|
|
|
|
- poia.Nominated = true;
|
|
|
|
- Allocations.Add(new(poi, poia));
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
else if (pi != null)
|
|
else if (pi != null)
|
|
{
|
|
{
|
|
@@ -672,16 +657,9 @@ public class SupplierPurchaseOrderItemOneToMany : DynamicOneToManyGrid<PurchaseO
|
|
poi.Cost = sp.CostPrice;
|
|
poi.Cost = sp.CostPrice;
|
|
poi.CostCentre.CopyFrom(sp.Product.CostCentre);
|
|
poi.CostCentre.CopyFrom(sp.Product.CostCentre);
|
|
poi.PurchaseGL.CopyFrom(sp.Product.PurchaseGL);
|
|
poi.PurchaseGL.CopyFrom(sp.Product.PurchaseGL);
|
|
|
|
+ poi.Job.CopyFrom(sp.Job);
|
|
poi.Description = sp.Product.Name;
|
|
poi.Description = sp.Product.Name;
|
|
result.Add(poi);
|
|
result.Add(poi);
|
|
-
|
|
|
|
- if(sp.Job.ID != Guid.Empty)
|
|
|
|
- {
|
|
|
|
- var poia = new PurchaseOrderItemAllocation();
|
|
|
|
- poia.Job.CopyFrom(sp.Job);
|
|
|
|
- poia.Nominated = true;
|
|
|
|
- Allocations.Add(new(poi, poia));
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
});
|
|
});
|