From 7113104c00a4abb7989f619c860c946a12474cc1 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Fri, 17 Nov 2023 14:37:35 +0100 Subject: [PATCH] DomizielAnsbach/Invoicing/PBInvoiceCreation Adresssetzung --- .../Invoicing/PBInvoiceCreation.cs | 2 - ReportImp/DomizielAnsbach/RechnungPB.cs | 37 +++++++++++-------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/ReportImp/DomizielAnsbach/Invoicing/PBInvoiceCreation.cs b/ReportImp/DomizielAnsbach/Invoicing/PBInvoiceCreation.cs index 6e057b68c..a05cb26a5 100644 --- a/ReportImp/DomizielAnsbach/Invoicing/PBInvoiceCreation.cs +++ b/ReportImp/DomizielAnsbach/Invoicing/PBInvoiceCreation.cs @@ -57,8 +57,6 @@ namespace DomizielAnsbach.Invoicing { serviceInvoice.InvoiceBase.RecipientAddress = address.CopyToNew(); } - - } } } diff --git a/ReportImp/DomizielAnsbach/RechnungPB.cs b/ReportImp/DomizielAnsbach/RechnungPB.cs index a4ea136fb..9e8dfcc41 100644 --- a/ReportImp/DomizielAnsbach/RechnungPB.cs +++ b/ReportImp/DomizielAnsbach/RechnungPB.cs @@ -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;