BusinessDocument: Update Address generation
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Models;
|
||||
|
||||
namespace Elwig.Documents {
|
||||
@ -26,14 +27,9 @@ namespace Elwig.Documents {
|
||||
|
||||
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.Ort.Name}\n{b.Country.Name}";
|
||||
} else {
|
||||
var plz = Member.PostalDest.AtPlz;
|
||||
return $"{Member.AdministrativeName}\n{Member.Address}\n{plz.Plz} {plz.Ort.Name}\n{Member.PostalDest.Country.Name}";
|
||||
}
|
||||
IAddress addr = (Member.BillingAddress != null && UseBillingAddress) ? Member.BillingAddress : Member;
|
||||
var plz = addr.PostalDest.AtPlz;
|
||||
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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user