diff --git a/Schaad.Accounting.Common/Models/Transaction.cs b/Schaad.Accounting.Common/Models/Transaction.cs index 8dc7ee0..bd91f84 100644 --- a/Schaad.Accounting.Common/Models/Transaction.cs +++ b/Schaad.Accounting.Common/Models/Transaction.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Xml.Serialization; namespace Schaad.Accounting.Models { @@ -42,6 +43,9 @@ namespace Schaad.Accounting.Models [Display(Name = "Währungskurs")] public decimal? FxRate { get; set; } + + [XmlIgnore] + public bool ReadOnly {get; set;} public Transaction() { diff --git a/Schaad.Accounting.UI/Components/Pages/Home.razor b/Schaad.Accounting.UI/Components/Pages/Home.razor index a3acae4..0993000 100644 --- a/Schaad.Accounting.UI/Components/Pages/Home.razor +++ b/Schaad.Accounting.UI/Components/Pages/Home.razor @@ -67,7 +67,7 @@ else
- + @foreach (var text in bookingTexts.OrderBy(t => t)) { @@ -88,11 +88,12 @@ else + OnClick="@(() => SplitBankTransactionAsync(transaction))" Disabled="@(transaction.Value > 0 || transaction.ReadOnly)" /> + OnClick="@(() => BookBankTransactionAsync(transaction))" + Disabled="@transaction.ReadOnly" /> } diff --git a/Schaad.Accounting.UI/Components/Pages/Home.razor.cs b/Schaad.Accounting.UI/Components/Pages/Home.razor.cs index f8ae71d..5a7bbbd 100644 --- a/Schaad.Accounting.UI/Components/Pages/Home.razor.cs +++ b/Schaad.Accounting.UI/Components/Pages/Home.razor.cs @@ -166,7 +166,7 @@ public partial class Home : ComponentBase return; } transactionRepository.SaveTransaction(transaction); - ReloadPage(); + transaction.ReadOnly = true; await Task.CompletedTask; }