feat: add withdrawal requests feature and update VAT loading mechanism
Build and Deploy / build (push) Successful in 1m25s
Build and Deploy / build (push) Successful in 1m25s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
@attribute [Route(RouteConstants.Commission.WeeklyBalance)]
|
||||
@using FrontOffice.Main.Utilities
|
||||
@using FrontOffice.Main.Shared
|
||||
@using MudBlazor
|
||||
|
||||
<PageTitle>تعادل هفتگی</PageTitle>
|
||||
@@ -13,20 +14,38 @@
|
||||
|
||||
<!-- انتخاب هفته -->
|
||||
<MudPaper Elevation="2" Class="pa-3 rounded-lg">
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.End">
|
||||
<MudNumericField @bind-Value="_selectedWeekNumber"
|
||||
Label="شماره هفته"
|
||||
Variant="Variant.Outlined"
|
||||
Min="1"
|
||||
HelperText="هفته مورد نظر را انتخاب کنید (خالی = هفته جاری)"
|
||||
Style="max-width: 200px;" />
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="LoadWeeklyBalanceAsync" StartIcon="@Icons.Material.Filled.Search">
|
||||
مشاهده
|
||||
</MudButton>
|
||||
<MudButton Variant="Variant.Outlined" OnClick="LoadCurrentWeekAsync" StartIcon="@Icons.Material.Filled.Today">
|
||||
هفته جاری
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="8" sm="6" md="6">
|
||||
<WeekSelector @ref="_weekSelector"
|
||||
@bind-Value="_selectedWeekDefinition"
|
||||
Label="انتخاب هفته"
|
||||
Placeholder="هفته را جستجو یا انتخاب کنید"
|
||||
Variant="Variant.Outlined"
|
||||
Dense="false"
|
||||
OnlyActive="true" />
|
||||
</MudItem>
|
||||
@* <MudItem xs="4" sm="3" md="3"> *@
|
||||
@* <MudButton Variant="Variant.Outlined" *@
|
||||
@* OnClick="LoadCurrentWeekAsync" *@
|
||||
@* StartIcon="@Icons.Material.Filled.Today" *@
|
||||
@* FullWidth="true" *@
|
||||
@* Style="height: 56px;"> *@
|
||||
@* هفته جاری *@
|
||||
@* </MudButton> *@
|
||||
@* </MudItem> *@
|
||||
<MudItem xs="4" sm="3" md="3" Class="pt-6">
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
OnClick="LoadWeeklyBalanceAsync"
|
||||
StartIcon="@Icons.Material.Filled.Search"
|
||||
Disabled="@(_selectedWeekDefinition == null)"
|
||||
FullWidth="true"
|
||||
Style="height: 50px;">
|
||||
جستجو
|
||||
</MudButton>
|
||||
</MudItem>
|
||||
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
|
||||
@if (_isLoading)
|
||||
@@ -35,113 +54,89 @@
|
||||
}
|
||||
else if (_weeklyBalance is not null)
|
||||
{
|
||||
<!-- اطلاعات هفته -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudStack Spacing="2">
|
||||
<MudText Typo="Typo.h6">هفته @_weeklyBalance.WeekNumber - @_weeklyBalance.WeekLabel</MudText>
|
||||
<MudDivider />
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">تاریخ شروع:</MudText>
|
||||
<MudText Typo="Typo.body1"><strong>@_weeklyBalance.StartDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="12" sm="6">
|
||||
<MudText Typo="Typo.subtitle2" Class="mud-text-secondary">تاریخ پایان:</MudText>
|
||||
<MudText Typo="Typo.body1"><strong>@_weeklyBalance.EndDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudStack>
|
||||
<!-- اطلاعات هفته - کامپکت -->
|
||||
<MudPaper Elevation="2" Class="pa-3 rounded-lg">
|
||||
<MudGrid Spacing="1">
|
||||
<MudItem xs="12" sm="4">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
||||
<MudIcon Icon="@Icons.Material.Filled.DateRange" Size="Size.Small" Color="Color.Primary" />
|
||||
<MudText Typo="Typo.body2"><strong>@_weeklyBalance.WeekDisplayName</strong></MudText>
|
||||
</MudStack>
|
||||
</MudItem>
|
||||
<MudItem xs="6" sm="4">
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">شروع: <strong>@_weeklyBalance.StartDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
<MudItem xs="6" sm="4">
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">پایان: <strong>@_weeklyBalance.EndDatePersian</strong></MudText>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudPaper>
|
||||
|
||||
<!-- تعادل چپ و راست -->
|
||||
<!-- تعادل چپ و راست - کارتهای بزرگ -->
|
||||
<MudGrid Spacing="2">
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronLeft" Color="Color.Info" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Info">شاخه چپ</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h4" Color="Color.Info">@_weeklyBalance.LeftBalanceFormatted</MudText>
|
||||
<MudItem xs="6">
|
||||
<MudPaper Elevation="3" Class="pa-4 rounded-lg text-center" Style="background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);">
|
||||
<MudStack Spacing="1" AlignItems="AlignItems.Center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronLeft" Color="Color.Info" Size="Size.Large" />
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Info">شاخه چپ</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Info" Style="font-weight: bold;">@_weeklyBalance.LeftBalanceFormatted</MudText>
|
||||
<MudProgressLinear Color="Color.Info"
|
||||
Value="@GetLeftPercentage()"
|
||||
Size="Size.Large"
|
||||
Class="rounded-lg" />
|
||||
Size="Size.Medium"
|
||||
Class="rounded-lg mt-2"
|
||||
Style="width: 100%;" />
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
@GetLeftPercentage().ToString("F1")% از کل تعادل
|
||||
@GetLeftPercentage().ToString("F1")% از کل
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
|
||||
<MudItem xs="12" md="6">
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg" Style="height: 100%;">
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronRight" Color="Color.Success" Size="Size.Large" />
|
||||
<MudText Typo="Typo.h6" Color="Color.Success">شاخه راست</MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.h4" Color="Color.Success">@_weeklyBalance.RightBalanceFormatted</MudText>
|
||||
<MudItem xs="6">
|
||||
<MudPaper Elevation="3" Class="pa-4 rounded-lg text-center" Style="background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);">
|
||||
<MudStack Spacing="1" AlignItems="AlignItems.Center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.ChevronRight" Color="Color.Success" Size="Size.Large" />
|
||||
<MudText Typo="Typo.subtitle2" Color="Color.Success">شاخه راست</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Success" Style="font-weight: bold;">@_weeklyBalance.RightBalanceFormatted</MudText>
|
||||
<MudProgressLinear Color="Color.Success"
|
||||
Value="@GetRightPercentage()"
|
||||
Size="Size.Large"
|
||||
Class="rounded-lg" />
|
||||
Size="Size.Medium"
|
||||
Class="rounded-lg mt-2"
|
||||
Style="width: 100%;" />
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">
|
||||
@GetRightPercentage().ToString("F1")% از کل تعادل
|
||||
@GetRightPercentage().ToString("F1")% از کل
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
|
||||
<!-- محاسبات کمیسیون -->
|
||||
<!-- محاسبات کمیسیون - فشردهتر -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">محاسبات کمیسیون</MudText>
|
||||
<MudStack Spacing="2">
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعادل چپ:</MudText>
|
||||
<MudText Typo="Typo.body1" Color="Color.Info"><strong>@_weeklyBalance.LeftBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعادل راست:</MudText>
|
||||
<MudText Typo="Typo.body1" Color="Color.Success"><strong>@_weeklyBalance.RightBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudDivider />
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">حداقل تعادل (پایه کمیسیون):</MudText>
|
||||
<MudText Typo="Typo.h6" Color="Color.Warning"><strong>@_weeklyBalance.MinBalanceFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.body1">تعداد تعادل (دفعات):</MudText>
|
||||
<MudText Typo="Typo.h6" Color="Color.Secondary"><strong>@_weeklyBalance.BalanceCount</strong></MudText>
|
||||
</MudStack>
|
||||
<MudDivider />
|
||||
<MudStack Row="true" Justify="Justify.SpaceBetween" AlignItems="AlignItems.Center">
|
||||
<MudText Typo="Typo.h6">کمیسیون محاسبه شده:</MudText>
|
||||
<MudText Typo="Typo.h5" Color="Color.Primary"><strong>@_weeklyBalance.CalculatedCommissionFormatted</strong></MudText>
|
||||
</MudStack>
|
||||
<MudText Typo="Typo.subtitle1" Class="mb-2" Style="font-weight: bold;">محاسبات کمیسیون</MudText>
|
||||
<MudSimpleTable Dense="true" Hover="true" Style="background: transparent;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><MudText Typo="Typo.body2">حداقل تعادل (پایه کمیسیون):</MudText></td>
|
||||
<td class="text-end"><MudText Typo="Typo.body1" Color="Color.Warning"><strong>@_weeklyBalance.MinBalanceFormatted</strong></MudText></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><MudText Typo="Typo.body2">تعداد تعادل (دفعات):</MudText></td>
|
||||
<td class="text-end"><MudText Typo="Typo.body1" Color="Color.Secondary"><strong>@_weeklyBalance.BalanceCount</strong></MudText></td>
|
||||
</tr>
|
||||
<tr style="background-color: var(--mud-palette-primary-lighten);">
|
||||
<td><MudText Typo="Typo.subtitle1"><strong>کمیسیون محاسبه شده:</strong></MudText></td>
|
||||
<td class="text-end"><MudText Typo="Typo.h6" Color="Color.Primary"><strong>@_weeklyBalance.CalculatedCommissionFormatted</strong></MudText></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</MudSimpleTable>
|
||||
|
||||
@if (_weeklyBalance.LeftCarryover > 0 || _weeklyBalance.RightCarryover > 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Outlined">
|
||||
<MudText Typo="Typo.body2">
|
||||
<strong>Carryover (انتقال به هفته بعد):</strong><br />
|
||||
چپ: @_weeklyBalance.LeftCarryoverFormatted | راست: @_weeklyBalance.RightCarryoverFormatted
|
||||
</MudText>
|
||||
</MudAlert>
|
||||
}
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
<!-- نمودار مقایسه -->
|
||||
<MudPaper Elevation="2" Class="pa-4 rounded-lg">
|
||||
<MudText Typo="Typo.h6" Class="mb-3">نمودار مقایسه</MudText>
|
||||
<MudChart ChartType="ChartType.Bar"
|
||||
Width="100%"
|
||||
Height="300px"
|
||||
InputData="@(new double[] { _weeklyBalance.LeftBalance, _weeklyBalance.RightBalance, _weeklyBalance.MinBalance })"
|
||||
InputLabels="@(new[] { "چپ", "راست", "حداقل" })"
|
||||
ChartOptions="@_chartOptions" />
|
||||
@if (_weeklyBalance.LeftCarryover > 0 || _weeklyBalance.RightCarryover > 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Variant="Variant.Text" Dense="true" Class="mt-2">
|
||||
<strong>انتقال به هفته بعد:</strong> چپ: @_weeklyBalance.LeftCarryoverFormatted | راست: @_weeklyBalance.RightCarryoverFormatted
|
||||
</MudAlert>
|
||||
}
|
||||
</MudPaper>
|
||||
}
|
||||
else if (_hasError)
|
||||
|
||||
Reference in New Issue
Block a user