PaymentVariantsWindow: Never lock seasons
All checks were successful
Test / Run tests (push) Successful in 2m27s
All checks were successful
Test / Run tests (push) Successful in 2m27s
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Elwig.ViewModels {
|
||||
private IEnumerable<PaymentVar> _paymentVariants = [];
|
||||
|
||||
public BillingData? BillingData;
|
||||
public bool SeasonLocked;
|
||||
public bool SeasonLocked = false; // never locked
|
||||
public bool WeightModifierChanged;
|
||||
|
||||
[ObservableProperty]
|
||||
|
||||
@@ -16,16 +16,14 @@ namespace Elwig.Windows {
|
||||
public partial class PaymentAdjustmentWindow : ContextWindow {
|
||||
|
||||
public readonly int Year;
|
||||
public readonly bool SeasonLocked;
|
||||
public readonly bool SeasonLocked = false; // never locked
|
||||
|
||||
public Dictionary<int, PaymentCustom>? CustomPayments;
|
||||
|
||||
public PaymentAdjustmentWindow(int year) {
|
||||
InitializeComponent();
|
||||
Year = year;
|
||||
using (var ctx = new AppDbContext()) {
|
||||
SeasonLocked = ctx.Seasons.Find(Year + 1) != null;
|
||||
}
|
||||
// using (var ctx = new AppDbContext()) { SeasonLocked = ctx.Seasons.Find(Year + 1) != null; }
|
||||
Title = $"Auszahlung anpassen - Lese {Year} - Elwig";
|
||||
AutoAdjustBsButton.IsEnabled = !SeasonLocked;
|
||||
UnAdjustBsButton.IsEnabled = !SeasonLocked;
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Helpers.Billing;
|
||||
using Elwig.Helpers.Export;
|
||||
using Elwig.Models.Dtos;
|
||||
using Elwig.Models.Entities;
|
||||
using Elwig.Services;
|
||||
using Elwig.ViewModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
@@ -35,9 +32,7 @@ namespace Elwig.Windows {
|
||||
CommandBindings.Add(new CommandBinding(CtrlÜ, Menu_EbicsSave_Click));
|
||||
CommandBindings.Add(new CommandBinding(CtrlShiftP, Menu_SummaryPrint_Click));
|
||||
Year = year;
|
||||
using (var ctx = new AppDbContext()) {
|
||||
ViewModel.SeasonLocked = ctx.Seasons.Find(Year + 1) != null;
|
||||
}
|
||||
// using (var ctx = new AppDbContext()) { ViewModel.SeasonLocked = ctx.Seasons.Find(Year + 1) != null; }
|
||||
Title = $"Auszahlungsvarianten - Lese {Year} - Elwig";
|
||||
if (!App.Config.Debug) {
|
||||
DataInput.Visibility = Visibility.Hidden;
|
||||
|
||||
Reference in New Issue
Block a user