Billing: Rename bins to buckets

This commit is contained in:
2023-11-02 13:06:32 +01:00
parent 9f67448b72
commit eebddf0527
11 changed files with 88 additions and 88 deletions

View File

@ -44,11 +44,11 @@
var lastSortId = "";
}
@foreach (var p in Model.Deliveries) {
var bins = p.Bins.Where(b => b.Value > 0).OrderByDescending(b => b.BktNr).ToArray();
var rowsBins = bins.Length;
var buckets = p.Buckets.Where(b => b.Value > 0).OrderByDescending(b => b.BktNr).ToArray();
var rowsBuckets = buckets.Length;
var mods = p.Modifiers.Select(m => m.Name).ToArray();
var rowsMod = mods.Length + 1;
var rows = Math.Max(rowsBins, rowsMod);
var rows = Math.Max(rowsBuckets, rowsMod);
var first = true;
@for (int i = 0; i < rows; i++) {
<tr class="@(first ? "first" : "") @(p.SortId != lastSortId && lastSortId != "" ? "new": "") @(rows > i + 1 ? "trailing" : "")">
@ -66,14 +66,14 @@
} else if (i > 0) {
<td colspan="3"></td>
}
@if (i < bins.Length) {
var bin = bins[i];
<td class="geb">@(bin.Discr == "_" ? "ungeb." : $"geb. {p.SortId}{bin.Discr}"):</td>
<td class="weight">@($"{bin.Value:N0}")</td>
@if (i < buckets.Length) {
var bucket = buckets[i];
<td class="geb">@(bucket.Discr == "_" ? "ungeb." : $"geb. {p.SortId}{bucket.Discr}"):</td>
<td class="weight">@($"{bucket.Value:N0}")</td>
} else {
<td colspan="2"></td>
}
@if (i == bins.Length - 1) {
@if (i == buckets.Length - 1) {
<td class="weight">@($"{p.Weight:N0}")</td>
} else {
<td></td>
@ -129,11 +129,11 @@
$"<td>{(mode != 2 ? "" : obligation == 0 && right == 0 ? "-" : $"{payment:N0}")}</td>" +
$"<td>{sum:N0}</td>";
}
var mBins = Model.MemberBins.Where(b => b.Value.Item2 > 0 || b.Value.Item3 > 0 || b.Value.Item4 > 0).ToList();
var fbVars = mBins.Where(b => b.Value.Item2 > 0 || b.Value.Item3 > 0).Select(b => b.Key.Replace("_", "")).Order().ToArray();
var fbs = mBins.Where(b => fbVars.Contains(b.Key) && b.Key.Length == 2).OrderBy(b => b.Value.Item1);
var vtr = mBins.Where(b => fbVars.Contains(b.Key) && b.Key.Length > 2).OrderBy(b => b.Value.Item1);
var rem = mBins.Where(b => !fbVars.Contains(b.Key)).OrderBy(b => b.Value.Item1);
var mBuckets = Model.MemberBuckets.Where(b => b.Value.Item2 > 0 || b.Value.Item3 > 0 || b.Value.Item4 > 0).ToList();
var fbVars = mBuckets.Where(b => b.Value.Item2 > 0 || b.Value.Item3 > 0).Select(b => b.Key.Replace("_", "")).Order().ToArray();
var fbs = mBuckets.Where(b => fbVars.Contains(b.Key) && b.Key.Length == 2).OrderBy(b => b.Value.Item1);
var vtr = mBuckets.Where(b => fbVars.Contains(b.Key) && b.Key.Length > 2).OrderBy(b => b.Value.Item1);
var rem = mBuckets.Where(b => !fbVars.Contains(b.Key)).OrderBy(b => b.Value.Item1);
}
<tr>
<th>Gesamtlieferung lt. gez. GA</th>