96 lines
4.0 KiB
C#
96 lines
4.0 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Elwig.Helpers.Billing;
|
|
using Elwig.Models.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows;
|
|
|
|
namespace Elwig.ViewModels {
|
|
public partial class PaymentVariantsViewModel : ObservableObject {
|
|
|
|
[ObservableProperty]
|
|
public partial PaymentVar? SelectedPaymentVariant { get; set; }
|
|
[ObservableProperty]
|
|
public partial IEnumerable<PaymentVar> PaymentVariants { get; set; } = [];
|
|
|
|
public BillingData? BillingData { get; set; }
|
|
public bool SeasonLocked { get; set; } = false; // never locked
|
|
public bool WeightModifierChanged { get; set; }
|
|
|
|
[ObservableProperty]
|
|
public partial string Name { get; set; } = "";
|
|
[ObservableProperty]
|
|
public partial string Comment { get; set; } = "";
|
|
[ObservableProperty]
|
|
public partial string DateString { get; set; } = "";
|
|
public DateOnly? Date {
|
|
get => DateOnly.TryParseExact(DateString, "dd.MM.yyyy", out var d) ? d : null;
|
|
set => DateString = $"{value:dd.MM.yyyy}";
|
|
}
|
|
[ObservableProperty]
|
|
public partial string TransferDateString { get; set; } = "";
|
|
public DateOnly? TransferDate {
|
|
get => DateOnly.TryParseExact(TransferDateString, "dd.MM.yyyy", out var d) ? d : null;
|
|
set => TransferDateString = $"{value:dd.MM.yyyy}";
|
|
}
|
|
[ObservableProperty]
|
|
public partial string WeightModifierString { get; set; } = "";
|
|
public double? WeightModifier {
|
|
get => double.TryParse(WeightModifierString, out var d) ? d : null;
|
|
set => WeightModifierString = $"{value}";
|
|
}
|
|
[ObservableProperty]
|
|
public partial string Data { get; set; } = "";
|
|
[ObservableProperty]
|
|
public partial bool ConsiderModifiers { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool ConsiderPenalties { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool ConsiderPenalty { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool ConsiderAuto { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool ConsiderCustom { get; set; }
|
|
|
|
[ObservableProperty]
|
|
public partial bool IsPaymentVariantSelected { get; set; }
|
|
[ObservableProperty]
|
|
public partial bool IsReadOnly { get; set; } = true;
|
|
[ObservableProperty]
|
|
public partial bool DataIsReadOnly { get; set; } = true;
|
|
[ObservableProperty]
|
|
public partial bool IsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial bool SaveIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial bool DeleteIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial bool CalculateIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial bool ExportIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial bool CommitIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial Visibility CommitVisibility { get; set; } = Visibility.Visible;
|
|
[ObservableProperty]
|
|
public partial bool RevertIsEnabled { get; set; } = false;
|
|
[ObservableProperty]
|
|
public partial Visibility RevertVisibility { get; set; } = Visibility.Hidden;
|
|
[ObservableProperty]
|
|
public partial string Arrow { get; set; } = "\xF0AF";
|
|
[ObservableProperty]
|
|
public partial string EditText { get; set; } = "Bearbeiten";
|
|
|
|
[ObservableProperty]
|
|
public partial string StatusModifierSum { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusTotalSum { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusVatSum { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusDeductionSum { get; set; } = "-";
|
|
[ObservableProperty]
|
|
public partial string StatusPaymentSum { get; set; } = "-";
|
|
}
|
|
}
|