Documents: Make business documents more compact
This commit is contained in:
@ -14,5 +14,8 @@
|
|||||||
<address>@Model.Address</address>
|
<address>@Model.Address</address>
|
||||||
</div>
|
</div>
|
||||||
<aside>@Raw(Model.Aside)</aside>
|
<aside>@Raw(Model.Aside)</aside>
|
||||||
|
@if (Model.ShowDateAndLocation) {
|
||||||
|
<div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
@RenderBody()
|
@RenderBody()
|
||||||
|
@ -3,6 +3,8 @@ using Elwig.Models;
|
|||||||
namespace Elwig.Documents {
|
namespace Elwig.Documents {
|
||||||
public abstract class BusinessDocument : Document {
|
public abstract class BusinessDocument : Document {
|
||||||
|
|
||||||
|
public bool ShowDateAndLocation = false;
|
||||||
|
|
||||||
public Member Member;
|
public Member Member;
|
||||||
public bool IncludeSender = false;
|
public bool IncludeSender = false;
|
||||||
public bool UseBillingAddress = false;
|
public bool UseBillingAddress = false;
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
var bucketNum = Model.BucketNames.Length;
|
var bucketNum = Model.BucketNames.Length;
|
||||||
}
|
}
|
||||||
<main>
|
<main>
|
||||||
<div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div>
|
|
||||||
<h1>@Model.Title</h1>
|
<h1>@Model.Title</h1>
|
||||||
<table class="credit">
|
<table class="credit">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
|
@ -16,6 +16,7 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
public CreditNote(Credit c, AppDbContext ctx) : base($"Traubengutschrift Nr. {c.TgId} – {c.Payment.Variant.Name}", c.Member) {
|
public CreditNote(Credit c, AppDbContext ctx) : base($"Traubengutschrift Nr. {c.TgId} – {c.Payment.Variant.Name}", c.Member) {
|
||||||
UseBillingAddress = true;
|
UseBillingAddress = true;
|
||||||
|
ShowDateAndLocation = true;
|
||||||
Credit = c;
|
Credit = c;
|
||||||
Aside = Aside.Replace("</table>", "") +
|
Aside = Aside.Replace("</table>", "") +
|
||||||
$"<thead><tr><th colspan='2'>Gutschrift</th></tr></thead><tbody>" +
|
$"<thead><tr><th colspan='2'>Gutschrift</th></tr></thead><tbody>" +
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
@{ Layout = "BusinessDocument"; }
|
@{ Layout = "BusinessDocument"; }
|
||||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliverynote.css" />
|
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliverynote.css" />
|
||||||
<main>
|
<main>
|
||||||
<div class="date">@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")</div>
|
|
||||||
<h1>@Model.Title</h1>
|
<h1>@Model.Title</h1>
|
||||||
@{
|
@{
|
||||||
bool displayStats = true; // Model.Delivery.Year == Model.CurrentNextSeason
|
bool displayStats = true; // Model.Delivery.Year == Model.CurrentNextSeason
|
||||||
@ -127,7 +126,7 @@
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><b>Gesamtlieferung</b> [kg]</th>
|
<th><b>Lese @Model.Delivery.Year</b> per @($"{Model.Date:dd.MM.yyyy}") [kg]</th>
|
||||||
<th>Lieferpflicht</th>
|
<th>Lieferpflicht</th>
|
||||||
<th>Lieferrecht</th>
|
<th>Lieferrecht</th>
|
||||||
<th>Unterliefert</th>
|
<th>Unterliefert</th>
|
||||||
@ -147,13 +146,14 @@
|
|||||||
$"<td>{sum:N0}</td>";
|
$"<td>{sum:N0}</td>";
|
||||||
}
|
}
|
||||||
var sortids = Model.Delivery.Parts.Select(p => p.SortId).ToList();
|
var sortids = Model.Delivery.Parts.Select(p => p.SortId).ToList();
|
||||||
|
var buckets = Model.MemberBuckets.GroupBy(b => b.Item1[..2]).ToDictionary(g => g.Key, g => g.Count());
|
||||||
}
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<th>Geschäftsanteile</th>
|
<th>Gesamtlieferung</th>
|
||||||
@Raw(FormatRow(Model.Member.DeliveryObligation, Model.Member.DeliveryRight, Model.Member.Deliveries.Where(d => d.Year == Model.Delivery.Year).Sum(d => d.Weight)))
|
@Raw(FormatRow(Model.Member.DeliveryObligation, Model.Member.DeliveryRight, Model.Member.Deliveries.Where(d => d.Year == Model.Delivery.Year).Sum(d => d.Weight)))
|
||||||
</tr>
|
</tr>
|
||||||
@foreach (var (id, name, right, obligation, sum) in Model.MemberBuckets.OrderBy(b => b.Item1)) {
|
@foreach (var (id, name, right, obligation, sum) in Model.MemberBuckets.OrderBy(b => b.Item1)) {
|
||||||
if (right > 0 && obligation > 0) {
|
if (right > 0 || obligation > 0 || (sum > 0 && buckets[id[..2]] > 1)) {
|
||||||
<tr class="@(sortids.Contains(id[..2]) ? "" : "optional")">
|
<tr class="@(sortids.Contains(id[..2]) ? "" : "optional")">
|
||||||
<th>@name</th>
|
<th>@name</th>
|
||||||
@Raw(FormatRow(obligation, right, sum))
|
@Raw(FormatRow(obligation, right, sum))
|
||||||
|
@ -11,6 +11,7 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
public DeliveryNote(Delivery d, AppDbContext ctx) : base($"Traubenübernahmeschein Nr. {d.LsNr}", d.Member) {
|
public DeliveryNote(Delivery d, AppDbContext ctx) : base($"Traubenübernahmeschein Nr. {d.LsNr}", d.Member) {
|
||||||
UseBillingAddress = true;
|
UseBillingAddress = true;
|
||||||
|
ShowDateAndLocation = true;
|
||||||
Delivery = d;
|
Delivery = d;
|
||||||
Aside = Aside.Replace("</table>", "") +
|
Aside = Aside.Replace("</table>", "") +
|
||||||
$"<thead><tr><th colspan='2'>Lieferung</th></tr></thead><tbody>" +
|
$"<thead><tr><th colspan='2'>Lieferung</th></tr></thead><tbody>" +
|
||||||
|
@ -9,6 +9,7 @@ namespace Elwig.Documents {
|
|||||||
private TempFile? PdfFile = null;
|
private TempFile? PdfFile = null;
|
||||||
|
|
||||||
public bool ShowFoldMarks = App.Config.Debug;
|
public bool ShowFoldMarks = App.Config.Debug;
|
||||||
|
|
||||||
public string DataPath;
|
public string DataPath;
|
||||||
public int CurrentNextSeason;
|
public int CurrentNextSeason;
|
||||||
public string? DocumentId;
|
public string? DocumentId;
|
||||||
@ -23,8 +24,8 @@ namespace Elwig.Documents {
|
|||||||
DataPath = App.DataPath;
|
DataPath = App.DataPath;
|
||||||
CurrentNextSeason = Utils.CurrentNextSeason;
|
CurrentNextSeason = Utils.CurrentNextSeason;
|
||||||
Title = title;
|
Title = title;
|
||||||
Author = App.Client.NameFull;
|
Author = c.NameFull;
|
||||||
Header = $"<h1>{c.Name}</h1>";
|
Header = $"<div class='name'>{c.Name}</div><div class='suffix'>{c.NameSuffix}</div>";
|
||||||
Footer = Utils.GenerateFooter("<br/>", " \u00b7 ")
|
Footer = Utils.GenerateFooter("<br/>", " \u00b7 ")
|
||||||
.Item(c.NameFull).NextLine()
|
.Item(c.NameFull).NextLine()
|
||||||
.Item(c.Address).Item($"{c.Plz} {c.Ort}").Item("Österreich").Item("Tel.", c.PhoneNr).Item("Fax", c.FaxNr).NextLine()
|
.Item(c.Address).Item($"{c.Plz} {c.Ort}").Item("Österreich").Item("Tel.", c.PhoneNr).Item("Fax", c.FaxNr).NextLine()
|
||||||
|
@ -14,6 +14,13 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-wrapper .date {
|
||||||
|
text-align: right;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: -1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
.address-wrapper {
|
.address-wrapper {
|
||||||
height: 45mm;
|
height: 45mm;
|
||||||
width: 85mm;
|
width: 85mm;
|
||||||
@ -80,7 +87,7 @@ main > *:first-child {
|
|||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-wrapper h1, .main-wrapper p {
|
main h1, .main-wrapper p {
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
@ -92,12 +99,8 @@ main > *:first-child {
|
|||||||
hyphens: manual;
|
hyphens: manual;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-wrapper .date {
|
main h1 {
|
||||||
margin-bottom: 2em;
|
margin-top: 0;
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-wrapper h1 {
|
|
||||||
margin-bottom: 2em;
|
margin-bottom: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
|
|
||||||
|
main h1 {
|
||||||
|
margin-bottom: 1.5em !important;
|
||||||
|
}
|
||||||
|
|
||||||
table.delivery {
|
table.delivery {
|
||||||
margin-bottom: 5mm;
|
margin-bottom: 5mm;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ table th {
|
|||||||
|
|
||||||
header {
|
header {
|
||||||
height: 45mm;
|
height: 45mm;
|
||||||
padding: 5mm;
|
padding: 10mm 0 0 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -25mm;
|
top: -25mm;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -38,9 +38,15 @@ header {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
header h1 {
|
header .name {
|
||||||
font-size: 18pt;
|
font-size: 18pt;
|
||||||
margin-top: 10mm;
|
margin-top: 10mm;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
header .suffix {
|
||||||
|
font-size: 12pt;
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer-wrapper {
|
.footer-wrapper {
|
||||||
|
Reference in New Issue
Block a user