From e63b93acdfce8ddf6bc120ee3e1dbae79c7b0187 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 1 Apr 2026 11:56:12 +0200 Subject: [PATCH] DiakoniewerkEssen/Reporting - Druck von BeWo67 als Seite 2 --- .../Reporting/CustomReportCreator.cs | 80 +++++++++++++++++++ .../ServiceInvoiceReport67.Designer.cs | 39 ++++----- 2 files changed, 101 insertions(+), 18 deletions(-) diff --git a/ReportImp/DiakoniewerkEssen/Reporting/CustomReportCreator.cs b/ReportImp/DiakoniewerkEssen/Reporting/CustomReportCreator.cs index cd9b2ff60..f3462ef37 100644 --- a/ReportImp/DiakoniewerkEssen/Reporting/CustomReportCreator.cs +++ b/ReportImp/DiakoniewerkEssen/Reporting/CustomReportCreator.cs @@ -76,5 +76,85 @@ namespace DiakonieWerkEssen.Reporting return masterReport ?? new XtraReport(); } + + public override XtraReport CreateServiceInvoiceReportMitQb(long invoiceBaseOid) + { + var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid); + + var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(serviceInvoice); + + String reportId = serviceInvoice.InvoiceBase.InvoiceId; + if (String.IsNullOrEmpty(reportId)) + { + // Falls InvoiceId nicht existiert + // Gehe jede peroide von ServiceInvoice - ServiceInvoicePeriodList durch + foreach (var period in serviceInvoice.ServiceInvoicePeriodList) + { + if (String.IsNullOrEmpty(reportId) && period.SupportConceptApprovalPeriod != null) + { + // Falls periode - SupportConecptApprovalPeriod nicht leer ist, füge + reportId = period.SupportConceptApprovalPeriod.CostBearer2SupportConcept.CostBearer.ID; + if (String.IsNullOrEmpty(reportId) && period.SupportConceptApprovalPeriod.CostBearer2SupportConcept.CostBearer.IsSingleInvoicePerCustomer) + { + reportId = "Sammelrechnung"; + } + } + + + foreach (var item in period.InvoiceItemList) + { + if (String.IsNullOrEmpty(reportId) && item.SupportConceptApprovalPeriodOid.HasValue) + { + var approvalPeriod = + DAOFactory.GenericDAO.LoadByID(item.SupportConceptApprovalPeriodOid.Value); + if (approvalPeriod.CostBearer2SupportConcept != null) + { + reportId = approvalPeriod.CostBearer2SupportConcept.CostBearer.ID; + if (String.IsNullOrEmpty(reportId) && approvalPeriod.CostBearer2SupportConcept.CostBearer.IsSingleInvoicePerCustomer) + { + reportId = "Sammelrechnung"; + } + } + } + } + } + + IBeWoReport invoiceReport = FindReportImp(reportId); + invoiceReport.SetReportDataSource(ServiceInvoiceRO.Create(dc)); + ((XtraReport)invoiceReport).CreateDocument(); + var qb = CreateBelegeForInvoice(serviceInvoice.InvoiceBase); + AddReportPagesToMaster(invoiceReport as XtraReport, qb); + + return invoiceReport as XtraReport; + } + else if (reportId == "BeWo67") + { + var ro = ServiceInvoiceRO.Create(dc); + + var seite1 = new DiakonieWerkEssen.ServiceInvoiceReport(); + seite1.SetReportDataSource(ro); + seite1.CreateDocument(); + + var seite2 = new RechnungBeWo67(); + seite2.SetReportDataSource(ro); + seite2.CreateDocument(); + + seite1.Pages.AddRange(seite2.Pages); + + var qb = CreateBelegeForInvoice(serviceInvoice.InvoiceBase); + AddReportPagesToMaster(seite1, qb); + + return seite1; + } + else + { + IBeWoReport invoiceReport = FindReportImp(reportId); + invoiceReport.SetReportDataSource(ServiceInvoiceRO.Create(dc)); + ((XtraReport)invoiceReport).CreateDocument(); + var qb = CreateBelegeForInvoice(serviceInvoice.InvoiceBase); + AddReportPagesToMaster(invoiceReport as XtraReport, qb); + return invoiceReport as XtraReport; + } + } } } diff --git a/ReportImp/DiakoniewerkEssen/Reporting/ServiceInvoiceReport67.Designer.cs b/ReportImp/DiakoniewerkEssen/Reporting/ServiceInvoiceReport67.Designer.cs index f0f141bfc..429d0e3a6 100644 --- a/ReportImp/DiakoniewerkEssen/Reporting/ServiceInvoiceReport67.Designer.cs +++ b/ReportImp/DiakoniewerkEssen/Reporting/ServiceInvoiceReport67.Designer.cs @@ -45,6 +45,7 @@ namespace DiakonieWerkEssen this.xrLabel22 = new DevExpress.XtraReports.UI.XRLabel(); this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox(); this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.xrLabel24 = new DevExpress.XtraReports.UI.XRLabel(); this.lblGP = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel(); @@ -92,7 +93,6 @@ namespace DiakonieWerkEssen this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel(); this.lblNotice = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel24 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit(); @@ -116,7 +116,6 @@ namespace DiakonieWerkEssen // // ruleRateFactorNull // - this.ruleRateFactorNull.Condition = "[RateFactorText2] == ?"; this.ruleRateFactorNull.Formatting.Visible = DevExpress.Utils.DefaultBoolean.False; this.ruleRateFactorNull.Name = "ruleRateFactorNull"; // @@ -252,6 +251,21 @@ namespace DiakonieWerkEssen this.Page1.Name = "Page1"; this.Page1.StylePriority.UseFont = false; // + // xrLabel24 + // + this.xrLabel24.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { + new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[OrganisationDebitorNumber]")}); + this.xrLabel24.Font = new DevExpress.Drawing.DXFont("Verdana", 9F); + this.xrLabel24.LocationFloat = new DevExpress.Utils.PointFloat(420.0415F, 170F); + this.xrLabel24.Name = "xrLabel24"; + this.xrLabel24.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 0, 0, 0, 100F); + this.xrLabel24.SizeF = new System.Drawing.SizeF(256.9583F, 23F); + this.xrLabel24.StylePriority.UseFont = false; + this.xrLabel24.StylePriority.UsePadding = false; + this.xrLabel24.StylePriority.UseTextAlignment = false; + this.xrLabel24.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; + this.xrLabel24.TextFormatString = "Kostenträger: {0}"; + // // lblGP // this.lblGP.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { @@ -528,6 +542,8 @@ namespace DiakonieWerkEssen // xrLabel14 // this.xrLabel14.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; + this.xrLabel14.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { + new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[CustomerBirthdate]")}); this.xrLabel14.Font = new DevExpress.Drawing.DXFont("Verdana", 9.75F, DevExpress.Drawing.DXFontStyle.Bold, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] { new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))}); this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(433.916F, 316.6798F); @@ -536,6 +552,7 @@ namespace DiakonieWerkEssen this.xrLabel14.SizeF = new System.Drawing.SizeF(183.0417F, 17F); this.xrLabel14.StylePriority.UseBorders = false; this.xrLabel14.StylePriority.UseFont = false; + this.xrLabel14.TextFormatString = "{0:dd.MM.yyyy}"; // // xrLabel16 // @@ -723,6 +740,7 @@ namespace DiakonieWerkEssen this.xrTableCell45.StylePriority.UsePadding = false; this.xrTableCell45.StylePriority.UseTextAlignment = false; this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.xrTableCell45.TextFormatString = "{0:0.00 €}"; this.xrTableCell45.Weight = 0.43442356433034046D; // // xrTableCell47 @@ -791,21 +809,6 @@ namespace DiakonieWerkEssen this.lblNotice.Text = resources.GetString("lblNotice.Text"); this.lblNotice.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleJustify; // - // xrLabel24 - // - this.xrLabel24.ExpressionBindings.AddRange(new DevExpress.XtraReports.UI.ExpressionBinding[] { - new DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[OrganisationDebitorNumber]")}); - this.xrLabel24.Font = new DevExpress.Drawing.DXFont("Verdana", 9F); - this.xrLabel24.LocationFloat = new DevExpress.Utils.PointFloat(420.0415F, 170F); - this.xrLabel24.Name = "xrLabel24"; - this.xrLabel24.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 0, 0, 0, 100F); - this.xrLabel24.SizeF = new System.Drawing.SizeF(256.9583F, 23F); - this.xrLabel24.StylePriority.UseFont = false; - this.xrLabel24.StylePriority.UsePadding = false; - this.xrLabel24.StylePriority.UseTextAlignment = false; - this.xrLabel24.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - this.xrLabel24.TextFormatString = "Kostenträger: {0}"; - // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); @@ -824,7 +827,7 @@ namespace DiakonieWerkEssen this.Font = new DevExpress.Drawing.DXFont("Verdana", 10F); this.Margins = new DevExpress.Drawing.DXMargins(74.99997F, 39F, 179.125F, 80.8671F); this.PageHeight = 1169; - this.PageWidth = 826; + this.PageWidth = 827; this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4; this.Version = "23.2"; xrWatermark1.Id = "Watermark1";