Browse Source

Fix to the condition for treating JRIs.

Kenric Nugteren 11 months ago
parent
commit
761f9967a1

+ 1 - 11
prs.desktop/Panels/Reservation Management/ReservationManagementPanel.xaml.cs

@@ -6,20 +6,10 @@ using InABox.WPF;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Diagnostics;
 using System.Linq;
-using System.Windows;
 using System.Windows.Controls;
-using System.Windows.Controls.Primitives;
-using System.Windows.Input;
-using System.Windows.Media;
-using InABox.WPF.Themes;
-using NPOI.SS.Formula.Functions;
-using System.Collections.ObjectModel;
-using System.Threading.Tasks;
 using InABox.Clients;
 using InABox.Wpf;
-using InABox.Wpf.Reports;
 using Columns = InABox.Core.Columns;
 using PRSDesktop.Panels.ReservationManagement.TreatmentPO;
 
@@ -355,7 +345,7 @@ public partial class ReservationManagementPanel : UserControl, IPanel<JobRequisi
             return;
         }
 
-        if(jris.Values.Any(x => x.TreatmentRequired - x.TreatmentOnOrder <= 0))
+        if(jris.Values.Any(x => x.TreatmentRequired <= 0))
         {
             MessageWindow.ShowMessage("Please select only items requiring treatment.", "Already treated");
             return;

+ 8 - 2
prs.desktop/Panels/Reservation Management/Treatment PO/ReservationManagementTreatmentOrderGrid.cs

@@ -164,7 +164,7 @@ public class ReservationManagementTreatmentOrderGrid: DynamicItemsListGrid<Reser
             Parent = grid;
             Grid = grid;
 
-            DataGrid.FrozenColumnCount = 7;
+            DataGrid.FrozenColumnCount = 9;
         }
 
         protected override Brush? GetCellSelectionBackgroundBrush()
@@ -256,7 +256,13 @@ public class ReservationManagementTreatmentOrderGrid: DynamicItemsListGrid<Reser
                 if (!_observing) return;
 
                 var row = Data.Rows[itemIdx];
-                InvalidateRow(row);
+                foreach(var ac in ActionColumns)
+                {
+                    if(ac != QuantityColumns[i])
+                    {
+                        UpdateCell(row, ac);
+                    }
+                }
                 DoChanged();
             };
         }