DomizielAnsbach/Invoicing/PBInvoiceCreation Adresssetzung

This commit is contained in:
2023-11-17 14:37:35 +01:00
parent 9b027909c7
commit 7113104c00
2 changed files with 22 additions and 17 deletions

View File

@@ -57,8 +57,6 @@ namespace DomizielAnsbach.Invoicing
{
serviceInvoice.InvoiceBase.RecipientAddress = address.CopyToNew();
}
}
}
}

View File

@@ -17,8 +17,14 @@ namespace DomizielAnsbach
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
bool bezirk = false;
var sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1) && pRO.RecipientAddressLine1.Contains("Bezirk"))
{
bezirk = true;
}
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && !bezirk)
{
sb.AppendLine(pRO.RecipientOrganisation);
}
@@ -31,18 +37,17 @@ namespace DomizielAnsbach
sb.AppendLine(pRO.RecipientDivision);
}
//if (!String.IsNullOrEmpty(pRO.RecipientContactPerson) && pRO.RecipientContactPerson != pRO.RecipientOrganisation)
//{
// sb.AppendLine(pRO.RecipientContactPerson);
//}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
{
sb.AppendLine(pRO.RecipientPoBox);
}
else if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine("");
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
@@ -62,14 +67,16 @@ namespace DomizielAnsbach
{
lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
}
if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("herr"))
if (!bezirk)
{
lblAnrede.Text = String.Format("Sehr geehrter Herr {0},", pRO.CustomerLastName);
}
else if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("frau"))
{
lblAnrede.Text = String.Format("Sehr geehrte Frau {0},", pRO.CustomerLastName);
if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("herr"))
{
lblAnrede.Text = String.Format("Sehr geehrter Herr {0},", pRO.CustomerLastName);
}
else if (!String.IsNullOrEmpty(pRO.CustomerSalutation) && pRO.CustomerSalutation.ToLower().Contains("frau"))
{
lblAnrede.Text = String.Format("Sehr geehrte Frau {0},", pRO.CustomerLastName);
}
}
this.bindingSource1.DataSource = pRO;