diff --git a/Schaad.Accounting.Common/Models/Transaction.cs b/Schaad.Accounting.Common/Models/Transaction.cs index e593ca9..1b797ba 100644 --- a/Schaad.Accounting.Common/Models/Transaction.cs +++ b/Schaad.Accounting.Common/Models/Transaction.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; -using System.Text.Json.Serialization; namespace Schaad.Accounting.Models { @@ -43,9 +42,6 @@ namespace Schaad.Accounting.Models [Display(Name = "Währungskurs")] public decimal? FxRate { get; set; } - - [JsonIgnore] - public bool ReadOnly {get; set;} public Transaction() { diff --git a/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor b/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor index ab5251e..ef7b131 100644 --- a/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor +++ b/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor @@ -35,7 +35,7 @@ else
- + @foreach (var text in bookingTexts.OrderBy(t => t)) { @@ -60,13 +60,12 @@ else + OnClick="@(() => SplitBankTransactionAsync(transaction))" Disabled="@(transaction.Value > 0)" /> + OnClick="@(() => BookBankTransactionAsync(transaction))" /> } diff --git a/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor.cs b/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor.cs index 3114b57..4c3acbb 100644 --- a/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/PendingBookings.razor.cs @@ -58,7 +58,9 @@ public partial class PendingBookings : ComponentBase return; } await transactionRepository.SaveTransactionAsync(transaction); - transaction.ReadOnly = true; + // Only drop the booked row: reloading would re-run the booking rules and + // discard edits on the other rows. + matchingBankTransactions?.Remove(transaction); } private async Task SplitBankTransactionAsync(Transaction transaction) @@ -75,7 +77,7 @@ public partial class PendingBookings : ComponentBase var result = await dialog.Result; if (!result.Cancelled && result.Data != null) { - await LoadDataAsync(); + matchingBankTransactions?.Remove(transaction); } } }