Added Zu-/Abschläge to Delivery Note
This commit is contained in:
@ -15,8 +15,10 @@
|
|||||||
<table class="delivery">
|
<table class="delivery">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style="width: 1cm;"/>
|
<col style="width: 1cm;"/>
|
||||||
<col style="width: 50%;"/>
|
<col style="width: 25%;"/>
|
||||||
<col style="width: 50%;"/>
|
<col style="width: 25%;"/>
|
||||||
|
<col style="width: 25%;"/>
|
||||||
|
<col style="width: 25%;"/>
|
||||||
<col style="width: 3cm;"/>
|
<col style="width: 3cm;"/>
|
||||||
<col style="width: 1.25cm;"/>
|
<col style="width: 1.25cm;"/>
|
||||||
<col style="width: 1.25cm;"/>
|
<col style="width: 1.25cm;"/>
|
||||||
@ -25,8 +27,8 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="main" rowspan="2" style="text-align: center;">Pos.</th>
|
<th class="main" rowspan="2" style="text-align: center;">Pos.</th>
|
||||||
<th class="main" rowspan="2">Sorte</th>
|
<th class="main" rowspan="2" colspan="2">Sorte</th>
|
||||||
<th class="main" rowspan="2">Attribut(e)</th>
|
<th class="main" rowspan="2" colspan="2">Attribut(e)</th>
|
||||||
<th class="main" rowspan="2">Qualitätsstufe</th>
|
<th class="main" rowspan="2">Qualitätsstufe</th>
|
||||||
<th colspan="2">Gradation</th>
|
<th colspan="2">Gradation</th>
|
||||||
<th>Gewicht</th>
|
<th>Gewicht</th>
|
||||||
@ -41,24 +43,40 @@
|
|||||||
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
|
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
|
||||||
<tr class="main">
|
<tr class="main">
|
||||||
<td style="text-align: center;">@part.DPNr</td>
|
<td style="text-align: center;">@part.DPNr</td>
|
||||||
<td>@part.Variant.Name</td>
|
<td colspan="2">@part.Variant.Name</td>
|
||||||
<td>@string.Join(" / ", part.Attributes)</td>
|
<td colspan="2">@string.Join(" / ", part.Attributes)</td>
|
||||||
<td>@part.Quality.Name</td>
|
<td>@part.Quality.Name</td>
|
||||||
<td class="narrow" style="text-align: center;">@($"{part.Oe:N0}")</td>
|
<td class="narrow" style="text-align: center;">@($"{part.Oe:N0}")</td>
|
||||||
<td class="narrow" style="text-align: center;">@($"{part.Kmw:N1}")</td>
|
<td class="narrow" style="text-align: center;">@($"{part.Kmw:N1}")</td>
|
||||||
<td class="narrow" style="text-align: right;">@($"{part.Weight:N0}")</td>
|
<td class="narrow" style="text-align: right;">@($"{part.Weight:N0}")</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td></td><td colspan="3" style="font-size: 8pt; white-space: pre">Herkunft: @part.OriginString</td></tr>
|
<tr><td></td><td colspan="5" style="white-space: pre;"><i>Herkunft:</i> @part.OriginString</td></tr>
|
||||||
<tr><td></td><td colspan="3" style="font-size: 8pt;">
|
@if (part.Modifiers.Count() > 0) {
|
||||||
|
var first = true;
|
||||||
|
foreach (var mod in part.Modifiers) {
|
||||||
|
<tr class="tight @(first ? "first" : "")"><td></td><td>@Raw(first ? "<i>Zu-/Abschläge:</i>" : "")</td><td colspan="3">@mod.Name</td><td style="white-space: pre;">@mod.ValueStr</td></tr>
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<tr><td></td><td colspan="5">
|
||||||
@(part.ManualWeighing ? "Handwiegung" : $"Waage: {part.ScaleId ?? "?"}, ID: {part.WeighingId ?? "?"}") (@(part.IsGerebelt ? "gerebelt gewogen" : "nicht gerebelt gewogen"))
|
@(part.ManualWeighing ? "Handwiegung" : $"Waage: {part.ScaleId ?? "?"}, ID: {part.WeighingId ?? "?"}") (@(part.IsGerebelt ? "gerebelt gewogen" : "nicht gerebelt gewogen"))
|
||||||
</td></tr>
|
</td></tr>
|
||||||
@if (part.Comment != null) {
|
@if (part.Comment != null) {
|
||||||
<tr><td></td><td colspan="3" style="font-size: 8pt;">Anmerkung: @part.Comment</td></tr>
|
<tr><td></td><td colspan="5"><i>Anmerkung:</i> @part.Comment</td></tr>
|
||||||
}
|
}
|
||||||
@if (part.Temperature != null || part.Acid != null) {
|
@if (part.Temperature != null || part.Acid != null) {
|
||||||
<tr><td></td><td colspan="3" style="font-size: 8pt;">@(part.Temperature != null ? $"Temperatur: {part.Temperature:N1} °C" : "")@(part.Temperature != null && part.Acid != null ? ", " : "")@(part.Acid != null ? $"Säure: {part.Acid:N1} g/l" : "")</td></tr>
|
<tr><td></td><td colspan="5">@Raw(part.Temperature != null ? $"<i>Temperatur:</i> {part.Temperature:N1} °C" : "")@(part.Temperature != null && part.Acid != null ? ", " : "")@Raw(part.Acid != null ? $"<i>Säure:</i> {part.Acid:N1} g/l" : "")</td></tr>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@if (Model.Delivery.Parts.Count() > 1) {
|
||||||
|
<tr class="main sum">
|
||||||
|
<td style="text-align: center;">∑</td>
|
||||||
|
<td colspan="5"></td>
|
||||||
|
<td style="text-align: center;">@($"{Model.Delivery.Oe:N0}")</td>
|
||||||
|
<td style="text-align: center;">@($"{Model.Delivery.Kmw:N1}")</td>
|
||||||
|
<td style="text-align: right;">@($"{Model.Delivery.Weight:N0}")</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@if (Model.Delivery.Comment != null) {
|
@if (Model.Delivery.Comment != null) {
|
||||||
|
@ -83,6 +83,11 @@ address {
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table td,
|
||||||
|
table th {
|
||||||
|
padding: 0.5mm 1mm;
|
||||||
|
}
|
||||||
|
|
||||||
aside {
|
aside {
|
||||||
height: 40mm;
|
height: 40mm;
|
||||||
width: 75mm;
|
width: 75mm;
|
||||||
@ -110,7 +115,6 @@ aside table thead th {
|
|||||||
|
|
||||||
aside table tbody th,
|
aside table tbody th,
|
||||||
aside table tbody td {
|
aside table tbody td {
|
||||||
padding: 0.5mm 1mm;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
@ -220,6 +224,27 @@ table.delivery tr.main td {
|
|||||||
padding-top: 2mm;
|
padding-top: 2mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.delivery tbody tr:not(.main) td {
|
||||||
|
font-size: 8pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.delivery tr.tight:not(.first) td {
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.delivery tr.tight.first td {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.delivery tr.tight:has(+ tr:not(.tight)) td {
|
||||||
|
padding-bottom: 0.5mm !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.delivery tr.sum {
|
||||||
|
border-top: 1pt solid black;
|
||||||
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,17 @@ namespace Elwig.Models {
|
|||||||
|
|
||||||
public string SortIdString => string.Join(", ", SortIds);
|
public string SortIdString => string.Join(", ", SortIds);
|
||||||
|
|
||||||
|
public double Kmw => Parts.Aggregate(
|
||||||
|
(Weight: 0, Kmw: 0.0),
|
||||||
|
(sum, item) => (
|
||||||
|
sum.Weight + item.Weight,
|
||||||
|
(sum.Kmw * sum.Weight + item.Kmw * item.Weight) / (sum.Weight + item.Weight)
|
||||||
|
),
|
||||||
|
sum => sum.Kmw
|
||||||
|
);
|
||||||
|
|
||||||
|
public double Oe => Utils.KmwToOe(Kmw);
|
||||||
|
|
||||||
public int SearchScore(IEnumerable<string> keywords) {
|
public int SearchScore(IEnumerable<string> keywords) {
|
||||||
var list = new string?[] {
|
var list = new string?[] {
|
||||||
LsNr, Year.ToString(), Date.ToString("dd.MM.yyyy"), Time?.ToString("HH:mm"),
|
LsNr, Year.ToString(), Date.ToString("dd.MM.yyyy"), Time?.ToString("HH:mm"),
|
||||||
|
Reference in New Issue
Block a user