Modified printable document to align date on the right.
This commit is contained in:
@@ -187,19 +187,33 @@ namespace UCalc
|
|||||||
cell2.Blocks.Add(new Paragraph(new Run($"{amount.CeilToString()} €")) {Padding = new Thickness(6)});
|
cell2.Blocks.Add(new Paragraph(new Run($"{amount.CeilToString()} €")) {Padding = new Thickness(6)});
|
||||||
}
|
}
|
||||||
|
|
||||||
AddText(
|
void AddTextLeftRight(string leftText, string rightText)
|
||||||
$"{Billing.Landlord.Salutation.AsString()} {Billing.Landlord.Name}\n{DateTime.Now.ToString(Constants.DateFormat)}\n\n{Billing.Landlord.Address.Street} {Billing.Landlord.Address.HouseNumber}\n{Billing.Landlord.Address.Postcode} {Billing.Landlord.Address.City}\nTelefon: {Billing.Landlord.Phone}");
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Billing.Landlord.MailAddress))
|
|
||||||
{
|
{
|
||||||
AddText($"Email: {Billing.Landlord.MailAddress}");
|
var row2 = new TableRow();
|
||||||
|
rowGroup.Rows.Add(row2);
|
||||||
|
|
||||||
|
var cell2 = new TableCell();
|
||||||
|
row2.Cells.Add(cell2);
|
||||||
|
|
||||||
|
cell2.Blocks.Add(new Paragraph(new Run(leftText)));
|
||||||
|
|
||||||
|
cell2 = new TableCell
|
||||||
|
{
|
||||||
|
TextAlignment = TextAlignment.Right
|
||||||
|
};
|
||||||
|
row2.Cells.Add(cell2);
|
||||||
|
|
||||||
|
cell2.Blocks.Add(new Paragraph(new Run(rightText)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddTextLeftRight(
|
||||||
|
$"{Billing.Landlord.Name}\n{Billing.Landlord.Address.Street} {Billing.Landlord.Address.HouseNumber}\n{Billing.Landlord.Address.Postcode} {Billing.Landlord.Address.City}\nTelefon: {Billing.Landlord.Phone}{(string.IsNullOrEmpty(Billing.Landlord.MailAddress) ? "" : $"\nEmail: {Billing.Landlord.MailAddress}")}",
|
||||||
|
DateTime.Now.ToString(Constants.DateFormat));
|
||||||
|
|
||||||
AddLineBreaks(2);
|
AddLineBreaks(2);
|
||||||
|
|
||||||
AddText(
|
AddText(
|
||||||
$"{tenant.Salutation.AsString()} {tenant.Name}\n{Billing.House.Address.Street} {Billing.House.Address.HouseNumber}\n{Billing.House.Address.Postcode} {Billing.House.Address.City}",
|
$"{tenant.Salutation.AsString()} {tenant.Name}\n{Billing.House.Address.Street} {Billing.House.Address.HouseNumber}\n{Billing.House.Address.Postcode} {Billing.House.Address.City}");
|
||||||
null, true);
|
|
||||||
|
|
||||||
AddLineBreaks(4);
|
AddLineBreaks(4);
|
||||||
|
|
||||||
@@ -240,7 +254,7 @@ namespace UCalc
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddText(
|
AddText(
|
||||||
$"Der einmalige Betrag von {result.TotalAmount.CeilToString()} € wird in den nächsten Tagen auf Ihr Konto überwiesen.");
|
$"Der einmalige Betrag von {(result.TotalAmount * -1).CeilToString()} € wird in den nächsten Tagen auf Ihr Konto überwiesen.");
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLineBreaks(1);
|
AddLineBreaks(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user