Billing: fix small bugs

This commit is contained in:
2023-11-02 19:01:05 +01:00
parent eebddf0527
commit 6b6373238a
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ namespace Elwig.Helpers.Billing {
var u = used.GetValueOrDefault(key, 0);
var vr = Math.Max(0, Math.Min(rightsAndObligations[key].Item1 - u, w));
var vo = Math.Max(0, Math.Min(rightsAndObligations[key].Item2 - u, w));
var v = (attributes.Length == 0 || attributes.Select(a => !attrVals[a].IsStrict ? 2 : attrVals[a].FillLower).Min() == 2) ? vr : vo;
var v = (attributes.Length == c || attributes.Select(a => !attrVals[a].IsStrict ? 2 : attrVals[a].FillLower).Min() == 2) ? vr : vo;
used[key] = u + v;
if (key.Length > 2 && !isStrict) used[key[..2]] = used.GetValueOrDefault(key[..2], 0) + v;
inserts.Add((did, dpnr, i, key[2..], v));