|
@@ -3,9 +3,11 @@
|
|
|
ViewData["Title"] = "Monthly Reward Payout";
|
|
ViewData["Title"] = "Monthly Reward Payout";
|
|
|
string Number(decimal value) => value.ToString("#,##0.##");
|
|
string Number(decimal value) => value.ToString("#,##0.##");
|
|
|
string Money(decimal value) => value.ToString("#,##0.00");
|
|
string Money(decimal value) => value.ToString("#,##0.00");
|
|
|
- string PageUrl(int page) => Url.Content("~/MonthlyRewardPayoutReport")
|
|
|
|
|
|
|
+ string ReportUrl(string tab, int page = 1) => Url.Content("~/MonthlyRewardPayoutReport")
|
|
|
+ "?selectedMonth=" + System.Uri.EscapeDataString(Model.SelectedMonth)
|
|
+ "?selectedMonth=" + System.Uri.EscapeDataString(Model.SelectedMonth)
|
|
|
|
|
+ + "&tab=" + System.Uri.EscapeDataString(tab)
|
|
|
+ "&page=" + page;
|
|
+ "&page=" + page;
|
|
|
|
|
+ string PageUrl(int page) => ReportUrl(Model.ActiveTab, page);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
<div class="py-6 sm:py-8">
|
|
<div class="py-6 sm:py-8">
|
|
@@ -13,7 +15,23 @@
|
|
|
<div class="border-b border-gray-100 px-5 py-5 sm:px-6">
|
|
<div class="border-b border-gray-100 px-5 py-5 sm:px-6">
|
|
|
<h1 class="text-2xl font-bold text-gray-900">Monthly Reward Payout Report</h1>
|
|
<h1 class="text-2xl font-bold text-gray-900">Monthly Reward Payout Report</h1>
|
|
|
|
|
|
|
|
|
|
+ <div class="mt-5 inline-flex rounded-2xl bg-gray-100 p-1" role="tablist" aria-label="Report view">
|
|
|
|
|
+ <a href="@ReportUrl("daily")"
|
|
|
|
|
+ role="tab"
|
|
|
|
|
+ aria-selected="@(!Model.IsMonthlySummary ? "true" : "false")"
|
|
|
|
|
+ class="rounded-xl px-5 py-2.5 text-sm font-semibold transition @(!Model.IsMonthlySummary ? "bg-white text-admin-active shadow-sm" : "text-gray-500 hover:text-gray-800")">
|
|
|
|
|
+ By day
|
|
|
|
|
+ </a>
|
|
|
|
|
+ <a href="@ReportUrl("monthly")"
|
|
|
|
|
+ role="tab"
|
|
|
|
|
+ aria-selected="@(Model.IsMonthlySummary ? "true" : "false")"
|
|
|
|
|
+ class="rounded-xl px-5 py-2.5 text-sm font-semibold transition @(Model.IsMonthlySummary ? "bg-white text-admin-active shadow-sm" : "text-gray-500 hover:text-gray-800")">
|
|
|
|
|
+ By month
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<form method="get" action="@Url.Content("~/MonthlyRewardPayoutReport")" class="mt-5 flex flex-col gap-3 sm:flex-row sm:items-end">
|
|
<form method="get" action="@Url.Content("~/MonthlyRewardPayoutReport")" class="mt-5 flex flex-col gap-3 sm:flex-row sm:items-end">
|
|
|
|
|
+ <input type="hidden" name="tab" value="@Model.ActiveTab" />
|
|
|
<label class="block sm:w-64">
|
|
<label class="block sm:w-64">
|
|
|
<span class="mb-2 block text-sm font-semibold text-gray-700">Month</span>
|
|
<span class="mb-2 block text-sm font-semibold text-gray-700">Month</span>
|
|
|
<input type="month" name="selectedMonth" value="@Model.SelectedMonth" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100" />
|
|
<input type="month" name="selectedMonth" value="@Model.SelectedMonth" class="w-full rounded-2xl border border-gray-200 px-4 py-3 text-sm outline-none transition focus:border-admin-active focus:ring-2 focus:ring-purple-100" />
|
|
@@ -36,43 +54,82 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="overflow-hidden rounded-3xl border border-gray-100">
|
|
<div class="overflow-hidden rounded-3xl border border-gray-100">
|
|
|
<div class="overflow-x-auto">
|
|
<div class="overflow-x-auto">
|
|
|
- <table class="min-w-full divide-y divide-gray-100">
|
|
|
|
|
- <thead class="bg-gray-50">
|
|
|
|
|
- <tr class="text-left text-xs font-bold uppercase tracking-wider text-gray-500">
|
|
|
|
|
- <th class="px-4 py-3">Date</th>
|
|
|
|
|
- <th class="px-4 py-3">Reward type</th>
|
|
|
|
|
- <th class="px-4 py-3">Prize value</th>
|
|
|
|
|
- <th class="px-4 py-3">Paid count</th>
|
|
|
|
|
- <th class="px-4 py-3">Total reward</th>
|
|
|
|
|
- <th class="px-4 py-3">MMK / unit</th>
|
|
|
|
|
- <th class="px-4 py-3">MMK / prize</th>
|
|
|
|
|
- <th class="px-4 py-3">Total MMK</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody class="divide-y divide-gray-100 bg-white text-sm text-gray-700">
|
|
|
|
|
- @foreach (var item in Model.Items)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ @if (Model.IsMonthlySummary)
|
|
|
|
|
+ {
|
|
|
|
|
+ <table class="min-w-full divide-y divide-gray-100">
|
|
|
|
|
+ <thead class="bg-gray-50">
|
|
|
|
|
+ <tr class="text-left text-xs font-bold uppercase tracking-wider text-gray-500">
|
|
|
|
|
+ <th class="px-4 py-3">Month</th>
|
|
|
|
|
+ <th class="px-4 py-3">Reward type</th>
|
|
|
|
|
+ <th class="px-4 py-3">Paid count</th>
|
|
|
|
|
+ <th class="px-4 py-3">Total reward</th>
|
|
|
|
|
+ <th class="px-4 py-3">MMK / unit</th>
|
|
|
|
|
+ <th class="px-4 py-3">Total MMK</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody class="divide-y divide-gray-100 bg-white text-sm text-gray-700">
|
|
|
|
|
+ @foreach (var item in Model.MonthlyItems)
|
|
|
|
|
+ {
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@item.Month.ToString("MM/yyyy")</td>
|
|
|
|
|
+ <td class="px-4 py-4"><span class="rounded-full px-3 py-1 text-xs font-bold @(item.RewardType == "DATA" ? "bg-blue-50 text-blue-700" : "bg-amber-50 text-amber-700")">@item.RewardType</span></td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Number(item.PayoutCount)</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@Number(item.TotalRewardValue) @item.RewardUnit</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Number(item.MmkRate)</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-bold text-gray-900">@Money(item.TotalMmk) MMK</td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ }
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ <tfoot class="border-t-2 border-purple-100 bg-purple-50 text-sm">
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@item.PayoutDate.ToString("dd/MM/yyyy")</td>
|
|
|
|
|
- <td class="px-4 py-4"><span class="rounded-full px-3 py-1 text-xs font-bold @(item.RewardType == "DATA" ? "bg-blue-50 text-blue-700" : "bg-amber-50 text-amber-700")">@item.RewardType</span></td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@Number(item.RewardValue) @item.RewardUnit</td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4">@Number(item.PayoutCount)</td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4">@Number(item.TotalRewardValue) @item.RewardUnit</td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4">@Number(item.MmkRate)</td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4">@Money(item.MmkPerPrize) MMK</td>
|
|
|
|
|
- <td class="whitespace-nowrap px-4 py-4 font-bold text-gray-900">@Money(item.TotalMmk) MMK</td>
|
|
|
|
|
|
|
+ <td colspan="2" 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="2" class="px-4 py-4 text-right text-xs font-semibold text-purple-600">All reward types in @Model.SelectedMonth</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-bold text-purple-900">@Money(Model.GrandTotalMmk) MMK</td>
|
|
|
</tr>
|
|
</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>
|
|
|
|
|
|
|
+ </tfoot>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ <table class="min-w-full divide-y divide-gray-100">
|
|
|
|
|
+ <thead class="bg-gray-50">
|
|
|
|
|
+ <tr class="text-left text-xs font-bold uppercase tracking-wider text-gray-500">
|
|
|
|
|
+ <th class="px-4 py-3">Date</th>
|
|
|
|
|
+ <th class="px-4 py-3">Reward type</th>
|
|
|
|
|
+ <th class="px-4 py-3">Prize value</th>
|
|
|
|
|
+ <th class="px-4 py-3">Paid count</th>
|
|
|
|
|
+ <th class="px-4 py-3">Total reward</th>
|
|
|
|
|
+ <th class="px-4 py-3">MMK / unit</th>
|
|
|
|
|
+ <th class="px-4 py-3">MMK / prize</th>
|
|
|
|
|
+ <th class="px-4 py-3">Total MMK</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody class="divide-y divide-gray-100 bg-white text-sm text-gray-700">
|
|
|
|
|
+ @foreach (var item in Model.Items)
|
|
|
|
|
+ {
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@item.PayoutDate.ToString("dd/MM/yyyy")</td>
|
|
|
|
|
+ <td class="px-4 py-4"><span class="rounded-full px-3 py-1 text-xs font-bold @(item.RewardType == "DATA" ? "bg-blue-50 text-blue-700" : "bg-amber-50 text-amber-700")">@item.RewardType</span></td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-semibold text-gray-900">@Number(item.RewardValue) @item.RewardUnit</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Number(item.PayoutCount)</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Number(item.TotalRewardValue) @item.RewardUnit</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Number(item.MmkRate)</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4">@Money(item.MmkPerPrize) MMK</td>
|
|
|
|
|
+ <td class="whitespace-nowrap px-4 py-4 font-bold text-gray-900">@Money(item.TotalMmk) MMK</td>
|
|
|
|
|
+ </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>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|