Browse Source

Initial timezone stuff

Kenric Nugteren 2 years ago
parent
commit
3fe0d526be
2 changed files with 50 additions and 28 deletions
  1. 47 25
      prs.classes/Entities/Timesheet/Timesheet.cs
  2. 3 3
      prs.desktop/Grids/TimesheetGrid.cs

+ 47 - 25
prs.classes/Entities/Timesheet/Timesheet.cs

@@ -27,43 +27,43 @@ namespace Comal.Classes
         [EditorSequence(4)]
         public TimeSheetActivityLink ActivityLink { get; set; }
 
-        [TimeOfDayEditor]
-        [EditorSequence(5)]
-        [LoggableProperty(Format = "hh\\:mm")]
-        public TimeSpan Start { get; set; }
+        [NullEditor]
+        public DateTime UTCStart { get; set; }
 
-        [TimeOfDayEditor]
-        [EditorSequence(6)]
-        [LoggableProperty(Format = "hh\\:mm")]
-        public TimeSpan Finish { get; set; }
+        [NullEditor]
+        public DateTime UTCFinish { get; set; }
 
-        [DurationEditor]
-        [EditorSequence(7)]
-        [LoggableProperty(Format = "hh\\:mm")]
-        public TimeSpan ApprovedStart { get; set; }
+        [CoreTimeEditor]
+        public TimeBlock ActualTime { get; set; }
 
-        [DurationEditor]
+        [CoreTimeEditor]
+        public TimeBlock ApprovedTime { get; set; }
+
+        [TextBoxEditor]
+        [EditorSequence(6)]
+        public string TimeZoneStart { get; set; }
+
+        [TextBoxEditor]
         [EditorSequence(8)]
-        [LoggableProperty(Format = "hh\\:mm")]
-        public TimeSpan ApprovedFinish { get; set; }
+        public string TimeZoneFinish { get; set; }
 
         [MemoEditor]
-        [EditorSequence(9)]
+        [EditorSequence(11)]
         public string Notes { get; set; }
 
         [TimestampEditor]
-        [EditorSequence(10)]
+        [EditorSequence(12)]
         [LoggableProperty(Format = "dd MMM yy HH:mm")]
         public DateTime Confirmed { get; set; }
 
         [TimestampEditor]
-        [EditorSequence(11)]
+        [EditorSequence(13)]
         [LoggableProperty(Format = "dd MMM yy HH:mm")]
         public DateTime Approved { get; set; }
 
         [SecondaryIndex]
         [TimestampEditor]
-        [EditorSequence(12)]
+        [EditorSequence(14)]
         [LoggableProperty(Format = "dd MMM yy HH:mm")]
         public DateTime Processed { get; set; }
         
@@ -84,22 +84,44 @@ namespace Comal.Classes
         [NullEditor]
         public Location FinishLocation { get; set; }
 
-        [DurationEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
-        public TimeSpan ApprovedDuration { get; set; }
-
         [NullEditor]
         [Obsolete("Replaced with EmployeeLink.ID",true)]
         public Guid EmployeeID { get; set; }
 
-        [DurationEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
-        public TimeSpan Duration { get; set; }
-
         [TextBoxEditor(Editable = Editable.Hidden)]
         public string Address { get; set; }
 
         [TextBoxEditor(Editable = Editable.Hidden)]
         public string Gate { get; set; }
 
+        [TimeOfDayEditor]
+        [LoggableProperty(Format = "hh\\:mm")]
+        [Obsolete("Replaced with ActualTime.Start")]
+        public TimeSpan Start { get; set; }
+
+        [TimeOfDayEditor]
+        [LoggableProperty(Format = "hh\\:mm")]
+        [Obsolete("Replaced with ActualTime.Finish")]
+        public TimeSpan Finish { get; set; }
+
+        [DurationEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
+        [Obsolete("Replaced with ActualTime.Duration")]
+        public TimeSpan Duration { get; set; }
+
+        [DurationEditor]
+        [LoggableProperty(Format = "hh\\:mm")]
+        [Obsolete("Replaced with ApprovedTime.Start")]
+        public TimeSpan ApprovedStart { get; set; }
+
+        [DurationEditor]
+        [LoggableProperty(Format = "hh\\:mm")]
+        [Obsolete("Replaced with ApprovedTime.Finish")]
+        public TimeSpan ApprovedFinish { get; set; }
+
+        [DurationEditor(Editable = Editable.Hidden, Summary = Summary.Sum)]
+        [Obsolete("Replaced with ApprovedTime.Duration")]
+        public TimeSpan ApprovedDuration { get; set; }
+
 
         protected override void Init()
         {

+ 3 - 3
prs.desktop/Grids/TimesheetGrid.cs

@@ -411,10 +411,10 @@ namespace PRSDesktop
         //    return false;
         //}
 
-        protected override void Reload(Filters<TimeSheet> criteria, Columns<TimeSheet> columns, ref SortOrder<TimeSheet> sort,
-            Action<CoreTable, Exception> action)
+        protected override void Reload(Filters<TimeSheet> criteria, Columns<TimeSheet> columns, ref SortOrder<TimeSheet>? sort,
+            Action<CoreTable?, Exception?> action)
         {
-            var filter = new Filter<TimeSheet>(x => x.Processed).IsLessThanOrEqualTo(DateTime.MinValue.AddDays(1));
+            var filter = new Filter<TimeSheet>(x => x.Processed).IsEqualTo(DateTime.MinValue);
             if (!string.IsNullOrWhiteSpace(Search))
                 filter = filter.TextSearch(Search, x => x.EmployeeLink.Name, x => x.Address, x => x.Notes);
             criteria.Add(filter);