fix(transfers): show consistent source target and prevent same-account edits (U11)

This commit is contained in:
2026-11-02 19:27:54 +01:00
parent 1686f5769c
commit 4d0d5c8d88
5 changed files with 68 additions and 1 deletions
@@ -52,6 +52,13 @@ public partial class AddTransferDialog
#region Properties
private bool IsIncoming => EditEntry?.Type == Duempelkas.Domain.Enums.EntryType.Income;
private string CurrentAccountName => accounts.FirstOrDefault(a => a.Id == SourceAccountId)?.Name ?? "Aktuelles Konto";
private string LinkedAccountName => accounts.FirstOrDefault(a => a.Id == targetAccountId)?.Name ?? "Konto auswählen";
private string FromName => IsIncoming ? LinkedAccountName : CurrentAccountName;
private string ToName => IsIncoming ? CurrentAccountName : LinkedAccountName;
private static string Money(decimal value) => value.ToString("N2", System.Globalization.CultureInfo.GetCultureInfo("de-DE")) + " €";
private bool CanSave => targetAccountId > 0 && targetAccountId != SourceAccountId && !string.IsNullOrWhiteSpace(title) && ValidAmount && date != default && (!OutsideYear || (confirmDifferentYear && confirmedYear == date.Year));
#endregion