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

Fixed Issues with Job Scopes
Fixed Issues with DynamicMapGrid Columns
Fixed Issues with Staging Manufacturing Packets
Fixed "Duplicate Code" issues with Logikal Imports

frogsoftware пре 1 недеља
родитељ
комит
57bcb451b4

+ 1 - 3
prs.classes/Entities/Job/JobScopes/InternalJobScopeLink.cs

@@ -7,8 +7,6 @@ namespace Comal.Classes
     {
         [NullEditor]
         public override Guid ID { get; set; }
-        
-        [NullEditor]
-        public string SourceRef { get; set; }
+
     }
 }

+ 1 - 1
prs.classes/Entities/Staging/Manufacturing/Packet/StagingManufacturingPacketTreatment.cs

@@ -26,7 +26,7 @@ namespace Comal.Classes
                     {
                         jobStyleFilters.Add(new Filter<JobStyle>(x => x.Job.ID).IsEqualTo(job));
                     }
-                    return LookupFactory.DefineFilter<Product>().And(x => x.TreatmentType).IsNotEqualTo(Guid.Empty)
+                    return LookupFactory.DefineFilter<Product>().And(x => x.TreatmentType.ID).IsNotEqualTo(Guid.Empty)
                         .And(x => x.ID).InQuery(
                             new Filter<ProductStyle>(x => x.ID).InQuery(jobStyleFilters.Combine(), x => x.Style.ID),
                             x => x.ManufacturingTreatmentProduct.ID);

+ 1 - 1
prs.desktop/Dashboards/Common/DigitalFormsDashboard.xaml.cs

@@ -1750,7 +1750,7 @@ public class DigitalFormsDashboardGrid : CoreTableGrid
         var latitude = row.Get<double>("Location.Latitude");
         var longitude = row.Get<double>("Location.Longitude");
 
-        var form = new MapForm(latitude, longitude, timestamp);
+        var form = new MapForm(latitude, longitude, null, timestamp);
         form.ShowDialog();
 
         return false;

+ 1 - 0
prs.desktop/Dashboards/Equipment/EquipmentSchedulesDashboard.xaml.cs

@@ -509,6 +509,7 @@ public partial class EquipmentSchedulesDashboard : UserControl, IDashboardWidget
         var form = new MapForm(
             equipment.TrackerLink.Location.Latitude,
             equipment.TrackerLink.Location.Longitude,
+            null,
             equipment.TrackerLink.Location.Timestamp);
         form.ShowDialog();
     }

+ 4 - 4
prs.desktop/Forms/MapForm.xaml

@@ -19,9 +19,9 @@
             x:Name="Map" 
             BorderBrush="Gray"
             BorderThickness="0.75" 
-            ZoomLevel="19" 
-            MinZoom="19"
-            MaxZoom="19"
+            ZoomLevel="18" 
+            MinZoom="18"
+            MaxZoom="18"
             EnableZoom="False"
             EnablePan="False"
             Grid.Row="0"
@@ -31,7 +31,7 @@
                 <dynamicGrid:GoogleImageryLayer
                     x:Name="ImageryLayer"
                     Center="-31.95105, 115.85939"
-                    Radius="10">
+                    Radius="11">
                     
                     <syncfusion:ImageryLayer.SubShapeFileLayers>
                         <syncfusion:SubShapeFileLayer x:Name="subLayer">

+ 13 - 11
prs.desktop/Forms/MapForm.xaml.cs

@@ -20,21 +20,23 @@ namespace PRSDesktop.Forms
 
 		private double _zoom = 18.0;
 		
-		public MapForm(double latitude, double longitude, DateTime? timestamp = null)
+		public MapForm(double latitude, double longitude, GeoFenceDefinition? geofence = null, DateTime? timestamp = null)
 		{
 			InitializeComponent();
 			
 			var geopoint = new GeoPoint(latitude, longitude);
-			var fences = Client.Query<GeoFence>().ToArray<GeoFence>();
-			foreach (var fence in fences)
-			{
-				var def = Serialization.Deserialize<GeoFenceDefinition>(fence.Geofence) ?? new GeoFenceDefinition();
-				if (def.Contains(geopoint))
-				{
-					Polygon.Points = new ObservableCollection<Point>(def.Coordinates.Select(p => new Point(p.Latitude, p.Longitude)));
-					break;
-				}
-			}
+			if (geofence != null)
+				Polygon.Points = new ObservableCollection<Point>(geofence.Coordinates.Select(p => new Point(p.Latitude, p.Longitude)));
+			// var fences = Client.Query<GeoFence>().ToArray<GeoFence>();
+			// foreach (var fence in fences)
+			// {
+			// 	var def = Serialization.Deserialize<GeoFenceDefinition>(fence.Geofence) ?? new GeoFenceDefinition();
+			// 	if (def.Contains(geopoint))
+			// 	{
+			// 		Polygon.Points = new ObservableCollection<Point>(def.Coordinates.Select(p => new Point(p.Latitude, p.Longitude)));
+			// 		break;
+			// 	}
+			// }
 
 			if (timestamp.HasValue)
 				TimeStamp.Content = $"Last Updated {timestamp:dd MMM yyy hh:mm:ss tt}";

+ 11 - 3
prs.desktop/Integrations/Common/AWGMappingWindow.xaml.cs

@@ -8,6 +8,7 @@ using Comal.Classes;
 using InABox.Core;
 using InABox.Integration.Awg;
 using InABox.Integration.Logikal;
+using InABox.WPF;
 using PRSDesktop.Integrations.Logikal;
 
 namespace PRSDesktop.Integrations.Common;
@@ -57,9 +58,16 @@ public partial class AWGMappingWindow : Window
 
     private void OKClick(object sender, RoutedEventArgs e)
     {
-        ViewModel.CheckUpdates();
-        ViewModel.GetDiscounts(_discountCallback);
-        ViewModel.GetParts(_partsCallback,_labourCallback);
+        Progress.ShowModal("Processing", progress =>
+        {
+            progress.Report("Checking Updates");
+            Dispatcher.Invoke(() => ViewModel.CheckUpdates());
+            progress.Report("Getting Discounts");
+            Dispatcher.Invoke(() => ViewModel.GetDiscounts(_discountCallback));
+            progress.Report("Processing Items");
+            Dispatcher.Invoke(() => ViewModel.GetParts(_partsCallback, _labourCallback));
+
+        });
         DialogResult = true;
     }
 

+ 4 - 4
prs.desktop/Integrations/Common/AWGMappingWindowViewModel.cs

@@ -1128,7 +1128,7 @@ public class AWGMappingWindowViewModel : DependencyObject
 
     private void PopulateGasket(Product argsEntity, ProductIntegrationSource argsMapping)
     {
-        argsEntity.Code = argsMapping.Code ?? "";
+        argsEntity.Code = argsMapping.Entity.Code ?? "";
         argsEntity.Name = argsMapping.Description ?? "";
         argsEntity.UnitOfMeasure.ID = _settings.GasketUom.ID;
         var _group = GroupMappings?.FirstOrDefault(x => Equals(x.Code, argsMapping.Group));
@@ -1149,7 +1149,7 @@ public class AWGMappingWindowViewModel : DependencyObject
 
     private void PopulateComponent(Product entity, ProductIntegrationSource mapping)
     {
-        entity.Code = mapping.Code ?? "";
+        entity.Code = mapping.Entity.Code ?? "";
         entity.Name = mapping.Description ?? "";
         entity.UnitOfMeasure.ID = _settings.ComponentUom.ID;
         var _group = GroupMappings?.FirstOrDefault(x => Equals(x.Code, mapping.Group));
@@ -1170,7 +1170,7 @@ public class AWGMappingWindowViewModel : DependencyObject
 
     private void PopulateGlass(Product entity, ProductIntegrationSource mapping)
     {
-        entity.Code = mapping.Code ?? "";
+        entity.Code = mapping.Entity.Code ?? "";
         entity.Name = mapping.Description ?? "";
         entity.UnitOfMeasure.ID = _settings.GlassUom.ID;
         var _group = GroupMappings?.FirstOrDefault(x => Equals(x.Code, mapping.Group));
@@ -1192,7 +1192,7 @@ public class AWGMappingWindowViewModel : DependencyObject
 
     private void PopulateActivity(Activity entity, ActivityIntegrationSource mapping)
     {
-        entity.Code = mapping.Code ?? "";
+        entity.Code = mapping.Entity.Code ?? "";
         entity.Description = mapping.Description ?? "";
     }
 

+ 3 - 2
prs.desktop/Panels/DynamicMapColumn.cs

@@ -15,7 +15,7 @@ namespace PRSDesktop
         private readonly string Latitude;
         private readonly string Longitude;
         private readonly BitmapImage milestone = Resources.map.AsBitmapImage();
-        private readonly string? Geofence = "";
+        private readonly string Geofence;
 
         
         public DynamicMapColumn(DynamicGrid<T> grid, Expression<Func<T, Address>> property) : base(r => null)
@@ -73,7 +73,8 @@ namespace PRSDesktop
         {
             if (row is not null && HasLocation(row))
             {
-                var mapform = new MapForm(row.Get<double>(Latitude), row.Get<double>(Longitude));
+                var geofence = Serialization.Deserialize<GeoFenceDefinition>(row.Get<string>(Geofence)) ?? new GeoFenceDefinition();
+                var mapform = new MapForm(row.Get<double>(Latitude), row.Get<double>(Longitude),geofence);
                 mapform.ShowDialog();
                 
                 //var Address = new Address();

+ 5 - 2
prs.desktop/Panels/Staging/Manufacturing/StagingManufacturingPacketList.xaml.cs

@@ -160,8 +160,11 @@ namespace PRSDesktop
 
             if(lastPacket != null)
             {
-                newPacket.Template.ID = lastPacket.Template.ID;
-                newPacket.Template.Synchronise(lastPacket.Template);
+                if (lastPacket.Group.ID == group?.ID)
+                {
+                    newPacket.Template.ID = lastPacket.Template.ID;
+                    newPacket.Template.Synchronise(lastPacket.Template);
+                }
                 newPacket.Title = lastPacket.Title;
                 newPacket.ITP.ID = lastPacket.ITP.ID;
                 newPacket.ITP.Synchronise(lastPacket.ITP);

+ 1 - 1
prs.desktop/Panels/Staging/Manufacturing/StagingManufacturingPacketTreatmentGrid.cs

@@ -63,7 +63,7 @@ public class StagingManufacturingPacketTreatmentGrid : DynamicDataGrid<StagingMa
     {
         var item = base.CreateItem();
         item.Packet.ID = Packet.ID;
-
+        item.Packet.Synchronise(Packet);
         return item;
     }
 

+ 12 - 0
prs.desktop/Panels/Staging/StagingPanel.xaml.cs

@@ -979,6 +979,18 @@ public partial class StagingPanel : UserControl, IPanel<StagingSetout>
         if (_templateGroups.Rows.Any() == true)
         {
             ContextMenu menu = new ContextMenu();
+            if (ManufacturingPacketList.Packets.Any())
+            {
+                menu.AddItem("Duplicate Last Item",null, () =>
+                {
+                    ManufacturingPacketList.Add(
+                        selectedSetout?.JobLink.ID ?? Guid.Empty,
+                        ManufacturingPacketList.Packets.Last().Group
+                    );
+                    UpdateStagingSetoutGrid();
+                });
+                menu.AddSeparator();
+            }
             foreach (var row in _templateGroups.Rows)
             {
                 menu.AddItem(

+ 1 - 1
prs.desktop/prsdesktop.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Desktop"
-#define MyAppVersion "8.51"
+#define MyAppVersion "8.52"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSDesktop.exe"

+ 1 - 1
prs.licensing/PRSLicensing.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Licensing"
-#define MyAppVersion "8.51"
+#define MyAppVersion "8.52"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSLicensing.exe"

+ 1 - 1
prs.server/PRSServer.iss

@@ -8,7 +8,7 @@
 #define public Dependency_Path_NetCoreCheck "dependencies\"
 
 #define MyAppName "PRS Server"
-#define MyAppVersion "8.51"
+#define MyAppVersion "8.52"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSServer.exe"