79492184d0
- WBS-CRM-02: 상담 이력 (consultations 테이블 V008, ClientDetail.razor) - WBS-CRM-03: 문의→고객 전환 (V009 client_id FK, InquiryDetail 고객등록 버튼) - WBS-CRM-04: 신고 일정 캘린더 (tax_filings 테이블 V010, TaxFilingList.razor) - WBS-CRM-05: 문의 상태 5단계 확장 (V011, InquiryStatus enum, InquiryList 탭) - WBS-MKT-04: 시즌 시뮬레이터 어드민 페이지 (SeasonSimulator.razor) - WBS-UX-04: 개인정보처리방침 /taxbaik/privacy, 이용약관 /taxbaik/terms - Dashboard.razor 마감 임박 신고 위젯 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
127 lines
4.9 KiB
Plaintext
127 lines
4.9 KiB
Plaintext
@page "/admin/tax-filings"
|
|
@attribute [Authorize]
|
|
@using TaxBaik.Application.Services
|
|
@inject TaxFilingService FilingService
|
|
@inject ClientService ClientService
|
|
@inject ISnackbar Snackbar
|
|
|
|
<PageTitle>신고 일정 관리</PageTitle>
|
|
|
|
<section class="admin-page-hero">
|
|
<div>
|
|
<MudText Typo="Typo.caption" Class="admin-eyebrow">Tax Schedule</MudText>
|
|
<MudText Typo="Typo.h4" Class="admin-page-title">신고 일정</MudText>
|
|
<MudText Typo="Typo.body2" Class="admin-page-subtitle">고객별 세금 신고 마감일을 관리하고 완료 처리합니다.</MudText>
|
|
</div>
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary"
|
|
OnClick="@(() => showAddForm = !showAddForm)"
|
|
StartIcon="@Icons.Material.Filled.Add">
|
|
일정 추가
|
|
</MudButton>
|
|
</section>
|
|
|
|
@if (showAddForm)
|
|
{
|
|
<MudPaper Class="pa-4 mb-4" Elevation="1">
|
|
<MudText Typo="Typo.h6" Class="mb-3">새 신고 일정</MudText>
|
|
<MudGrid Spacing="2">
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudAutocomplete T="Domain.Entities.Client" @bind-Value="selectedClient"
|
|
Label="고객 검색 *"
|
|
SearchFunc="SearchClients"
|
|
ToStringFunc="@(c => c == null ? "" : $"{c.Name} {c.CompanyName ?? ""}")"
|
|
Variant="Variant.Outlined" />
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudSelect T="string" @bind-Value="newFilingType" Label="신고 유형 *" Variant="Variant.Outlined">
|
|
@foreach (var t in TaxFilingService.FilingTypes)
|
|
{
|
|
<MudSelectItem Value="@t">@t</MudSelectItem>
|
|
}
|
|
</MudSelect>
|
|
</MudItem>
|
|
<MudItem xs="12" sm="6" md="4">
|
|
<MudDatePicker @bind-Date="newDueDate" Label="신고 기한 *" DateFormat="yyyy-MM-dd" />
|
|
</MudItem>
|
|
<MudItem xs="12">
|
|
<MudTextField T="string" @bind-Value="newMemo" Label="메모" Variant="Variant.Outlined" />
|
|
</MudItem>
|
|
</MudGrid>
|
|
<MudStack Row="true" Class="mt-3" Spacing="2">
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="AddFiling">저장</MudButton>
|
|
<MudButton Variant="Variant.Outlined" OnClick="@(() => showAddForm = false)">취소</MudButton>
|
|
</MudStack>
|
|
</MudPaper>
|
|
}
|
|
|
|
<MudPaper Class="admin-surface" Elevation="0">
|
|
<MudTabs Rounded="true" Elevation="0" Class="admin-tabs">
|
|
<MudTabPanel Text="신고 예정">
|
|
<FilingTable Filings="@pending" OnStatusChange="Reload" />
|
|
</MudTabPanel>
|
|
<MudTabPanel Text="신고 완료">
|
|
<FilingTable Filings="@filed" OnStatusChange="Reload" />
|
|
</MudTabPanel>
|
|
<MudTabPanel Text="기한 초과">
|
|
<FilingTable Filings="@overdue" OnStatusChange="Reload" />
|
|
</MudTabPanel>
|
|
</MudTabs>
|
|
</MudPaper>
|
|
|
|
@code {
|
|
private List<Domain.Entities.TaxFiling> pending = [];
|
|
private List<Domain.Entities.TaxFiling> filed = [];
|
|
private List<Domain.Entities.TaxFiling> overdue = [];
|
|
|
|
private bool showAddForm;
|
|
private Domain.Entities.Client? selectedClient;
|
|
private string newFilingType = "";
|
|
private DateTime? newDueDate = DateTime.Today.AddDays(30);
|
|
private string newMemo = "";
|
|
|
|
protected override async Task OnInitializedAsync() => await Reload();
|
|
|
|
private async Task Reload()
|
|
{
|
|
var all = (await FilingService.GetUpcomingAsync(365)).ToList();
|
|
// Also get filed ones by fetching all
|
|
pending = all.Where(x => x.Status == "pending").ToList();
|
|
filed = all.Where(x => x.Status == "filed").ToList();
|
|
overdue = all.Where(x => x.Status == "overdue").ToList();
|
|
}
|
|
|
|
private async Task<IEnumerable<Domain.Entities.Client>> SearchClients(string value)
|
|
{
|
|
var (items, _) = await ClientService.GetPagedAsync(1, 20, search: value);
|
|
return items;
|
|
}
|
|
|
|
private async Task AddFiling()
|
|
{
|
|
try
|
|
{
|
|
if (selectedClient == null)
|
|
{
|
|
Snackbar.Add("고객을 선택하세요.", Severity.Warning);
|
|
return;
|
|
}
|
|
var filing = new Domain.Entities.TaxFiling
|
|
{
|
|
ClientId = selectedClient.Id,
|
|
FilingType = newFilingType,
|
|
DueDate = newDueDate?.ToUniversalTime() ?? DateTime.UtcNow,
|
|
Status = "pending",
|
|
Memo = string.IsNullOrWhiteSpace(newMemo) ? null : newMemo
|
|
};
|
|
await FilingService.CreateAsync(filing);
|
|
showAddForm = false;
|
|
Snackbar.Add("신고 일정이 추가되었습니다.", Severity.Success);
|
|
await Reload();
|
|
}
|
|
catch (ValidationException ex)
|
|
{
|
|
Snackbar.Add(ex.Message, Severity.Error);
|
|
}
|
|
}
|
|
}
|