Browse Source

Added Job DocumentSetMilestone To DataEntry Tag List
Fixed StockLocation.Holdings Aggregate

frogsoftware 1 year ago
parent
commit
dee5c84ac4

+ 1 - 1
prs.classes/Entities/DataEntry/DataEntryTag.cs

@@ -16,7 +16,7 @@ namespace Comal.Classes
                 .OrderBy(x => x.EntityName().Split('.').Last()).ToArray();
             foreach (var entity in classes)
                 if (ClientFactory.IsSupported(entity))
-                    AddValue(entity.EntityName(), entity.EntityName().Split('.').Last());
+                    AddValue(entity.EntityName(), entity.GetCaption());
         }
     }
     

+ 1 - 1
prs.classes/Entities/Job/DocumentSet/IJobDocumentSetMileStone.cs

@@ -2,7 +2,7 @@ using System;
 
 namespace Comal.Classes
 {
-    public interface IJobDocumentSetMileStone
+    public interface IJobDocumentSetMileStone : IDataEntryInstance
     {
         JobDocumentSetMileStoneTypelink Type { get; set; }
         String Revision { get; set; }

+ 28 - 7
prs.classes/Entities/Job/DocumentSet/JobDocumentSetLink.cs

@@ -34,7 +34,9 @@ namespace Comal.Classes
         public LightJobDocumentSetMileStoneLink CurrentMileStone { get; set; }
     }
     
-    public class JobDocumentSetLookups : EntityLookup<JobDocumentSet>, ILookupDefinition<JobDocumentSet,Job>
+    public class JobDocumentSetLookups : EntityLookup<JobDocumentSet>, 
+        ILookupDefinition<JobDocumentSet,JobProductMapping>,
+        ILookupDefinition<JobDocumentSet,JobStyle>
     {
         public override Filter<JobDocumentSet>? DefineFilter()
         {
@@ -54,19 +56,38 @@ namespace Comal.Classes
         }
 
 
-        public Filter<JobDocumentSet>? DefineFilter(Job[] items)
+        public Filter<JobDocumentSet>? DefineFilter(JobProductMapping[] items)
         {
-            var ids = items.Select(x => x.ID).Distinct().ToArray();
+            var ids = items.Select(x => x.Job.ID).Distinct().ToArray();
             return ids.Any()
                 ? new Filter<JobDocumentSet>(x => x.Job.ID).InList(ids)
                 : new Filter<JobDocumentSet>().None();
         }
 
-        public Columns<Job> DefineFilterColumns()
+        Columns<JobProductMapping> ILookupDefinition<JobDocumentSet, JobProductMapping>.DefineFilterColumns()
         {
-            return new Columns<Job>(x => x.ID)
-                .Add(x => x.JobNumber)
-                .Add(x => x.Name);
+            return new Columns<JobProductMapping>(x => x.ID)
+                .Add(x=>x.Job.ID)
+                .Add(x => x.Job.JobNumber)
+                .Add(x => x.Job.Name);
         }
+        
+        
+        public Filter<JobDocumentSet>? DefineFilter(JobStyle[] items)
+        {
+            var ids = items.Select(x => x.Job.ID).Distinct().ToArray();
+            return ids.Any()
+                ? new Filter<JobDocumentSet>(x => x.Job.ID).InList(ids)
+                : new Filter<JobDocumentSet>().None();
+        }
+
+        Columns<JobStyle> ILookupDefinition<JobDocumentSet, JobStyle>.DefineFilterColumns()
+        {
+            return new Columns<JobStyle>(x => x.ID)
+                .Add(x=>x.Job.ID)
+                .Add(x => x.Job.JobNumber)
+                .Add(x => x.Job.Name);
+        }
+        
     }
 }

+ 13 - 5
prs.classes/Entities/Job/DocumentSet/JobDocumentSetMileStone.cs

@@ -36,7 +36,10 @@ namespace Comal.Classes
     }
     
     [Caption("Milestones")]
-    public class JobDocumentSetMileStone : Entity, IRemotable, IPersistent, IOneToMany<JobDocumentSet>, IJobDocumentSetMileStone, ILicense<ProjectManagementLicense>
+    public class JobDocumentSetMileStone : Entity, IRemotable, IPersistent, 
+        IOneToMany<JobDocumentSet>, 
+        IJobDocumentSetMileStone, 
+        ILicense<ProjectManagementLicense>
     {
         [EntityRelationship(DeleteAction.Cascade)]
         [NullEditor]
@@ -67,22 +70,22 @@ namespace Comal.Classes
         public String Watermark { get; set; }
         
         [DateTimeEditor(Editable = Editable.Enabled)]
-        [EditorSequence(6)]
+        [EditorSequence(7)]
         public DateTime Due { get; set; }
         
         [Obsolete("Replaced with Submitted", true)]
         public DateTime Issued { get; set; }
         
         [DateTimeEditor(Editable = Editable.Disabled)]
-        [EditorSequence(7)]
+        [EditorSequence(8)]
         public DateTime Submitted { get; set; }
         
         [DateTimeEditor(Editable = Editable.Enabled)]
-        [EditorSequence(8)]
+        [EditorSequence(9)]
         public DateTime Expected { get; set; }
         
         [DateTimeEditor(Editable = Editable.Disabled)]
-        [EditorSequence(9)]
+        [EditorSequence(10)]
         public DateTime Closed { get; set; }
         
         [NullEditor]
@@ -92,6 +95,9 @@ namespace Comal.Classes
         [NullEditor]
         [Aggregate(typeof(JobDocumentSetMileStoneKanbanCount))]
         public int Kanbans { get; set; }
+        
+        [NullEditor] 
+        public DateTime DataEntered { get; set; }
 
         protected override void DoPropertyChanged(string name, object? before, object? after)
         {
@@ -120,5 +126,7 @@ namespace Comal.Classes
                 }
             }
         }
+
+
     }
 }

+ 6 - 0
prs.classes/Entities/Job/DocumentSet/JobDocumentSetMileStoneLink.cs

@@ -44,6 +44,9 @@ namespace Comal.Classes
         
         [EditorSequence(6)]
         public EmployeeLink Employee { get; set; }
+        
+        [NullEditor] 
+        public DateTime DataEntered { get; set; }
     }
 
     public class LightJobDocumentSetMileStoneLink : EntityLink<JobDocumentSetMileStone>, IJobDocumentSetMileStone
@@ -84,5 +87,8 @@ namespace Comal.Classes
 
         [EditorSequence(6)]
         public EmployeeLink Employee { get; set; }
+        
+        [NullEditor] 
+        public DateTime DataEntered { get; set; }
     }
 }

+ 7 - 7
prs.classes/Entities/Stock/StockLocation/StockLocation.cs

@@ -6,19 +6,19 @@ using InABox.Core;
 namespace Comal.Classes
 {
     
-    public class StockLocationHoldings : CoreAggregate<StockLocation, StockMovement, double>
+    public class StockLocationHoldings : CoreAggregate<StockLocation, StockHolding, Guid>
     {
-        public override Expression<Func<StockMovement, double>> Aggregate => x => x.Qty;
+        public override Expression<Func<StockHolding, Guid>> Aggregate => x => x.Product.ID;
 
-        public override Filter<StockMovement> Filter => null;
+        public override Filter<StockHolding> Filter => null; //new Filter<StockHolding>(x=>x.Qty).IsNotEqualTo(0);
 
-        public override Dictionary<Expression<Func<StockMovement, object>>, Expression<Func<StockLocation, object>>> Links =>
-            new Dictionary<Expression<Func<StockMovement, object>>, Expression<Func<StockLocation, object>>>()
+        public override Dictionary<Expression<Func<StockHolding, object>>, Expression<Func<StockLocation, object>>> Links =>
+            new Dictionary<Expression<Func<StockHolding, object>>, Expression<Func<StockLocation, object>>>()
             {
-                { StockMovement => StockMovement.Location.ID, StockLocation => StockLocation.ID }
+                { StockHolding => StockHolding.Location.ID, StockLocation => StockLocation.ID }
             };
 
-        public override AggregateCalculation Calculation => AggregateCalculation.Maximum;
+        public override AggregateCalculation Calculation => AggregateCalculation.Count;
     }
     
     public class StockLocationLastStocktake : CoreAggregate<StockLocation, StockMovement, DateTime>