BusinessDocument: Add DateFrom to be used for ShowDateAndLocation
All checks were successful
Test / Run tests (push) Successful in 2m0s
All checks were successful
Test / Run tests (push) Successful in 2m0s
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Elwig.Documents {
|
||||
public bool IncludeSender = false;
|
||||
public bool UseBillingAddress = false;
|
||||
public bool ShowDateAndLocation = false;
|
||||
public DateOnly? DateFrom;
|
||||
protected Table? Aside;
|
||||
|
||||
public string Address {
|
||||
@@ -47,11 +48,12 @@ namespace Elwig.Documents {
|
||||
return NewAsideCell(new KernedParagraph(text, 10), colspan, isName);
|
||||
}
|
||||
|
||||
public BusinessDocument(string title, Member m, bool includeSender = false) :
|
||||
public BusinessDocument(string title, Member m, DateOnly? dateFrom, bool includeSender = false) :
|
||||
base(title) {
|
||||
Member = m;
|
||||
Location = App.BranchLocation;
|
||||
IncludeSender = includeSender;
|
||||
DateFrom = dateFrom;
|
||||
}
|
||||
|
||||
protected override void BeforeRenderBody(iText.Layout.Document doc, PdfDocument pdf) {
|
||||
@@ -105,7 +107,7 @@ namespace Elwig.Documents {
|
||||
}
|
||||
}
|
||||
|
||||
doc.Add(new KernedParagraph(ShowDateAndLocation ? $"{Location}, am {Date:dd.MM.yyyy}" : "", 12).SetTextAlignment(TextAlignment.RIGHT).SetVerticalAlignment(VerticalAlignment.MIDDLE).SetHeight(24).SetMargin(0));
|
||||
doc.Add(new KernedParagraph(ShowDateAndLocation ? $"{Location}, am {DateFrom ?? Date:dd.MM.yyyy}" : "", 12).SetTextAlignment(TextAlignment.RIGHT).SetVerticalAlignment(VerticalAlignment.MIDDLE).SetHeight(24).SetMargin(0));
|
||||
doc.Add(new KernedParagraph(Title, 12).SetFont(BF).SetMargins(0, 0, 12, 0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user