From 3d006cf7ba94cfc1accdab876dc05d8f9fc4e502 Mon Sep 17 00:00:00 2001 From: support Date: Thu, 26 Nov 2026 21:21:47 +0100 Subject: [PATCH] Keep six decimal places of a warehouse's and a pickup point's coordinates Latitude and longitude were edited with the default number field, which shows two decimal places, so every save of a warehouse or a pickup point cut them to about a kilometre. They now use a six-place field (about ten centimetres), as the currency rate already uses a four-place one. --- .../Views/Shared/EditorTemplates/DoubleNullableN6.cshtml | 2 ++ .../Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs | 3 +++ .../Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/DoubleNullableN6.cshtml diff --git a/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/DoubleNullableN6.cshtml b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/DoubleNullableN6.cshtml new file mode 100644 index 0000000000..04eb14fa7a --- /dev/null +++ b/src/Web/Grand.SharedUIResources/Views/Shared/EditorTemplates/DoubleNullableN6.cshtml @@ -0,0 +1,2 @@ +@model double? + diff --git a/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs index 7220cbcb4b..05d38d5731 100644 --- a/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs +++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/PickupPointModel.cs @@ -3,6 +3,7 @@ using Grand.Infrastructure.Validators; using Grand.Web.AdminShared.Models.Common; using Microsoft.AspNetCore.Mvc.Rendering; +using System.ComponentModel.DataAnnotations; namespace Grand.Web.AdminShared.Models.Shipping; @@ -41,9 +42,11 @@ public class PickupPointModel : BaseEntityModel [GrandResourceDisplayName("Admin.Configuration.Shipping.PickupPoint.Fields.PickupFee")] public double PickupFee { get; set; } + [UIHint("DoubleNullableN6")] [GrandResourceDisplayName("Admin.Configuration.Shipping.PickupPoint.Fields.Latitude")] public double? Latitude { get; set; } + [UIHint("DoubleNullableN6")] [GrandResourceDisplayName("Admin.Configuration.Shipping.PickupPoint.Fields.Longitude")] public double? Longitude { get; set; } } \ No newline at end of file diff --git a/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs b/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs index ddc389d9f9..580c194f0b 100644 --- a/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs +++ b/src/Web/Grand.Web.AdminShared/Models/Shipping/WarehouseModel.cs @@ -2,6 +2,7 @@ using Grand.Infrastructure.Models; using Grand.Web.AdminShared.Models.Common; using Microsoft.AspNetCore.Mvc.Rendering; +using System.ComponentModel.DataAnnotations; namespace Grand.Web.AdminShared.Models.Shipping; @@ -16,9 +17,11 @@ public class WarehouseModel : BaseEntityModel [GrandResourceDisplayName("Admin.Configuration.Shipping.Warehouses.Fields.AdminComment")] public string AdminComment { get; set; } + [UIHint("DoubleNullableN6")] [GrandResourceDisplayName("Admin.Configuration.Shipping.Warehouses.Fields.Latitude")] public double? Latitude { get; set; } + [UIHint("DoubleNullableN6")] [GrandResourceDisplayName("Admin.Configuration.Shipping.Warehouses.Fields.Longitude")] public double? Longitude { get; set; }