diff --git a/Elwig/Documents/BusinessDocument.cshtml b/Elwig/Documents/BusinessDocument.cshtml index 3a17172..7a985d9 100644 --- a/Elwig/Documents/BusinessDocument.cshtml +++ b/Elwig/Documents/BusinessDocument.cshtml @@ -14,5 +14,8 @@
@Model.Address
+ @if (Model.ShowDateAndLocation) { +
@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")
+ } @RenderBody() diff --git a/Elwig/Documents/BusinessDocument.cshtml.cs b/Elwig/Documents/BusinessDocument.cshtml.cs index 0233606..daeba08 100644 --- a/Elwig/Documents/BusinessDocument.cshtml.cs +++ b/Elwig/Documents/BusinessDocument.cshtml.cs @@ -3,6 +3,8 @@ using Elwig.Models; namespace Elwig.Documents { public abstract class BusinessDocument : Document { + public bool ShowDateAndLocation = false; + public Member Member; public bool IncludeSender = false; public bool UseBillingAddress = false; diff --git a/Elwig/Documents/CreditNote.cshtml b/Elwig/Documents/CreditNote.cshtml index f135e2f..2d0ebbf 100644 --- a/Elwig/Documents/CreditNote.cshtml +++ b/Elwig/Documents/CreditNote.cshtml @@ -7,7 +7,6 @@ var bucketNum = Model.BucketNames.Length; }
-
@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")

@Model.Title

diff --git a/Elwig/Documents/CreditNote.cshtml.cs b/Elwig/Documents/CreditNote.cshtml.cs index 57a6edd..17ef975 100644 --- a/Elwig/Documents/CreditNote.cshtml.cs +++ b/Elwig/Documents/CreditNote.cshtml.cs @@ -16,6 +16,7 @@ namespace Elwig.Documents { public CreditNote(Credit c, AppDbContext ctx) : base($"Traubengutschrift Nr. {c.TgId} – {c.Payment.Variant.Name}", c.Member) { UseBillingAddress = true; + ShowDateAndLocation = true; Credit = c; Aside = Aside.Replace("
", "") + $"Gutschrift" + diff --git a/Elwig/Documents/DeliveryNote.cshtml b/Elwig/Documents/DeliveryNote.cshtml index 00e53a5..2ae1c4f 100644 --- a/Elwig/Documents/DeliveryNote.cshtml +++ b/Elwig/Documents/DeliveryNote.cshtml @@ -4,7 +4,6 @@ @{ Layout = "BusinessDocument"; }
-
@Model.Location, am @($"{Model.Date:dd.MM.yyyy}")

@Model.Title

@{ bool displayStats = true; // Model.Delivery.Year == Model.CurrentNextSeason @@ -127,7 +126,7 @@ - Gesamtlieferung [kg] + Lese @Model.Delivery.Year per @($"{Model.Date:dd.MM.yyyy}") [kg] Lieferpflicht Lieferrecht Unterliefert @@ -147,13 +146,14 @@ $"{sum:N0}"; } 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()); } - Geschäftsanteile + Gesamtlieferung @Raw(FormatRow(Model.Member.DeliveryObligation, Model.Member.DeliveryRight, Model.Member.Deliveries.Where(d => d.Year == Model.Delivery.Year).Sum(d => d.Weight))) @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)) { @name @Raw(FormatRow(obligation, right, sum)) diff --git a/Elwig/Documents/DeliveryNote.cshtml.cs b/Elwig/Documents/DeliveryNote.cshtml.cs index 0a72f3b..e6f4a1d 100644 --- a/Elwig/Documents/DeliveryNote.cshtml.cs +++ b/Elwig/Documents/DeliveryNote.cshtml.cs @@ -11,6 +11,7 @@ namespace Elwig.Documents { public DeliveryNote(Delivery d, AppDbContext ctx) : base($"Traubenübernahmeschein Nr. {d.LsNr}", d.Member) { UseBillingAddress = true; + ShowDateAndLocation = true; Delivery = d; Aside = Aside.Replace("", "") + $"Lieferung" + diff --git a/Elwig/Documents/Document.cshtml.cs b/Elwig/Documents/Document.cshtml.cs index 31ee435..a900f2d 100644 --- a/Elwig/Documents/Document.cshtml.cs +++ b/Elwig/Documents/Document.cshtml.cs @@ -9,6 +9,7 @@ namespace Elwig.Documents { private TempFile? PdfFile = null; public bool ShowFoldMarks = App.Config.Debug; + public string DataPath; public int CurrentNextSeason; public string? DocumentId; @@ -23,8 +24,8 @@ namespace Elwig.Documents { DataPath = App.DataPath; CurrentNextSeason = Utils.CurrentNextSeason; Title = title; - Author = App.Client.NameFull; - Header = $"

{c.Name}

"; + Author = c.NameFull; + Header = $"
{c.Name}
{c.NameSuffix}
"; Footer = Utils.GenerateFooter("
", " \u00b7 ") .Item(c.NameFull).NextLine() .Item(c.Address).Item($"{c.Plz} {c.Ort}").Item("Österreich").Item("Tel.", c.PhoneNr).Item("Fax", c.FaxNr).NextLine() diff --git a/Elwig/Documents/style-businessdocument.css b/Elwig/Documents/style-businessdocument.css index 9621244..c4e1f64 100644 --- a/Elwig/Documents/style-businessdocument.css +++ b/Elwig/Documents/style-businessdocument.css @@ -14,6 +14,13 @@ position: relative; } +.info-wrapper .date { + text-align: right; + position: absolute; + right: 0; + bottom: -1.5em; +} + .address-wrapper { height: 45mm; width: 85mm; @@ -80,7 +87,7 @@ main > *:first-child { margin-top: 0; } -.main-wrapper h1, .main-wrapper p { +main h1, .main-wrapper p { font-size: 12pt; margin: 1em 0; text-align: justify; @@ -92,12 +99,8 @@ main > *:first-child { hyphens: manual; } -.main-wrapper .date { - margin-bottom: 2em; - text-align: right; -} - -.main-wrapper h1 { +main h1 { + margin-top: 0; margin-bottom: 2em; } diff --git a/Elwig/Documents/style-deliverynote.css b/Elwig/Documents/style-deliverynote.css index 619f0f1..ec902c7 100644 --- a/Elwig/Documents/style-deliverynote.css +++ b/Elwig/Documents/style-deliverynote.css @@ -1,4 +1,8 @@ +main h1 { + margin-bottom: 1.5em !important; +} + table.delivery { margin-bottom: 5mm; } diff --git a/Elwig/Documents/style.css b/Elwig/Documents/style.css index 6d54f91..9f3ef7f 100644 --- a/Elwig/Documents/style.css +++ b/Elwig/Documents/style.css @@ -29,7 +29,7 @@ table th { header { height: 45mm; - padding: 5mm; + padding: 10mm 0 0 0; position: absolute; top: -25mm; left: 0; @@ -38,9 +38,15 @@ header { overflow: hidden; } -header h1 { +header .name { font-size: 18pt; margin-top: 10mm; + font-weight: bold; +} + +header .suffix { + font-size: 12pt; + font-weight: bold; } .footer-wrapper {