Billing: small fixes

This commit is contained in:
2023-10-15 00:11:42 +02:00
parent 658c10c2a4
commit e71d9516ec
2 changed files with 2 additions and 2 deletions

View File

@ -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");
}
}
}

View File

@ -154,7 +154,7 @@ namespace Elwig.Helpers.Billing {
public static async Task<(Dictionary<string, int>, Dictionary<string, int>)> 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<Dictionary<string, int>> GetMemberBinWeights(int mgnr, int year, SqliteConnection cnx) {