Billing: Add possibility to automatically add business shares

This commit is contained in:
2024-01-17 18:59:25 +01:00
parent 668eb9a2d0
commit b52c09a176
13 changed files with 116 additions and 19 deletions

View File

@ -31,6 +31,7 @@ namespace Elwig.Windows {
CalculateBucketsButton.IsEnabled = valid && last;
DeliveryConfirmationButton.IsEnabled = valid;
OverUnderDeliveryButton.IsEnabled = valid;
AutoBusinessSharesButton.IsEnabled = valid;
PaymentButton.IsEnabled = valid;
}
@ -82,6 +83,27 @@ namespace Elwig.Windows {
Mouse.OverrideCursor = null;
}
private async void AutoBusinessSharesButton_Click(object sender, RoutedEventArgs evt) {
if (SeasonInput.Value is not int year)
return;
if (App.Client.IsMatzen) {
AutoBusinessSharesButton.IsEnabled = false;
Mouse.OverrideCursor = Cursors.AppStarting;
var b = new Billing(year);
await b.AutoAdjustBusinessShare();
Mouse.OverrideCursor = null;
AutoBusinessSharesButton.IsEnabled = true;
} else {
MessageBox.Show(
"Es ist kein automatisches Nachzeichnen der Geschäftsanteile\n" +
"für diese Genossenschaft eingestellt!\n" +
"Bitte wenden Sie sich an die Programmierer!", "Fehler",
MessageBoxButton.OK, MessageBoxImage.Information);
}
}
private void PaymentButton_Click(object sender, RoutedEventArgs evt) {
if (SeasonInput.Value is not int year)
return;