From 7c630287e7f7d085f3212dacccebc69e78aad20b Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Tue, 9 Apr 2024 15:59:45 +0200 Subject: [PATCH] MH: moveAUT Rechnungsadresse --- ReportImp/AutismusKoelnBonn/BasisRechnung.cs | 16 +++--- .../CustomSettlementInvoiceCreation.cs | 11 ++++- ReportImp/AutismusKoelnBonn/RechnungFaktor.cs | 16 +++--- .../AutismusKoelnBonn/SettlementReport.cs | 49 +++---------------- .../AutismusKoelnBonn/SettlementReport2.cs | 22 ++------- 5 files changed, 35 insertions(+), 79 deletions(-) diff --git a/ReportImp/AutismusKoelnBonn/BasisRechnung.cs b/ReportImp/AutismusKoelnBonn/BasisRechnung.cs index f2dbebd0c..346ef42f3 100644 --- a/ReportImp/AutismusKoelnBonn/BasisRechnung.cs +++ b/ReportImp/AutismusKoelnBonn/BasisRechnung.cs @@ -62,14 +62,14 @@ namespace AutismusKoelnBonn { sb.AppendLine(poBox); } - else if (!String.IsNullOrEmpty(pRO.RecipientPoBox)) - { - sb.AppendLine(pRO.RecipientPoBox); - } - else if (!String.IsNullOrEmpty(pRO.RecipientStreet)) - { - sb.AppendLine(pRO.RecipientStreet); - } + //else 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(pRO.RecipientPostCodeAndTown); diff --git a/ReportImp/AutismusKoelnBonn/Invoicing/CustomSettlementInvoiceCreation.cs b/ReportImp/AutismusKoelnBonn/Invoicing/CustomSettlementInvoiceCreation.cs index baa7f504b..0defd2399 100644 --- a/ReportImp/AutismusKoelnBonn/Invoicing/CustomSettlementInvoiceCreation.cs +++ b/ReportImp/AutismusKoelnBonn/Invoicing/CustomSettlementInvoiceCreation.cs @@ -65,11 +65,18 @@ namespace AutismusKoelnBonn.Invoicing settlementInvoice.RecipientOrganisation = c2s.CostBearer.Organisation.Name.Remove(ersterIndex, zweiterIndex - ersterIndex + 1); } + // Schema mit Bezeichnungen der Labels in Organisationen: + // 1. Name + // 2. Abteilung (ersetzt Straße) + // 3. Adresszusatz (im Zweifel aus Rechnungsadresse) + // 4. PLZ + Ort(im Zweifel aus Rechnungsadresse) + + var invoiceAdress = c2s.CostBearer.Organisation.InvoiceAddress; if (!invoiceAdress.AddressLine1.IsNullOrEmpty()) settlementInvoice.RecipientDivision = invoiceAdress.AddressLine1; - if (!invoiceAdress.Street.IsNullOrEmpty()) - settlementInvoice.RecipientStreet = invoiceAdress.Street; + if (!c2s.CostBearer.Organisation.Name2.IsNullOrEmpty()) + settlementInvoice.RecipientStreet = c2s.CostBearer.Organisation.Name2; if (!invoiceAdress.PostalCode.IsNullOrEmpty()) settlementInvoice.RecipientPostCode = invoiceAdress.PostalCode; if (!invoiceAdress.Town.IsNullOrEmpty()) diff --git a/ReportImp/AutismusKoelnBonn/RechnungFaktor.cs b/ReportImp/AutismusKoelnBonn/RechnungFaktor.cs index d338292ca..d259db3fb 100644 --- a/ReportImp/AutismusKoelnBonn/RechnungFaktor.cs +++ b/ReportImp/AutismusKoelnBonn/RechnungFaktor.cs @@ -59,14 +59,14 @@ namespace AutismusKoelnBonn { sb.AppendLine(poBox); } - else if (!String.IsNullOrEmpty(pRO.RecipientPoBox)) - { - sb.AppendLine(pRO.RecipientPoBox); - } - else if (!String.IsNullOrEmpty(pRO.RecipientStreet)) - { - sb.AppendLine(pRO.RecipientStreet); - } + //else 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(pRO.RecipientPostCodeAndTown); diff --git a/ReportImp/AutismusKoelnBonn/SettlementReport.cs b/ReportImp/AutismusKoelnBonn/SettlementReport.cs index a21fcefd6..467c26b1d 100644 --- a/ReportImp/AutismusKoelnBonn/SettlementReport.cs +++ b/ReportImp/AutismusKoelnBonn/SettlementReport.cs @@ -27,52 +27,15 @@ namespace AutismusKoelnBonn.Alt { sb.AppendLine(pRO.RecipientOrganisation); } - if (!String.IsNullOrEmpty(pRO.RecipientDivision)) - { - sb.AppendLine(pRO.RecipientDivision); - } - //Angaben aus Rechnungsadresse - //var cb2sc = DAOFactory.GenericDAO.LoadByID(pRO.CostBearer2SupportConceptOid); - if (cb2sc.CostBearer != null && cb2sc.CostBearer.Organisation != null) - { - if (cb2sc.CostBearer.Organisation.InvoiceAddress != null && - !String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.InvoiceAddress.Street) || !String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.InvoiceAddress.Town)) - { - if (!String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1)) - cb2sc.CostBearer.Organisation.Address.AddressLine1 = cb2sc.CostBearer.Organisation.InvoiceAddress.AddressLine1; - pRO.RecipientPostCodeAndTown = String.Format("{0} {1}", cb2sc.CostBearer.Organisation.InvoiceAddress.PostalCode, cb2sc.CostBearer.Organisation.InvoiceAddress.Town); - pRO.RecipientStreet = cb2sc.CostBearer.Organisation.InvoiceAddress.Street; - if (cb2sc.CostBearer.Organisation.Contacts.Count > 0) - { - foreach (var i in cb2sc.CostBearer.Organisation.Contacts) - { - if (i.Type == BS.Shared.ContactType.private_POBox) - pRO.RecipientPoBox = i.Value; - } - } - } - else if (cb2sc.CostBearer.Organisation.Address != null) - { - pRO.RecipientPostCodeAndTown = String.Format("{0} {1}", cb2sc.CostBearer.Organisation.Address.PostalCode, cb2sc.CostBearer.Organisation.Address.Town); - pRO.RecipientStreet = cb2sc.CostBearer.Organisation.Address.Street; - } - } - if (!String.IsNullOrEmpty(cb2sc.CostBearer.Organisation.Address.AddressLine1)) - { - sb.AppendLine(cb2sc.CostBearer.Organisation.Address.AddressLine1); - } - // if (!String.IsNullOrEmpty(pRO.RecipientContactPerson)) - //{ - // sb.AppendLine(pRO.RecipientContactPerson); - //} - if (!String.IsNullOrEmpty(pRO.RecipientPoBox)) - { - sb.AppendLine(pRO.RecipientPoBox); - } - else if (!String.IsNullOrEmpty(pRO.RecipientStreet)) + if (!String.IsNullOrEmpty(pRO.RecipientStreet)) { sb.AppendLine(pRO.RecipientStreet); } + if (!String.IsNullOrEmpty(pRO.RecipientDivision)) + { + sb.AppendLine(pRO.RecipientDivision); + } + if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown)) { sb.AppendLine(pRO.RecipientPostCodeAndTown); diff --git a/ReportImp/AutismusKoelnBonn/SettlementReport2.cs b/ReportImp/AutismusKoelnBonn/SettlementReport2.cs index 6e58638c7..4aff87e4b 100644 --- a/ReportImp/AutismusKoelnBonn/SettlementReport2.cs +++ b/ReportImp/AutismusKoelnBonn/SettlementReport2.cs @@ -27,28 +27,14 @@ namespace AutismusKoelnBonn { sb.AppendLine(pRO.RecipientOrganisation); } + if (!String.IsNullOrEmpty(pRO.RecipientStreet)) + { + sb.AppendLine(pRO.RecipientStreet); + } if (!String.IsNullOrEmpty(pRO.RecipientDivision)) { sb.AppendLine(pRO.RecipientDivision); } - //Angaben aus Rechnungsadresse - //var cb2sc = DAOFactory.GenericDAO.LoadByID(pRO.CostBearer2SupportConceptOid); - if (!String.IsNullOrEmpty(AddressLine1)) - { - sb.AppendLine(AddressLine1); - } - //if (!String.IsNullOrEmpty(pRO.RecipientContactPerson)) - //{ - // sb.AppendLine(pRO.RecipientContactPerson); - //} - if (!String.IsNullOrEmpty(pRO.RecipientPostBox)) - { - sb.AppendLine(pRO.RecipientPostBox); - } - else if (!String.IsNullOrEmpty(pRO.RecipientStreet)) - { - sb.AppendLine(pRO.RecipientStreet); - } if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown)) { sb.AppendLine(pRO.RecipientPostCodeAndTown);