[#40] Billing: Add Rebelzuschlag

This commit is contained in:
2024-03-09 20:24:49 +01:00
parent 34ebc8fa34
commit dc83e64db6
9 changed files with 130 additions and 16 deletions

View File

@ -10,13 +10,14 @@
<colgroup>
<col style="width: 25mm;"/>
<col style="width: 5mm;"/>
<col style="width: 24mm;"/>
<col style="width: 16mm;"/>
<col style="width: 22mm;"/>
<col style="width: 15mm;"/>
<col style="width: 10mm;"/>
<col style="width: 10mm;"/>
<col style="width: 15mm;"/>
<col style="width: 12mm;"/>
<col style="width: 15mm;"/>
<col style="width: 13mm;"/>
<col style="width: 5mm;"/>
<col style="width: 17mm;"/>
<col style="width: 16mm;"/>
</colgroup>
@ -29,6 +30,7 @@
<th colspan="2">Gradation</th>
<th colspan="2">Flächenbindung</th>
<th>Preis</th>
<th class="narrow">Rbl.</th>
<th class="narrow">Zu-/Abschläge</th>
<th>Betrag</th>
</tr>
@ -37,6 +39,7 @@
<th class="unit narrow">[°KMW]</th>
<th class="unit" colspan="2">[kg]</th>
<th class="unit">[@Model.CurrencySymbol/kg]</th>
<th class="narrow unit">[%]</th>
<th class="unit">[@Model.CurrencySymbol]</th>
<th class="unit">[@Model.CurrencySymbol]</th>
</tr>
@ -50,14 +53,17 @@
<td rowspan="@rows">@p.LsNr</td>
<td rowspan="@rows">@p.DPNr</td>
<td class="small">@p.Variety</td>
<td class="small">@p.Attribute@(p.Attribute != null && p.Cultivation != null ? " / " : "")@p.Cultivation</td>
<td class="small">
@p.Attribute@(p.Attribute != null && p.Cultivation != null ? " / " : "")@p.Cultivation
@((p.Attribute != null || p.Cultivation != null) && p.QualId == "WEI" ? " / " : "")@Raw(p.QualId == "WEI" ? "<i>abgew.</i>" : "")
</td>
<td rowspan="@rows" class="center">@($"{p.Gradation.Oe:N0}")</td>
<td rowspan="@rows" class="center">@($"{p.Gradation.Kmw:N1}")</td>
}
@if (i > 0 && i <= p.Modifiers.Length) {
<td colspan="2" class="small mod">@p.Modifiers[i - 1]</td>
<td colspan="4" class="small mod">@p.Modifiers[i - 1]</td>
} else if (i > 0) {
<td colspan="2"></td>
<td colspan="4"></td>
}
@if (i < p.Buckets.Length) {
var bucket = p.Buckets[i];
@ -65,10 +71,12 @@
<td class="number">@($"{bucket.Value:N0}")</td>
<td class="number">@($"{bucket.Price:N4}")</td>
} else {
<td colspan="3"></td>
<td></td>
}
@if (i == p.Buckets.Length - 1) {
var rebelMod = p.WeighingModifier * 100;
var totalMod = p.TotalModifiers ?? 0;
<td class="tiny center">@(rebelMod == 0 ? "-" : (Utils.GetSign(rebelMod) + $"{Math.Abs(rebelMod):0.0##}"))</td>
<td class="number@(totalMod == 0 ? " center" : "")">@(totalMod == 0 ? "-" : Utils.GetSign(totalMod) + $"{Math.Abs(totalMod):N2}")</td>
<td class="number">@($"{p.Amount:N2}")</td>
} else {