39 lines
1.6 KiB
C#
39 lines
1.6 KiB
C#
using Elwig.Models;
|
|
|
|
namespace Elwig.Documents {
|
|
public abstract class BusinessDocument : Document {
|
|
|
|
public Member Member;
|
|
public bool IncludeSender = false;
|
|
public bool UseBillingAddress = false;
|
|
public string Aside;
|
|
public string? Location;
|
|
|
|
public BusinessDocument(string title, Member m, bool includeSender = false) : base(title) {
|
|
Member = m;
|
|
Location = App.BranchName;
|
|
IncludeSender = includeSender;
|
|
var uid = (m.UstIdNr ?? "-") + (m.IsBuchführend ? "" : " <i>(pauschaliert)</i>");
|
|
Aside = $"<table><colgroup><col span='1' style='width: 22.5mm;'/><col span='1' style='width: 42.5mm;'/></colgroup>" +
|
|
$"<thead><tr><th colspan='2'>Mitglied</th></tr></thead><tbody>" +
|
|
$"<tr><th>Mitglieds-Nr.</th><td>{m.MgNr}</td></tr>" +
|
|
$"<tr><th>Betriebs-Nr.</th><td>{m.LfbisNr}</td></tr>" +
|
|
$"<tr><th>UID</th><td>{uid}</td></tr>" +
|
|
$"</tbody></table>";
|
|
}
|
|
|
|
public string Address {
|
|
get {
|
|
var b = Member.BillingAddress;
|
|
if (b != null && UseBillingAddress) {
|
|
var plz = b.PostalDest.AtPlz;
|
|
return $"{b.Name}\n{Member.AdministrativeName}\n{b.Address}\n{plz.Plz} {plz.Dest}\nÖsterreich";
|
|
} else {
|
|
var plz = Member.PostalDest.AtPlz;
|
|
return $"{Member.AdministrativeName}\n{Member.Address}\n{plz.Plz} {plz.Dest}\nÖsterreich";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|