Skip to content

Commit 777ca65

Browse files
committed
Merge branch 'release/3.868.0'
2 parents 01f34eb + eac3cbd commit 777ca65

17 files changed

+139
-7
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project>
33
<!-- These properties will be shared for all projects -->
44
<PropertyGroup>
5-
<VersionPrefix>3.867.0</VersionPrefix>
5+
<VersionPrefix>3.868.0</VersionPrefix>
66
<VersionSuffix>
77
</VersionSuffix>
88
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ Number template format: `<template>@<reset_type>[:<start>:<increment>]`
161161
| `Order.OrderPaidAndOrderSentNotifications.Enable` | `false` | Use order paid/sent notifications |
162162
| `Order.PaymentShipmentStatusChangedNotifications.Enable` | `false` | Use payment/shipment status notifications |
163163

164+
#### Dashboard Statistics Settings
165+
166+
| Setting | Default | Description |
167+
|---------|---------|-------------|
168+
| `Order.DashboardStatistics.Enable` | `true` | Enable or disable order statistics widgets on the main dashboard |
169+
| `Order.DashboardStatistics.RangeMonths` | `12` | Number of months to include in dashboard statistics calculations |
170+
164171
## Architecture
165172

166173
### Project Structure

src/VirtoCommerce.OrdersModule.Core/ModuleConstants.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,22 @@ public static class General
284284
DefaultValue = 20,
285285
};
286286

287+
public static SettingDescriptor DashboardStatisticsEnabled { get; } = new SettingDescriptor
288+
{
289+
Name = "Order.DashboardStatistics.Enable",
290+
GroupName = "Orders|General",
291+
ValueType = SettingValueType.Boolean,
292+
DefaultValue = true,
293+
};
294+
295+
public static SettingDescriptor DashboardStatisticsRangeMonths { get; } = new SettingDescriptor
296+
{
297+
Name = "Order.DashboardStatistics.RangeMonths",
298+
GroupName = "Orders|General",
299+
ValueType = SettingValueType.PositiveInteger,
300+
DefaultValue = 12,
301+
};
302+
287303
public static IEnumerable<SettingDescriptor> AllSettings
288304
{
289305
get
@@ -310,6 +326,8 @@ public static IEnumerable<SettingDescriptor> AllSettings
310326
yield return EventBasedPurchasedProductIndexation;
311327
yield return PurchasedProductStoreFilter;
312328
yield return MaxOrderDocumentCount;
329+
yield return DashboardStatisticsEnabled;
330+
yield return DashboardStatisticsRangeMonths;
313331
}
314332
}
315333
}

src/VirtoCommerce.OrdersModule.Web/Controllers/Api/OrderModuleController.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,24 @@ public async Task<ActionResult> DeleteOrdersByIds([FromQuery] string[] ids)
490490
return unauthorizedRequest ? Forbid() : NoContent();
491491
}
492492

493+
/// <summary>
494+
/// Get dashboard statistics settings
495+
/// </summary>
496+
[HttpGet]
497+
[Route("~/api/order/dashboardStatistics/settings")]
498+
[Authorize(ModuleConstants.Security.Permissions.ViewDashboardStatistics)]
499+
public async Task<ActionResult<object>> GetDashboardStatisticsSettingsAsync()
500+
{
501+
var enabled = await settingsManager.GetValueAsync<bool>(ModuleConstants.Settings.General.DashboardStatisticsEnabled);
502+
var rangeMonths = await settingsManager.GetValueAsync<int>(ModuleConstants.Settings.General.DashboardStatisticsRangeMonths);
503+
504+
return Ok(new
505+
{
506+
Enabled = enabled,
507+
RangeMonths = rangeMonths
508+
});
509+
}
510+
493511
/// <summary>
494512
/// Get a some order statistic information for Commerce manager dashboard
495513
/// </summary>
@@ -500,7 +518,18 @@ public async Task<ActionResult> DeleteOrdersByIds([FromQuery] string[] ids)
500518
[Authorize(ModuleConstants.Security.Permissions.ViewDashboardStatistics)]
501519
public async Task<ActionResult<DashboardStatisticsResult>> GetDashboardStatisticsAsync([FromQuery] DateTime? start = null, [FromQuery] DateTime? end = null)
502520
{
503-
start ??= DateTime.UtcNow.AddYears(-1);
521+
var dashboardEnabled = await settingsManager.GetValueAsync<bool>(ModuleConstants.Settings.General.DashboardStatisticsEnabled);
522+
if (!dashboardEnabled)
523+
{
524+
return Ok(new DashboardStatisticsResult());
525+
}
526+
527+
if (start == null)
528+
{
529+
var rangeMonths = await settingsManager.GetValueAsync<int>(ModuleConstants.Settings.General.DashboardStatisticsRangeMonths);
530+
start = DateTime.UtcNow.AddMonths(-rangeMonths);
531+
}
532+
504533
end ??= DateTime.UtcNow;
505534

506535
// Hack: to compensate for incorrect Local dates to UTC

src/VirtoCommerce.OrdersModule.Web/Localizations/de.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,14 @@
624624
"Order.MaxOrderDocumentCount": {
625625
"title": "Maximale Anzahl von Unterdokumenten pro Bestellung",
626626
"description": "Definiert die maximale Anzahl von Unterdokumenten (Zahlungen, Sendungen, Captures, Rückerstattungen usw.), die pro Bestellung erstellt oder gespeichert werden können. Dies gewährleistet Systemleistung, Speicheroptimierung und Datenkonsistenz. Bei Überschreitung dieser Grenze wird beim Speichern eine Ausnahme ausgelöst"
627+
},
628+
"Order.DashboardStatistics.Enable": {
629+
"title": "Dashboard-Statistiken aktivieren",
630+
"description": "Aktiviert oder deaktiviert die Bestellstatistik-Widgets auf dem Haupt-Dashboard"
631+
},
632+
"Order.DashboardStatistics.RangeMonths": {
633+
"title": "Dashboard-Statistik Zeitraum (Monate)",
634+
"description": "Definiert die Anzahl der Monate, die in die Dashboard-Statistikberechnungen einbezogen werden. Standard ist 12 Monate"
627635
}
628636
},
629637
"module": {

src/VirtoCommerce.OrdersModule.Web/Localizations/en.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,14 @@
624624
"Order.MaxOrderDocumentCount": {
625625
"title": "Maximum number of child documents per order",
626626
"description": "Defines the maximum number of child documents (payments, shipments, captures, refunds, etc.) that can be created or stored per order. This ensures system performance, storage optimization, and data consistency. An exception will be thrown on save if this limit is exceeded"
627+
},
628+
"Order.DashboardStatistics.Enable": {
629+
"title": "Enable dashboard statistics",
630+
"description": "Turn on or off the order statistics dashboard widgets on the main dashboard"
631+
},
632+
"Order.DashboardStatistics.RangeMonths": {
633+
"title": "Dashboard statistics range (months)",
634+
"description": "Defines the number of months to include in the dashboard statistics calculations. Default is 12 months"
627635
}
628636
},
629637
"module": {

src/VirtoCommerce.OrdersModule.Web/Localizations/es.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,14 @@
624624
"Order.MaxOrderDocumentCount": {
625625
"title": "Número máximo de documentos secundarios por pedido",
626626
"description": "Define el número máximo de documentos secundarios (pagos, envíos, capturas, reembolsos, etc.) que se pueden crear o almacenar por pedido. Esto garantiza el rendimiento del sistema, la optimización del almacenamiento y la consistencia de los datos. Se generará una excepción al guardar si se excede este límite"
627+
},
628+
"Order.DashboardStatistics.Enable": {
629+
"title": "Habilitar estadísticas del panel",
630+
"description": "Activa o desactiva los widgets de estadísticas de pedidos en el panel principal"
631+
},
632+
"Order.DashboardStatistics.RangeMonths": {
633+
"title": "Período de estadísticas del panel (meses)",
634+
"description": "Define el número de meses a incluir en los cálculos de estadísticas del panel. El valor predeterminado es 12 meses"
627635
}
628636
},
629637
"module": {

src/VirtoCommerce.OrdersModule.Web/Localizations/fr.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,14 @@
625625
"Order.MaxOrderDocumentCount": {
626626
"title": "Nombre maximum de documents enfants par commande",
627627
"description": "Définit le nombre maximum de documents enfants (paiements, expéditions, captures, remboursements, etc.) qui peuvent être créés ou stockés par commande. Cela garantit les performances du système, l'optimisation du stockage et la cohérence des données. Une exception sera levée lors de la sauvegarde si cette limite est dépassée"
628+
},
629+
"Order.DashboardStatistics.Enable": {
630+
"title": "Activer les statistiques du tableau de bord",
631+
"description": "Active ou désactive les widgets de statistiques de commandes sur le tableau de bord principal"
632+
},
633+
"Order.DashboardStatistics.RangeMonths": {
634+
"title": "Période des statistiques du tableau de bord (mois)",
635+
"description": "Définit le nombre de mois à inclure dans les calculs des statistiques du tableau de bord. La valeur par défaut est de 12 mois"
628636
}
629637
},
630638
"module": {

src/VirtoCommerce.OrdersModule.Web/Localizations/it.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,14 @@
624624
"Order.MaxOrderDocumentCount": {
625625
"title": "Numero massimo di documenti secondari per ordine",
626626
"description": "Definisce il numero massimo di documenti secondari (pagamenti, spedizioni, acquisizioni, rimborsi, ecc.) che possono essere creati o memorizzati per ordine. Ciò garantisce le prestazioni del sistema, l'ottimizzazione dello storage e la coerenza dei dati. Verrà generata un'eccezione durante il salvataggio se questo limite viene superato"
627+
},
628+
"Order.DashboardStatistics.Enable": {
629+
"title": "Abilita statistiche dashboard",
630+
"description": "Attiva o disattiva i widget delle statistiche ordini sulla dashboard principale"
631+
},
632+
"Order.DashboardStatistics.RangeMonths": {
633+
"title": "Intervallo statistiche dashboard (mesi)",
634+
"description": "Definisce il numero di mesi da includere nei calcoli delle statistiche della dashboard. Il valore predefinito è 12 mesi"
627635
}
628636
},
629637
"module": {

src/VirtoCommerce.OrdersModule.Web/Localizations/ja.VirtoCommerce.Orders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,14 @@
624624
"Order.MaxOrderDocumentCount": {
625625
"title": "注文あたりの子ドキュメントの最大数",
626626
"description": "注文ごとに作成または保存できる子ドキュメント(支払い、配送、キャプチャ、返金など)の最大数を定義します。これにより、システムパフォーマンス、ストレージの最適化、データの整合性が確保されます。この制限を超えた場合、保存時に例外がスローされます"
627+
},
628+
"Order.DashboardStatistics.Enable": {
629+
"title": "ダッシュボード統計を有効にする",
630+
"description": "メインダッシュボードの注文統計ウィジェットを有効または無効にします"
631+
},
632+
"Order.DashboardStatistics.RangeMonths": {
633+
"title": "ダッシュボード統計の範囲(月)",
634+
"description": "ダッシュボード統計計算に含める月数を定義します。デフォルトは12ヶ月です"
627635
}
628636
},
629637
"module": {

0 commit comments

Comments
 (0)