Преглед изворни кода

updated to support excluding multiple branches

kparker пре 11 месеци
родитељ
комит
a87d3a7cef
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      ProjectEntryExt.cs

+ 4 - 2
ProjectEntryExt.cs

@@ -1,4 +1,4 @@
-using System;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Linq;
@@ -18,6 +18,7 @@ namespace ProjectEntryLaborAdjust
         private const string SlotLaborUpdate = "RevBudSetLabor";   // <-- new flag
         private const string LaborInvCD = "L023";
         private const string ExcludedBranchCD = "301";
+        private static readonly HashSet<string> ExcludedBranchCDs = new HashSet<string>{"301","112"};
         private const string ExcludedBillRule = "PROGRESS";
         private const decimal PMRate = 90m;
         private int? _laborInvID;
@@ -135,7 +136,8 @@ namespace ProjectEntryLaborAdjust
                 Branch br = PXSelect<Branch,
                                 Where<Branch.branchID, Equal<Required<Branch.branchID>>>>
                             .Select(Base, proj.DefaultBranchID);
-                if (br?.BranchCD?.Trim() == ExcludedBranchCD)
+
+                if (br?.BranchCD != null && ExcludedBranchCDs.Contains(br.BranchCD.Trim()))
                     return true;
             }