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