From 81ee23e313784aaf30afc79fd6c283d5efad02d1 Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Sun, 28 Dec 2025 21:20:43 +0330 Subject: [PATCH] feat(BalancesReport): enhance balance display with new member counts and totals --- src/BackOffice/App.razor | 2 +- src/BackOffice/BackOffice.csproj | 2 +- .../Pages/Network/BalancesReport.razor | 91 +++++++++++++++---- 3 files changed, 73 insertions(+), 22 deletions(-) diff --git a/src/BackOffice/App.razor b/src/BackOffice/App.razor index 598cb71..7d5b3e1 100644 --- a/src/BackOffice/App.razor +++ b/src/BackOffice/App.razor @@ -23,7 +23,7 @@ یافت نشد -

آدرس مورد نظر یافت نشد

+

آدرس مورد نظر یافت نشد

diff --git a/src/BackOffice/BackOffice.csproj b/src/BackOffice/BackOffice.csproj index 358c6ee..5dbab5f 100644 --- a/src/BackOffice/BackOffice.csproj +++ b/src/BackOffice/BackOffice.csproj @@ -114,7 +114,7 @@ - + diff --git a/src/BackOffice/Pages/Network/BalancesReport.razor b/src/BackOffice/Pages/Network/BalancesReport.razor index 27b04fb..6c63719 100644 --- a/src/BackOffice/Pages/Network/BalancesReport.razor +++ b/src/BackOffice/Pages/Network/BalancesReport.razor @@ -68,26 +68,62 @@ Filterable="true" Hover="true"> - + + - + + - - @context.Item.LeftBalance.ToString("N0") - + + + + @context.Item.LeftNewMembers + + + + + + + @context.Item.LeftCarryover + + + = + + + @context.Item.LeftTotal + + + - - + + + - - @context.Item.RightBalance.ToString("N0") - + + + + @context.Item.RightNewMembers + + + + + + + @context.Item.RightCarryover + + + = + + + @context.Item.RightTotal + + + - - + + + - @context.Item.MatchedBalance.ToString("N0") + @context.Item.MatchedBalance @@ -99,7 +135,7 @@ - @(context.Item.IsExpired ? "منقضی شده" : "فعال") + @(context.Item.IsExpired ? "منقضی" : "فعال") @@ -188,9 +224,14 @@ private MudDataGrid _grid { get; set; } var items = response.Models.Select(b => new UserWeeklyBalanceModel { UserId = b.UserId, + UserFullName = b.UserFullName, WeekDisplayName = b.WeekDisplayName, - LeftBalance = b.LeftLegBalances, - RightBalance = b.RightLegBalances, + LeftNewMembers = b.LeftLegNewMembers, + LeftCarryover = b.LeftLegCarryover, + LeftTotal = b.LeftLegTotal, + RightNewMembers = b.RightLegNewMembers, + RightCarryover = b.RightLegCarryover, + RightTotal = b.RightLegTotal, MatchedBalance = b.TotalBalances, PoolContribution = b.WeeklyPoolContribution, CalculatedAt = b.CalculatedAt?.ToDateTime(), @@ -228,8 +269,8 @@ private MudDataGrid _grid { get; set; } private void CalculateTotals(List items) { - _totalLeftBalance = items.Sum(b => (long)b.LeftBalance); - _totalRightBalance = items.Sum(b => (long)b.RightBalance); + _totalLeftBalance = items.Sum(b => (long)b.LeftTotal); + _totalRightBalance = items.Sum(b => (long)b.RightTotal); _totalMatchedBalance = items.Sum(b => (long)b.MatchedBalance); } @@ -247,9 +288,19 @@ private MudDataGrid _grid { get; set; } private class UserWeeklyBalanceModel { public long UserId { get; set; } + public string UserFullName { get; set; } = string.Empty; public string WeekDisplayName { get; set; } - public int LeftBalance { get; set; } - public int RightBalance { get; set; } + + // چپ + public int LeftNewMembers { get; set; } + public int LeftCarryover { get; set; } + public int LeftTotal { get; set; } + + // راست + public int RightNewMembers { get; set; } + public int RightCarryover { get; set; } + public int RightTotal { get; set; } + public int MatchedBalance { get; set; } public long PoolContribution { get; set; } public DateTime? CalculatedAt { get; set; }