@ -1,5 +1,7 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Models.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Elwig.Documents {
|
||||
public abstract class BusinessDocument : Document {
|
||||
@ -32,5 +34,93 @@ namespace Elwig.Documents {
|
||||
return (addr is BillingAddr ? $"{addr.Name}\n" : "") + $"{Member.AdministrativeName}\n{addr.Address}\n{plz?.Plz} {plz?.Ort.Name.Split(",")[0]}\n{addr.PostalDest.Country.Name}";
|
||||
}
|
||||
}
|
||||
|
||||
public string PrintSortenaufteilung(int year, Dictionary<string, MemberBucket> buckets) {
|
||||
return "";
|
||||
}
|
||||
|
||||
private enum RowMode {
|
||||
GA_CONFIRMATION, CONFIRMATION, GA_NOTE, NOTE
|
||||
}
|
||||
|
||||
private static string FormatRow(RowMode mode, int obligation, int right, int delivery, int? payment = null) {
|
||||
var isGa = (mode == RowMode.GA_CONFIRMATION || mode == RowMode.GA_NOTE);
|
||||
var showPayment = (mode == RowMode.GA_CONFIRMATION || mode == RowMode.CONFIRMATION);
|
||||
payment ??= delivery;
|
||||
var baseline = showPayment ? payment : delivery;
|
||||
return $"<td>{(obligation == 0 ? "-" : $"{obligation:N0}")}</td>" +
|
||||
$"<td>{(right == 0 ? "-" : $"{right:N0}")}</td>" +
|
||||
$"<td>{(baseline < obligation ? $"<b>{obligation - baseline:N0}</b>" : "-")}</td>" +
|
||||
$"<td>{(baseline >= obligation && delivery <= right ? $"{right - delivery:N0}" : "-")}</td>" +
|
||||
$"<td>{(obligation == 0 && right == 0 ? "-" : (delivery > right ? ((isGa ? "<b>" : "") + $"{delivery - right:N0}" + (isGa ? "</b>" : "")) : "-"))}</td>" +
|
||||
(showPayment ? $"<td>{(isGa ? "" : obligation == 0 && right == 0 ? "-" : $"{payment:N0}")}</td>" : "") +
|
||||
$"<td>{delivery:N0}</td>";
|
||||
}
|
||||
|
||||
private static string FormatRow(RowMode mode, MemberBucket bucket) {
|
||||
return FormatRow(mode, bucket.Obligation, bucket.Right, bucket.Delivery, bucket.Payment);
|
||||
}
|
||||
|
||||
public string PrintBucketTable(Season season, Dictionary<string, MemberBucket> buckets, bool includePayment = false, bool isTiny = false, IEnumerable<string>? filter = null) {
|
||||
int[] colGroups = includePayment ? [45, 17, 17, 17, 19, 16, 17, 17] : [45, 20, 20, 20, 20, 20, 20];
|
||||
string tbl = "<colgroup>\n" + string.Join("\n", colGroups.Select(g => $"<col style=\"width: {g}mm;\"/>")) + "\n</colgroup>\n";
|
||||
tbl += $"""
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Lese {season.Year}</b> per {Date:dd.MM.yyyy} [kg]</th>
|
||||
<th>Lieferpflicht</th>
|
||||
<th>Lieferrecht</th>
|
||||
<th>Unterliefert</th>
|
||||
<th>Noch lieferbar</th>
|
||||
<th>Überliefert</th>
|
||||
{(includePayment ? "<th>Zugeteilt</th>" : "")}
|
||||
<th>Geliefert</th>
|
||||
</tr>
|
||||
</thead>
|
||||
""";
|
||||
|
||||
var mBuckets = buckets
|
||||
.Where(b => (b.Value.Right > 0 || b.Value.Obligation > 0 || b.Value.Delivery > 0) && (filter == null || filter.Contains(b.Key[..2])))
|
||||
.ToList();
|
||||
var fbVars = mBuckets
|
||||
.Where(b => b.Value.Right > 0 || b.Value.Obligation > 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.Name);
|
||||
var vtr = mBuckets
|
||||
.Where(b => fbVars.Contains(b.Key) && b.Key.Length > 2)
|
||||
.OrderBy(b => b.Value.Name);
|
||||
var rem = mBuckets
|
||||
.Where(b => !fbVars.Contains(b.Key))
|
||||
.OrderBy(b => b.Value.Name);
|
||||
|
||||
tbl += "\n<tbody>\n";
|
||||
tbl += $"<tr><th>Gesamtlieferung lt. gez. GA</th>{FormatRow(
|
||||
includePayment ? RowMode.GA_CONFIRMATION : RowMode.GA_NOTE,
|
||||
Member.BusinessShares * season.MinKgPerBusinessShare,
|
||||
Member.BusinessShares * season.MaxKgPerBusinessShare,
|
||||
Member.Deliveries.Where(d => d.Year == season.Year).Sum(d => d.Weight)
|
||||
)}</tr>";
|
||||
if (fbs.Any()) {
|
||||
tbl += $"<tr class=\"subheading{(filter == null ? " border" : "")}\"><th colspan=\"{(includePayment ? 8 : 7)}\">" +
|
||||
$"Flächenbindungen{(vtr.Any() ? " (inkl. Verträge)" : "")}:</th></tr>";
|
||||
foreach (var (id, b) in fbs) {
|
||||
tbl += $"<tr><th>{b.Name}</th>{FormatRow(includePayment ? RowMode.CONFIRMATION : RowMode.NOTE, b)}</tr>";
|
||||
}
|
||||
}
|
||||
if (vtr.Any()) {
|
||||
tbl += $"<tr class=\"subheading{(filter == null ? " border" : "")}\"><th colspan=\"{(includePayment ? 8 : 7)}\">" +
|
||||
"Verträge:</th></tr>";
|
||||
foreach (var (id, b) in vtr) {
|
||||
tbl += $"<tr><th>{b.Name}</th>{FormatRow(includePayment ? RowMode.CONFIRMATION : RowMode.NOTE, b)}</tr>";
|
||||
}
|
||||
}
|
||||
tbl += "\n</tbody>\n";
|
||||
|
||||
return $"<table class=\"{(isTiny ? "tiny" : "small")} number cohere\">\n" + tbl + "\n</table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,49 +1,5 @@
|
||||
|
||||
table.credit {
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
table.credit th,
|
||||
table.credit td {
|
||||
padding: 0 0.25mm;
|
||||
}
|
||||
|
||||
table.credit thead {
|
||||
font-size: 8pt
|
||||
}
|
||||
|
||||
table.credit thead th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
table.credit td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.credit .oe,
|
||||
table.credit .kmw {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.credit .dpnr {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.credit .amount,
|
||||
table.credit .weight,
|
||||
table.credit .price {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.credit .rel,
|
||||
table.credit .abs {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.credit .amount.sum {
|
||||
vertical-align: bottom;
|
||||
padding-bottom: 1mm;
|
||||
}
|
||||
|
||||
@ -59,11 +15,3 @@ table.credit tbody tr.first td {
|
||||
table.credit tbody tr.last td {
|
||||
padding-bottom: 1mm;
|
||||
}
|
||||
|
||||
table.credit tbody tr.new {
|
||||
border-top: 0.5pt solid black;
|
||||
}
|
||||
|
||||
table.credit .small {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" style="text-align: left;">Lieferschein-Nr.</th>
|
||||
<th rowspan="2">Pos.</th>
|
||||
<th rowspan="2" class="narrow">Pos.</th>
|
||||
<th rowspan="2" style="text-align: left;">Sorte</th>
|
||||
<th rowspan="2" style="text-align: left;">Attribut</th>
|
||||
<th rowspan="2" style="text-align: left;">Qualitätsstufe</th>
|
||||
@ -32,11 +32,11 @@
|
||||
<th>Davon<br/>abzuwerten</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>[°Oe]</th>
|
||||
<th>[°KMW]</th>
|
||||
<th colspan="2">[kg]</th>
|
||||
<th>[kg]</th>
|
||||
<th>[kg]</th>
|
||||
<th class="unit">[°Oe]</th>
|
||||
<th class="unit narrow">[°KMW]</th>
|
||||
<th class="unit"colspan="2">[kg]</th>
|
||||
<th class="unit">[kg]</th>
|
||||
<th class="unit">[kg]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -54,28 +54,28 @@
|
||||
<td class="small">@p.Variant</td>
|
||||
<td class="small">@p.Attribute</td>
|
||||
<td class="small">@p.QualityLevel</td>
|
||||
<td rowspan="@rows" class="grad">@($"{p.Gradation.Oe:N0}")</td>
|
||||
<td rowspan="@rows" class="grad">@($"{p.Gradation.Kmw:N1}")</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="3" class="mod">@(p.Modifiers[i - 1])</td>
|
||||
<td colspan="3" class="small mod">@(p.Modifiers[i - 1])</td>
|
||||
} else if (i > 0) {
|
||||
<td colspan="3"></td>
|
||||
}
|
||||
@if (i < p.Buckets.Length) {
|
||||
var bucket = p.Buckets[i];
|
||||
<td class="geb">@bucket.Name:</td>
|
||||
<td class="weight">@($"{bucket.Value:N0}")</td>
|
||||
<td class="small">@bucket.Name:</td>
|
||||
<td class="number">@($"{bucket.Value:N0}")</td>
|
||||
} else {
|
||||
<td colspan="2"></td>
|
||||
}
|
||||
@if (i == p.Buckets.Length - 1) {
|
||||
<td class="weight">@($"{p.Weight:N0}")</td>
|
||||
<td class="number">@($"{p.Weight:N0}")</td>
|
||||
} else {
|
||||
<td></td>
|
||||
}
|
||||
@if (first) {
|
||||
<td rowspan="@rows" class="weight"></td>
|
||||
<td rowspan="@rows" class="number"></td>
|
||||
first = false;
|
||||
}
|
||||
</tr>
|
||||
@ -84,91 +84,12 @@
|
||||
}
|
||||
<tr class="sum">
|
||||
<td colspan="8">Gesamt:</td>
|
||||
<td colspan="2" class="weight">@($"{Model.Data.Rows.Sum(p => p.Weight):N0}")</td>
|
||||
<td colspan="2" class="number">@($"{Model.Data.Rows.Sum(p => p.Weight):N0}")</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="delivery-confirmation-stats">
|
||||
<colgroup>
|
||||
<col style="width: 45mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
<col style="width: 19mm;"/>
|
||||
<col style="width: 16mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Lese @Model.Season.Year</b> per @($"{Model.Date:dd.MM.yyyy}") [kg]</th>
|
||||
<th>Lieferpflicht</th>
|
||||
<th>Lieferrecht</th>
|
||||
<th>Unterliefert</th>
|
||||
<th>Noch lieferbar</th>
|
||||
<th>Überliefert</th>
|
||||
<th>Zugeteilt</th>
|
||||
<th>Geliefert</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
string FormatRow(int mode, int obligation, int right, int sum, int? payment = null) {
|
||||
var isGa = mode == 0;
|
||||
payment ??= sum;
|
||||
return $"<td>{(mode == 1 ? "" : obligation == 0 ? "-" : $"{obligation:N0}")}</td>" +
|
||||
$"<td>{(mode == 1 ? "" : right == 0 ? "-" : $"{right:N0}")}</td>" +
|
||||
$"<td>{(mode == 1 ? "" : payment < obligation ? $"<b>{obligation - payment:N0}\x3c/b>" : "-")}</td>" +
|
||||
$"<td>{(mode == 1 ? "" : payment >= obligation && sum <= right ? $"{right - sum:N0}" : "-")}</td>" +
|
||||
$"<td>{(mode == 1 ? "" : obligation == 0 && right == 0 ? "-" : (sum > right ? ((isGa ? "<b>" : "") + $"{sum - right:N0}" + (isGa ? "</b>" : "")) : "-"))}</td>" +
|
||||
$"<td>{(mode != 2 ? "" : obligation == 0 && right == 0 ? "-" : $"{payment:N0}")}</td>" +
|
||||
$"<td>{sum:N0}</td>";
|
||||
}
|
||||
var mBuckets = Model.MemberBuckets.Where(b => b.Value.Right > 0 || b.Value.Obligation > 0 || b.Value.Delivery > 0).ToList();
|
||||
var fbVars = mBuckets.Where(b => b.Value.Right > 0 || b.Value.Obligation > 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.Name);
|
||||
var vtr = mBuckets.Where(b => fbVars.Contains(b.Key) && b.Key.Length > 2).OrderBy(b => b.Value.Name);
|
||||
var rem = mBuckets.Where(b => !fbVars.Contains(b.Key)).OrderBy(b => b.Value.Name);
|
||||
}
|
||||
<tr>
|
||||
<th>Gesamtlieferung lt. gez. GA</th>
|
||||
@Raw(FormatRow(
|
||||
0,
|
||||
Model.Member.BusinessShares * Model.Season.MinKgPerBusinessShare,
|
||||
Model.Member.BusinessShares * Model.Season.MaxKgPerBusinessShare,
|
||||
Model.Member.Deliveries.Where(d => d.Year == Model.Season.Year).Sum(d => d.Weight)
|
||||
))
|
||||
</tr>
|
||||
@if (rem.Any()) {
|
||||
<tr class="subheading"><th colspan="8">Sortenaufteilung:</th></tr>
|
||||
}
|
||||
@foreach (var (id, b) in rem) {
|
||||
<tr>
|
||||
<th>@b.Name</th>
|
||||
@Raw(FormatRow(1, b.Obligation, b.Right, b.Delivery, b.Payment))
|
||||
</tr>
|
||||
}
|
||||
@if (fbs.Any()){
|
||||
<tr class="subheading"><th colspan="8">Flächenbindungen:</th></tr>
|
||||
}
|
||||
@foreach (var (id, b) in fbs) {
|
||||
<tr>
|
||||
<th>@b.Name</th>
|
||||
@Raw(FormatRow(2, b.Obligation, b.Right, b.Delivery, b.Payment))
|
||||
</tr>
|
||||
}
|
||||
@if (vtr.Any()) {
|
||||
<tr class="subheading"><th colspan="8">Verträge:</th></tr>
|
||||
}
|
||||
@foreach (var (id, b) in vtr) {
|
||||
<tr>
|
||||
<th>@b.Name</th>
|
||||
@Raw(FormatRow(2, b.Obligation, b.Right, b.Delivery, b.Payment))
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@Raw(Model.PrintBucketTable(Model.Season, Model.MemberBuckets, includePayment: true))
|
||||
<div class="text" style="margin-top: 2em;">
|
||||
@if (Model.Text != null) {
|
||||
<p class="comment" style="white-space: pre-wrap; break-inside: avoid;">@Model.Text</p>
|
||||
|
@ -1,52 +1,8 @@
|
||||
|
||||
table.delivery-confirmation {
|
||||
font-size: 10pt;
|
||||
margin-bottom: 5mm;
|
||||
}
|
||||
|
||||
table.delivery-confirmation thead {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.delivery-confirmation thead th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table.delivery-confirmation td {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.delivery-confirmation td[rowspan] {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.delivery-confirmation .weight {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.delivery-confirmation .grad {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.delivery-confirmation .geb {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.delivery-confirmation .mod {
|
||||
font-size: 8pt;
|
||||
padding-left: 5mm;
|
||||
}
|
||||
|
||||
table.delivery-confirmation .small {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.delivery-confirmation tr.new td {
|
||||
border-top: 0.5pt solid black;
|
||||
}
|
||||
|
||||
table.delivery-confirmation tr:not(.first) {
|
||||
break-before: avoid;
|
||||
}
|
||||
@ -60,54 +16,9 @@ table.delivery-confirmation tr.trailing td {
|
||||
}
|
||||
|
||||
table.delivery-confirmation tr.sum {
|
||||
border-top: 0.5pt solid black;
|
||||
break-before: avoid;
|
||||
font-weight: bold;
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
table.delivery-confirmation tr.sum td {
|
||||
padding-top: 1mm;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats {
|
||||
font-size: 10pt;
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats th,
|
||||
table.delivery-confirmation-stats td {
|
||||
padding: 0.125mm 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats tr.subheading th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats thead th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
text-align: right;
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats thead th:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats td {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats tbody th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.delivery-confirmation-stats tr.subheading th {
|
||||
font-weight: bold;
|
||||
border-top: 0.5pt solid black;
|
||||
}
|
||||
|
@ -10,9 +10,9 @@
|
||||
<colgroup>
|
||||
<col style="width: 25mm;"/>
|
||||
<col style="width: 5mm;"/>
|
||||
<col style="width: 17mm;"/>
|
||||
<col style="width: 10mm;"/>
|
||||
<col style="width: 15mm;"/>
|
||||
<col style="width: 8mm;"/>
|
||||
<col style="width: 12mm;"/>
|
||||
<col style="width: 38mm;"/>
|
||||
<col style="width: 28mm;"/>
|
||||
<col style="width: 10mm;"/>
|
||||
@ -22,7 +22,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" style="text-align: left;">Lieferschein-Nr.</th>
|
||||
<th rowspan="2">Pos.</th>
|
||||
<th rowspan="2" class="narrow">Pos.</th>
|
||||
<th rowspan="2">Datum</th>
|
||||
<th rowspan="2">Zeit</th>
|
||||
<th colspan="2" rowspan="2" style="text-align: left;">Mitglied</th>
|
||||
@ -31,9 +31,9 @@
|
||||
<th>Gewicht</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>[°Oe]</th>
|
||||
<th>[°KMW]</th>
|
||||
<th>[kg]</th>
|
||||
<th class="unit">[°Oe]</th>
|
||||
<th class="unit narrow">[°KMW]</th>
|
||||
<th class="unit">[kg]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -41,14 +41,14 @@
|
||||
<tr>
|
||||
<td>@p.Delivery.LsNr</td>
|
||||
<td>@p.DPNr</td>
|
||||
<td>@($"{p.Delivery.Date:dd.MM.yyyy}")</td>
|
||||
<td>@($"{p.Delivery.Time:HH:mm}")</td>
|
||||
<td class="mgnr">@p.Delivery.Member.MgNr</td>
|
||||
<td>@p.Delivery.Member.AdministrativeName</td>
|
||||
<td>@p.Variant.Name</td>
|
||||
<td class="grad">@($"{p.Oe:N0}")</td>
|
||||
<td class="grad">@($"{p.Kmw:N1}")</td>
|
||||
<td class="weight">@($"{p.Weight:N0}")</td>
|
||||
<td class="small">@($"{p.Delivery.Date:dd.MM.yyyy}")</td>
|
||||
<td class="small">@($"{p.Delivery.Time:HH:mm}")</td>
|
||||
<td class="number">@p.Delivery.Member.MgNr</td>
|
||||
<td class="small">@p.Delivery.Member.AdministrativeName</td>
|
||||
<td class="small">@p.Variant.Name</td>
|
||||
<td class="center">@($"{p.Oe:N0}")</td>
|
||||
<td class="center">@($"{p.Kmw:N1}")</td>
|
||||
<td class="number">@($"{p.Weight:N0}")</td>
|
||||
</tr>
|
||||
}
|
||||
<tr class="sum">
|
||||
@ -58,9 +58,9 @@
|
||||
}
|
||||
<td colspan="2">Gesamt:</td>
|
||||
<td colspan="5">(Teil-)Lieferungen: @($"{Model.Deliveries.DistinctBy(p => p.Delivery).Count():N0}") (@($"{Model.Deliveries.Count():N0}"))</td>
|
||||
<td class="grad">@($"{oe:N0}")</td>
|
||||
<td class="grad">@($"{kmw:N1}")</td>
|
||||
<td class="weight">@($"{Model.Deliveries.Sum(p => p.Weight):N0}")</td>
|
||||
<td class="center">@($"{oe:N0}")</td>
|
||||
<td class="center">@($"{kmw:N1}")</td>
|
||||
<td class="number">@($"{Model.Deliveries.Sum(p => p.Weight):N0}")</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -10,38 +10,3 @@ h2 {
|
||||
font-size: 14pt;
|
||||
margin-top: 2mm;
|
||||
}
|
||||
|
||||
table.journal {
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
table.journal thead {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
table.journal th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
table.journal td {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.journal .mgnr,
|
||||
table.journal .weight {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.journal .grad {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.journal tr.sum {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.journal tr.sum td {
|
||||
border-top: 0.5pt solid black;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\DeliveryNote.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<table class="delivery">
|
||||
<table class="delivery large">
|
||||
<colgroup>
|
||||
<col style="width: 10.00mm;"/>
|
||||
<col style="width: 21.25mm;"/>
|
||||
@ -19,7 +19,7 @@
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="main" rowspan="2" style="text-align: center;">Pos.</th>
|
||||
<th class="main center narrow" rowspan="2">Pos.</th>
|
||||
<th class="main" rowspan="2" colspan="2">Sorte</th>
|
||||
<th class="main" rowspan="2" colspan="2">Attribut</th>
|
||||
<th class="main" rowspan="2">Qualitätsstufe</th>
|
||||
@ -27,21 +27,21 @@
|
||||
<th>Gewicht</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="font-size: 8pt;">[°Oe]</th>
|
||||
<th style="font-size: 8pt;">[°KMW]</th>
|
||||
<th style="font-size: 8pt;">[kg]</th>
|
||||
<th class="unit">[°Oe]</th>
|
||||
<th class="unit narrow">[°KMW]</th>
|
||||
<th class="unit">[kg]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
|
||||
<tr class="main">
|
||||
<td style="text-align: center;">@part.DPNr</td>
|
||||
<td class="center">@part.DPNr</td>
|
||||
<td colspan="2">@part.Variant.Name</td>
|
||||
<td colspan="2">@part.Attribute?.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.Kmw:N1}")</td>
|
||||
<td class="narrow" style="text-align: right;">@($"{part.Weight:N0}")</td>
|
||||
<td class="center">@($"{part.Oe:N0}")</td>
|
||||
<td class="center">@($"{part.Kmw:N1}")</td>
|
||||
<td class="number">@($"{part.Weight:N0}")</td>
|
||||
</tr>
|
||||
<tr><td></td><td colspan="5" style="white-space: pre;"><i>Herkunft:</i> @part.OriginString</td></tr>
|
||||
@if (part.Modifiers.Count() > 0) {
|
||||
@ -65,9 +65,9 @@
|
||||
@if (Model.Delivery.Parts.Count() > 1) {
|
||||
<tr class="main sum">
|
||||
<td colspan="6">Gesamt:</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>
|
||||
<td class="center">@($"{Model.Delivery.Oe:N0}")</td>
|
||||
<td class="center">@($"{Model.Delivery.Kmw:N1}")</td>
|
||||
<td class="number">@($"{Model.Delivery.Weight:N0}")</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@ -76,63 +76,12 @@
|
||||
<p class="comment">Amerkung zur Lieferung: @Model.Delivery.Comment</p>
|
||||
}
|
||||
@if (Model.DisplayStats > 0) {
|
||||
<table class="delivery-note-stats @(Model.DisplayStats > 2 ? "expanded" : "")">
|
||||
<colgroup>
|
||||
<col style="width: 45mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
<col style="width: 20mm;"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Lese @Model.Delivery.Year</b> per @($"{Model.Date:dd.MM.yyyy}") [kg]</th>
|
||||
<th>Lieferpflicht</th>
|
||||
<th>Lieferrecht</th>
|
||||
<th>Unterliefert</th>
|
||||
<th>Noch lieferbar</th>
|
||||
<th>Überliefert</th>
|
||||
<th>Geliefert</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
string FormatRow(int obligation, int right, int sum) {
|
||||
return $"<td>{obligation:N0}</td>" +
|
||||
$"<td>{right:N0}</td>" +
|
||||
$"<td>{(sum < obligation ? $"{obligation - sum:N0}" : "-")}</td>" +
|
||||
$"<td>{(sum >= obligation && sum <= right ? $"{right - sum:N0}" : "-")}</td>" +
|
||||
$"<td>{(sum > right ? $"{sum - right:N0}" : "-")}</td>" +
|
||||
$"<td>{sum:N0}</td>";
|
||||
}
|
||||
var sortids = Model.Delivery.Parts.Select(p => p.SortId).ToList();
|
||||
var buckets = Model.MemberBuckets.GroupBy(b => b.Key[..2]).ToDictionary(g => g.Key, g => g.Count());
|
||||
}
|
||||
<tr>
|
||||
<th>Gesamtlieferung lt. gez. GA</th>
|
||||
@Raw(FormatRow(
|
||||
Model.Member.BusinessShares * Model.Delivery.Season.MinKgPerBusinessShare,
|
||||
Model.Member.BusinessShares * Model.Delivery.Season.MaxKgPerBusinessShare,
|
||||
Model.Member.Deliveries.Where(d => d.Year == Model.Delivery.Year).Sum(d => d.Weight)
|
||||
))
|
||||
</tr>
|
||||
@if (Model.DisplayStats > 1) {
|
||||
<tr class="subheading">
|
||||
<th>Flächenbindungen:</th>
|
||||
</tr>
|
||||
@foreach (var (id, b) in Model.MemberBuckets.OrderBy(b => b.Key)) {
|
||||
if (b.Right > 0 || b.Obligation > 0 || (b.Delivery > 0 && buckets[id[..2]] > 1 && !id.EndsWith('_'))) {
|
||||
<tr class="@(sortids.Contains(id[..2]) ? "" : "optional")">
|
||||
<th>@b.Name</th>
|
||||
@Raw(FormatRow(b.Obligation, b.Right, b.Delivery))
|
||||
</tr>
|
||||
}
|
||||
}
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@Raw(Model.PrintBucketTable(
|
||||
Model.Delivery.Season, Model.MemberBuckets, isTiny: true,
|
||||
filter: Model.DisplayStats > 2 ? null :
|
||||
Model.DisplayStats == 1 ? new List<string>() :
|
||||
Model.Delivery.Parts.Select(p => p.SortId).Distinct().ToList()
|
||||
))
|
||||
}
|
||||
</main>
|
||||
@for (int i = 0; i < 2; i++) {
|
||||
|
@ -11,12 +11,6 @@ table.delivery tr:not(.main) {
|
||||
break-before: avoid;
|
||||
}
|
||||
|
||||
table.delivery th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
table.delivery th.main {
|
||||
text-align: left;
|
||||
}
|
||||
@ -43,55 +37,10 @@ table.delivery tr.tight:has(+ tr:not(.tight)) td {
|
||||
padding-bottom: 0.5mm !important;
|
||||
}
|
||||
|
||||
table.delivery tr.sum {
|
||||
border-top: 0.5pt solid black;
|
||||
break-before: avoid;
|
||||
}
|
||||
|
||||
table.delivery tr.sum td {
|
||||
padding-top: 1mm;
|
||||
}
|
||||
|
||||
table.delivery-note-stats {
|
||||
font-size: 8pt;
|
||||
break-inside: avoid;
|
||||
break-after: avoid;
|
||||
}
|
||||
|
||||
table.delivery-note-stats th,
|
||||
table.delivery-note-stats td {
|
||||
padding: 0.125mm 0;
|
||||
}
|
||||
|
||||
table.delivery-note-stats:not(.expanded) tr.optional {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.delivery-note-stats tr.subheading th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.delivery-note-stats.expanded tr.subheading:not(:has(~ tr)),
|
||||
table.delivery-note-stats tr.subheading:not(:has(~ tr:not(.optional))) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.delivery-note-stats thead th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.delivery-note-stats thead th:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.delivery-note-stats td {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
table.delivery-note-stats tbody th {
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
text-align: left;
|
||||
}
|
||||
|
113
Elwig/Documents/Document.Table.css
Normal file
113
Elwig/Documents/Document.Table.css
Normal file
@ -0,0 +1,113 @@
|
||||
|
||||
main table {
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 10mm;
|
||||
font-size: 10pt;
|
||||
}
|
||||
main table.large {font-size: 12pt;}
|
||||
main table.tiny {
|
||||
font-size: 8pt;
|
||||
margin-bottom: 5mm;
|
||||
}
|
||||
|
||||
main table tr {
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
main table th,
|
||||
main table td {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
vertical-align: middle;
|
||||
padding: 0.5mm 1mm;
|
||||
font-weight: normal;
|
||||
}
|
||||
main table.small th,
|
||||
main table.small td,
|
||||
main table.tiny th,
|
||||
main table.tiny td {
|
||||
padding: 0.125mm 0.125mm;
|
||||
}
|
||||
|
||||
main table td[rowspan] {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
main table thead {
|
||||
font-size: 8pt;
|
||||
}
|
||||
main table.large thead {
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
main table th {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
main table tbody {
|
||||
}
|
||||
|
||||
main table tbody .small {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
main table.number td,
|
||||
main table.number th {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
main table.number thead th,
|
||||
main table.number td,
|
||||
main table tbody td.number {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
main table.center tbody td,
|
||||
main table tbody td.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main table tbody th {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
main table.cohere {
|
||||
break-inside: avoid;
|
||||
}
|
||||
|
||||
main table tr.subheading th {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
font-size: 10pt;
|
||||
}
|
||||
main table.small tr.subheading th,
|
||||
main table.tiny tr.subheading th {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
main table.number thead tr:first-child th:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
main table tr.sum td {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
main table tr.sum,
|
||||
main table tr.new,
|
||||
main table tr.border {
|
||||
border-top: 0.5pt solid black;
|
||||
}
|
||||
table.delivery tr.sum {
|
||||
break-before: avoid;
|
||||
}
|
||||
|
||||
main table th.unit {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
main table th.narrow {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
@ -9,6 +9,7 @@
|
||||
<meta charset="UTF-8"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.Page.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\Document.Table.css"/>
|
||||
@if (Model.DoubleSided) {
|
||||
<style>
|
||||
@@page :left {
|
||||
|
Reference in New Issue
Block a user