|
@@ -250,7 +250,7 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
|
|
|
column.AddSeparator();
|
|
|
|
|
|
- var requiitems = holding.LoadRequisitionItems().ToList();
|
|
|
+ var requiitems = holding.LoadRequisitionItems(true).ToList();
|
|
|
|
|
|
column.AddItem("Relocate Items", null, r => RelocateItems(holding, requiitems.ToArray()));
|
|
|
}
|
|
@@ -396,7 +396,7 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
}
|
|
|
|
|
|
var holding = rows.First().ToObject<StockHolding>();
|
|
|
- var items = holding.LoadRequisitionItems().AsArray();
|
|
|
+ var items = holding.LoadRequisitionItems(true).AsArray();
|
|
|
|
|
|
DoIssue(holding, items);
|
|
|
return false;
|
|
@@ -446,7 +446,8 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
{
|
|
|
var win = new StockHoldingRelocationWindow(holding, requiitems)
|
|
|
{
|
|
|
- IsTargetEditable = false
|
|
|
+ IsTargetEditable = false,
|
|
|
+ Title = "Issue Items"
|
|
|
};
|
|
|
if (win.ShowDialog() == true)
|
|
|
{
|
|
@@ -464,8 +465,8 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
updates.AddRange(CreateIssue(holding, issue, requi.ID));
|
|
|
}
|
|
|
DoChanged();
|
|
|
- Refresh(false,true);
|
|
|
SaveBatch(StockMovementBatchType.Issue, updates.ToArray());
|
|
|
+ Refresh(false,true);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -473,17 +474,12 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
var sjs = new StockIssue();
|
|
|
sjs.Job.ID = holding.Job.ID;
|
|
|
sjs.Qty = requiitems[0].Qty;
|
|
|
-
|
|
|
- var sjg = new DynamicItemsListGrid<StockIssue>();
|
|
|
- sjg.OnValidate += (sender, items, errors) =>
|
|
|
- {
|
|
|
- if (items[0].Qty > requiitems[0].Qty)
|
|
|
- errors.Add($"Qty must not exceed {requiitems[0].Qty}");
|
|
|
- };
|
|
|
- if (sjg.EditItems(new StockIssue[] { sjs }))
|
|
|
+
|
|
|
+ if (DynamicGridUtils.EditObject(sjs))
|
|
|
{
|
|
|
var mvts = CreateIssue(holding, sjs, Guid.Empty);
|
|
|
SaveBatch(StockMovementBatchType.Issue, mvts.AsArray());
|
|
|
+ Refresh(false, true);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -494,7 +490,7 @@ public class StockHoldingGrid : DynamicDataGrid<StockHolding>
|
|
|
return false;
|
|
|
|
|
|
var holding = rows.First().ToObject<StockHolding>();
|
|
|
- var items = holding.LoadRequisitionItems().AsArray();
|
|
|
+ var items = holding.LoadRequisitionItems(true).AsArray();
|
|
|
|
|
|
DoTransfer(holding, items);
|
|
|
return false;
|