student 1 lună în urmă
părinte
comite
fc03c378ef

+ 2 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Cms/Controllers/MonthlyRewardPayoutReportController.cs

@@ -94,6 +94,8 @@ public class MonthlyRewardPayoutReportController : CmsAuthorizedController
             .ToList();
 
         model.TotalRows = items.Count;
+        model.GrandTotalPayoutCount = items.Sum(x => x.PayoutCount);
+        model.GrandTotalMmk = items.Sum(x => x.TotalMmk);
         model.TotalPages = Math.Max(1, (int)Math.Ceiling(model.TotalRows / (double)PageSize));
         model.Page = Math.Min(model.Page, model.TotalPages);
         model.Items = items

+ 6 - 2
Kitty_Fall/Kitty_Fall/Kitty_Fall.Cms/Models/MonthlyRewardPayoutReportViewModel.cs

@@ -14,11 +14,15 @@ public class MonthlyRewardPayoutReportViewModel
 
     public int TotalPages { get; set; } = 1;
 
+    public decimal GrandTotalPayoutCount { get; set; }
+
+    public decimal GrandTotalMmk { get; set; }
+
     public List<MonthlyRewardPayoutItemViewModel> Items { get; set; } = new();
 
-    public decimal TotalPayoutCount => Items.Sum(x => x.PayoutCount);
+    public decimal TotalPayoutCount => GrandTotalPayoutCount;
 
-    public decimal TotalMmk => Items.Sum(x => x.TotalMmk);
+    public decimal TotalMmk => GrandTotalMmk;
 }
 
 public class MonthlyRewardPayoutItemViewModel

+ 8 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Cms/Views/MonthlyRewardPayoutReport/Index.cshtml

@@ -64,6 +64,14 @@
                                     </tr>
                                 }
                             </tbody>
+                            <tfoot class="border-t-2 border-purple-100 bg-purple-50 text-sm">
+                                <tr>
+                                    <td colspan="3" class="px-4 py-4 text-right font-bold uppercase tracking-wider text-purple-900">Grand total</td>
+                                    <td class="whitespace-nowrap px-4 py-4 font-bold text-purple-900">@Number(Model.GrandTotalPayoutCount)</td>
+                                    <td colspan="3" class="px-4 py-4 text-right text-xs font-semibold text-purple-600">All rows in @Model.SelectedMonth</td>
+                                    <td class="whitespace-nowrap px-4 py-4 font-bold text-purple-900">@Money(Model.GrandTotalMmk) MMK</td>
+                                </tr>
+                            </tfoot>
                         </table>
                     </div>
                 </div>