|
@@ -10,6 +10,7 @@ using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
using InABox.WPF;
|
|
|
using NPOI.SS.Formula.Functions;
|
|
|
+using Column = InABox.Core.Column;
|
|
|
|
|
|
namespace PRSDesktop;
|
|
|
|
|
@@ -30,7 +31,8 @@ public class StockLocationGrid : DynamicDataGrid<StockLocation>
|
|
|
|
|
|
HiddenColumns.Add(x => x.Job.ID);
|
|
|
HiddenColumns.Add(x => x.StocktakeFrequency);
|
|
|
- HiddenColumns.Add(x => x.StocktakeStatus);
|
|
|
+ HiddenColumns.Add(x => x.LastStocktake);
|
|
|
+ HiddenColumns.Add(x => x.CurrentStocktake);
|
|
|
HiddenColumns.Add(x => x.NextStocktake);
|
|
|
|
|
|
ActionColumns.Add(new DynamicImageColumn(StockTakeStatusImage) { ToolTip = StockTakeStatusToolTip, Position = DynamicActionColumnPosition.Start });
|
|
@@ -45,22 +47,25 @@ public class StockLocationGrid : DynamicDataGrid<StockLocation>
|
|
|
{
|
|
|
return row == null
|
|
|
? column.TextToolTip("Indicates the Stocktake status of this location")
|
|
|
- : row.Get<StockLocation, StockTakeStatus>(x => x.StocktakeStatus) == StockTakeStatus.InProgress
|
|
|
+ : !row.Get<StockLocation, DateTime>(x => x.CurrentStocktake).IsEmpty()
|
|
|
? column.TextToolTip("Stocktake in progress")
|
|
|
- : column.TextToolTip($"Stocktake due on {row.Get<StockLocation, DateTime>(x => x.NextStocktake).Date:dd MMM yy}");
|
|
|
+ : !row.Get<StockLocation, DateTime>(x => x.NextStocktake).IsEmpty()
|
|
|
+ ? column.TextToolTip(
|
|
|
+ $"Stocktake due on {row.Get<StockLocation, DateTime>(x => x.NextStocktake).Date:dd MMM yy}")
|
|
|
+ : column.TextToolTip("No Stocktake scheduled");
|
|
|
}
|
|
|
|
|
|
private BitmapImage? StockTakeStatusImage(CoreRow? row)
|
|
|
{
|
|
|
- return row == null
|
|
|
+ return row == null
|
|
|
? _stocktakeheader
|
|
|
- : row.Get<StockLocation, StockTakeStatus>(x => x.StocktakeStatus) == StockTakeStatus.InProgress
|
|
|
+ : !row.Get<StockLocation, DateTime>(x => x.CurrentStocktake).IsEmpty()
|
|
|
? _stocktakeinprogress
|
|
|
- : row.Get<StockLocation, StockTakeFrequency>(x => x.StocktakeFrequency) == StockTakeFrequency.Never
|
|
|
- ? _stocktakedisabled
|
|
|
- : row.Get<StockLocation, DateTime>(x => x.NextStocktake).Date > DateTime.Today
|
|
|
+ : !row.Get<StockLocation, DateTime>(x => x.NextStocktake).IsEmpty()
|
|
|
+ ? row.Get<StockLocation, DateTime>(x => x.NextStocktake).Date > DateTime.Today
|
|
|
? _stocktakenotyetdue
|
|
|
- : _stocktakeoverdue;
|
|
|
+ : _stocktakeoverdue
|
|
|
+ : _stocktakedisabled;
|
|
|
}
|
|
|
|
|
|
protected override void DoReconfigure(FluentList<DynamicGridOption> options)
|