This commit is contained in:
rossmill76 committed 2026-03-23 15:05:57 +00:00
1 parent 2bfe914c8f
commit 4281924ee5
16 files changed
+369 -76

No files matched your search

+59
View File
@@ -119,6 +119,7 @@ else
}
</td>
<td class="text-end text-nowrap">
<button class="btn btn-sm btn-outline-secondary me-1" @onclick="() => OpenEditModal(s)">✏️ Edit</button>
<button class="btn btn-sm btn-outline-danger" @onclick="() => ConfirmDelete(s)">Delete</button>
</td>
</tr>
@@ -155,6 +156,64 @@ else
</div>
}
@if (_showEditModal)
{
<div class="modal d-block" tabindex="-1" style="background: rgba(0,0,0,.5);">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Income Source</h5>
<button type="button" class="btn-close" @onclick="CancelEdit"></button>
</div>
<EditForm Model="_editFormModel" OnValidSubmit="SaveEdit" FormName="editSalary">
<ToastValidator />
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Name</label>
<InputText @bind-Value="_editFormModel.Name" class="form-control" />
</div>
<div class="mb-3">
<label class="form-label">Amount</label>
<InputNumber @bind-Value="_editFormModel.Amount" class="form-control numeric-input" />
</div>
<div class="mb-3">
<label class="form-label">Account</label>
<InputSelect @bind-Value="_editFormModel.AccountId" class="form-select">
@if (_accountsList is not null)
{
@foreach (var account in _accountsList)
{
<option value="@account.Id">@account.Name</option>
}
}
</InputSelect>
</div>
<div class="mb-3">
<label class="form-label">Recurrence</label>
<InputSelect @bind-Value="_editFormModel.RecurrenceType" class="form-select">
<option value="@RecurrenceType.Weekly">Weekly</option>
<option value="@RecurrenceType.Monthly">Monthly</option>
<option value="@RecurrenceType.Yearly">Yearly</option>
</InputSelect>
</div>
<div class="mb-3">
<label class="form-label">First Payday</label>
<InputDate @bind-Value="_editFormModel.StartDate" class="form-control" />
</div>
<p class="text-muted mb-0" style="font-size: 0.85rem;">
Saving will delete all future unpaid salary transactions and regenerate them with the updated settings.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" @onclick="CancelEdit">Cancel</button>
<button type="submit" class="btn btn-primary">Save Changes</button>
</div>
</EditForm>
</div>
</div>
</div>
}
@code {
// Delete state