From e71d9516ec61a4f5eb2142b91e679921af39bacc Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sun, 15 Oct 2023 00:11:42 +0200 Subject: [PATCH] Billing: small fixes --- Elwig/Helpers/AppDbUpdater.cs | 2 +- Elwig/Helpers/Billing/Billing.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Elwig/Helpers/AppDbUpdater.cs b/Elwig/Helpers/AppDbUpdater.cs index 1c88727..3e3b3c9 100644 --- a/Elwig/Helpers/AppDbUpdater.cs +++ b/Elwig/Helpers/AppDbUpdater.cs @@ -185,7 +185,7 @@ namespace Elwig.Helpers { ORDER BY year, mgnr, LENGTH(bin) DESC, bin; """); - ExecuteNonQuery(cnx, "ALTER TABLE wine_attribute ADD COLUMN fill_lower_bins INTEGER NOT NULL CHECK (fill_lower_bins IN (TRUE, FALSE))"); + ExecuteNonQuery(cnx, "ALTER TABLE wine_attribute ADD COLUMN fill_lower_bins INTEGER NOT NULL CHECK (fill_lower_bins IN (TRUE, FALSE)) DEFAULT FALSE"); } } } diff --git a/Elwig/Helpers/Billing/Billing.cs b/Elwig/Helpers/Billing/Billing.cs index 5b85402..ad82fee 100644 --- a/Elwig/Helpers/Billing/Billing.cs +++ b/Elwig/Helpers/Billing/Billing.cs @@ -154,7 +154,7 @@ namespace Elwig.Helpers.Billing { public static async Task<(Dictionary, Dictionary)> GetMemberRightsObligations(SqliteConnection cnx, int year, int mgnr) { var members = await GetMemberRightsObligations(cnx, year, (int?)mgnr); - return members[mgnr]; + return members.GetValueOrDefault(mgnr, (new(), new())); } public static async Task> GetMemberBinWeights(int mgnr, int year, SqliteConnection cnx) {