fix(transfers): show consistent source target and prevent same-account edits (U11)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user