Add CalendarEventDocument and CalendarEventType enum for event management Update WorkDayDocument to include WorkUnitDocument and CalendarEventDocument lists Enhance CouchbaseLiteWorkDayService with methods for managing WorkUnit and CalendarEvent Revise MonthlySummaryModel to track preview worked hours and counted work units Improve CSS for calendar view, including responsive design and new item styles
80 lines
2.7 KiB
Text
80 lines
2.7 KiB
Text
@page "/settings"
|
|
@attribute [Authorize]
|
|
|
|
@inject IAppSettingsService AppSettingsService
|
|
|
|
<PageTitle>Settings</PageTitle>
|
|
|
|
<h1>Settings</h1>
|
|
<p class="text-muted">Default values used to compute manual work-unit totals and income.</p>
|
|
|
|
@if (settings is null)
|
|
{
|
|
<p><em>Loading...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<EditForm Model="settings" OnValidSubmit="SaveAsync">
|
|
<DataAnnotationsValidator />
|
|
|
|
<div class="row g-3">
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Standard work hours/day</label>
|
|
<InputNumber class="form-control" @bind-Value="settings.StandardWorkHoursPerDay" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Hourly gross rate (€)</label>
|
|
<InputNumber class="form-control" @bind-Value="settings.HourlyGrossRate" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Profitability coefficient</label>
|
|
<InputNumber class="form-control" @bind-Value="settings.ProfitabilityCoefficient" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">INPS rate</label>
|
|
<InputNumber class="form-control" @bind-Value="settings.InpsRate" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Substitute tax rate</label>
|
|
<InputNumber class="form-control" @bind-Value="settings.SubstituteTaxRate" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Locale</label>
|
|
<InputText class="form-control" @bind-Value="settings.Locale" />
|
|
</div>
|
|
<div class="col-12 col-md-6">
|
|
<label class="form-label">Currency</label>
|
|
<InputText class="form-control" @bind-Value="settings.Currency" />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex align-items-center gap-2 mt-4">
|
|
<button class="btn btn-primary" type="submit">Save</button>
|
|
@if (!string.IsNullOrWhiteSpace(statusMessage))
|
|
{
|
|
<span class="text-success">@statusMessage</span>
|
|
}
|
|
</div>
|
|
</EditForm>
|
|
}
|
|
|
|
@code {
|
|
private AppSettingsDocument? settings;
|
|
private string? statusMessage;
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
settings = await AppSettingsService.GetAsync();
|
|
}
|
|
|
|
private async Task SaveAsync()
|
|
{
|
|
if (settings is null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
settings = await AppSettingsService.SaveAsync(settings);
|
|
statusMessage = $"Saved at {DateTime.Now:t}";
|
|
}
|
|
}
|