diff --git a/Elwig/Documents/PaymentVariantSummary.cshtml b/Elwig/Documents/PaymentVariantSummary.cshtml index 5c2c9e6..43c4b14 100644 --- a/Elwig/Documents/PaymentVariantSummary.cshtml +++ b/Elwig/Documents/PaymentVariantSummary.cshtml @@ -66,6 +66,12 @@ Automatische Nachzeichnung der GA: @(Model.BillingData.ConsiderAutoBusinessShares ? "Ja" : "Nein") + + Berechnung: + @($"{Model.Variant.CalcTime:dd.MM.yyyy, HH:mm:ss}") + Benutzerdef. Zu-/Abschläge pro Mitglied: + @(Model.BillingData.ConsiderCustomModifiers ? "Ja" : "Nein") + Beträge Statistik diff --git a/Elwig/Helpers/Billing/BillingData.cs b/Elwig/Helpers/Billing/BillingData.cs index cf2cc91..6cc6a5d 100644 --- a/Elwig/Helpers/Billing/BillingData.cs +++ b/Elwig/Helpers/Billing/BillingData.cs @@ -41,6 +41,10 @@ namespace Elwig.Helpers.Billing { get => GetConsider("consider_auto_business_shares"); set => SetConsider(value, "consider_auto_business_shares"); } + public bool ConsiderCustomModifiers { + get => GetConsider("consider_custom_modifiers"); + set => SetConsider(value, "consider_custom_modifiers"); + } public double NetWeightModifier { get => GetWeightModifier("net_weight_modifier", "Rebelzuschlag"); diff --git a/Elwig/Models/Entities/PaymentVar.cs b/Elwig/Models/Entities/PaymentVar.cs index ff28dd1..33abe52 100644 --- a/Elwig/Models/Entities/PaymentVar.cs +++ b/Elwig/Models/Entities/PaymentVar.cs @@ -17,7 +17,6 @@ namespace Elwig.Models.Entities { [Column("date")] public required string DateString { get; set; } - [NotMapped] public DateOnly Date { get => DateOnly.ParseExact(DateString, "yyyy-MM-dd"); @@ -26,7 +25,6 @@ namespace Elwig.Models.Entities { [Column("transfer_date")] public string? TransferDateString { get; set; } - [NotMapped] public DateOnly? TransferDate { get => TransferDateString != null ? DateOnly.ParseExact(TransferDateString, "yyyy-MM-dd") : null; @@ -37,7 +35,9 @@ namespace Elwig.Models.Entities { public bool TestVariant { get; set; } [Column("calc_time")] - public int? CalcTime { get; set; } + public int? CalcTimeUnix { get; set; } + [NotMapped] + public DateTime? CalcTime => CalcTimeUnix != null ? DateTimeOffset.FromUnixTimeSeconds((long)CalcTimeUnix).UtcDateTime.ToLocalTime() : null; [Column("comment")] public string? Comment { get; set; } diff --git a/Elwig/Resources/Schemas/PaymentVariantData.json b/Elwig/Resources/Schemas/PaymentVariantData.json index 1629ebe..20feecd 100644 --- a/Elwig/Resources/Schemas/PaymentVariantData.json +++ b/Elwig/Resources/Schemas/PaymentVariantData.json @@ -12,6 +12,7 @@ "consider_contract_penalties": {"type": "boolean"}, "consider_total_penalty": {"type": "boolean"}, "consider_auto_business_shares": {"type": "boolean"}, + "consider_custom_modifiers": {"type": "boolean"}, "net_weight_modifier": {"type": "number"}, "gross_weight_modifier": {"type": "number"}, "payment": {"$ref": "#/definitions/payment_1"}, diff --git a/Elwig/Windows/MainWindow.xaml b/Elwig/Windows/MainWindow.xaml index 5db78e6..a37179b 100644 --- a/Elwig/Windows/MainWindow.xaml +++ b/Elwig/Windows/MainWindow.xaml @@ -76,25 +76,21 @@ Margin="0,13,0,0" VerticalAlignment="Top" HorizontalAlignment="Center" TextChanged="SeasonInput_TextChanged"/> -