From d82a17c1ca065893947d6ae52a6c75a0d9a26a76 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Fri, 6 May 2022 16:04:05 +0200 Subject: [PATCH 1/2] VkmMenden und PerspektivenEV --- .../CollectiveBillingReport.Designer.cs | 104 ++++--- .../PerspektivenEV/CollectiveBillingReport.cs | 19 +- .../CollectiveBillingReportTab.Designer.cs | 140 ++++++---- .../CollectiveBillingReportTab.cs | 44 ++- .../Invoicing/CollectiveInvoiceCreation.cs | 259 +++++++++++++++--- .../Invoicing/SelbstzahlerInvoiceCreation.cs | 5 + .../PerspektivenEV/PerspektivenEV.csproj | 10 + .../Service/CustomCalculations.cs | 24 ++ .../PerspektivenEV/ServiceInvoiceReport.cs | 2 + .../VkmMenden/AllgemeineRechnung.Designer.cs | 2 +- ReportImp/VkmMenden/AllgemeineRechnung.resx | 2 +- 11 files changed, 419 insertions(+), 192 deletions(-) diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs b/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs index f58f9b474..cb024ed67 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs @@ -59,21 +59,20 @@ namespace PerspektivenEV this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); - this.DetailReport2 = new DevExpress.XtraReports.UI.DetailReportBand(); - this.Detail3 = new DevExpress.XtraReports.UI.DetailBand(); this.xrTable6 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow25 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell42 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); + this.lblHourlyRate = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell45 = new DevExpress.XtraReports.UI.XRTableCell(); - this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit(); @@ -266,7 +265,8 @@ namespace PerspektivenEV // this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { this.Detail1, - this.DetailReport2}); + this.GroupHeader1, + this.GroupFooter2}); this.DetailReport.DataMember = "ServiceInvoicePeriods"; this.DetailReport.DataSource = this.bindingSource1; this.DetailReport.Level = 0; @@ -275,9 +275,9 @@ namespace PerspektivenEV // Detail1 // this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable5}); + this.xrTable6}); this.Detail1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Detail1.HeightF = 50F; + this.Detail1.HeightF = 25F; this.Detail1.Name = "Detail1"; this.Detail1.StylePriority.UseFont = false; // @@ -436,23 +436,6 @@ namespace PerspektivenEV this.xrTableCell8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell8.Weight = 0.71650711871826434D; // - // DetailReport2 - // - this.DetailReport2.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { - this.Detail3, - this.GroupFooter1}); - this.DetailReport2.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems"; - this.DetailReport2.DataSource = this.bindingSource1; - this.DetailReport2.Level = 0; - this.DetailReport2.Name = "DetailReport2"; - // - // Detail3 - // - this.Detail3.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable6}); - this.Detail3.HeightF = 25F; - this.Detail3.Name = "Detail3"; - // // xrTable6 // this.xrTable6.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); @@ -467,7 +450,7 @@ namespace PerspektivenEV this.xrTableRow25.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { this.xrTableCell2, this.xrTableCell42, - this.xrTableCell10, + this.lblHourlyRate, this.xrTableCell45}); this.xrTableRow25.Name = "xrTableRow25"; this.xrTableRow25.Weight = 1D; @@ -477,7 +460,7 @@ namespace PerspektivenEV this.xrTableCell2.BorderColor = System.Drawing.Color.DarkGray; this.xrTableCell2.Borders = DevExpress.XtraPrinting.BorderSide.None; this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.Hours")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedHours", "{0:n2}")}); this.xrTableCell2.Font = new System.Drawing.Font("Calibri", 11F); this.xrTableCell2.Name = "xrTableCell2"; this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); @@ -494,7 +477,7 @@ namespace PerspektivenEV this.xrTableCell42.BorderColor = System.Drawing.Color.DarkGray; this.xrTableCell42.Borders = DevExpress.XtraPrinting.BorderSide.None; this.xrTableCell42.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.ServiceDescription")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Notice")}); this.xrTableCell42.Font = new System.Drawing.Font("Calibri", 11F); this.xrTableCell42.Name = "xrTableCell42"; this.xrTableCell42.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); @@ -506,29 +489,29 @@ namespace PerspektivenEV this.xrTableCell42.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; this.xrTableCell42.Weight = 1.2396351551486897D; // - // xrTableCell10 + // lblHourlyRate // - this.xrTableCell10.BorderColor = System.Drawing.Color.DarkGray; - this.xrTableCell10.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.HourlyRate", "{0:0.00} €")}); - this.xrTableCell10.Font = new System.Drawing.Font("Calibri", 11F); - this.xrTableCell10.Name = "xrTableCell10"; - this.xrTableCell10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); - this.xrTableCell10.StylePriority.UseBorderColor = false; - this.xrTableCell10.StylePriority.UseBorders = false; - this.xrTableCell10.StylePriority.UseFont = false; - this.xrTableCell10.StylePriority.UsePadding = false; - this.xrTableCell10.StylePriority.UseTextAlignment = false; - this.xrTableCell10.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell10.Weight = 0.48943381421226906D; + this.lblHourlyRate.BorderColor = System.Drawing.Color.DarkGray; + this.lblHourlyRate.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.lblHourlyRate.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedBE", "{0:0.00} €")}); + this.lblHourlyRate.Font = new System.Drawing.Font("Calibri", 11F); + this.lblHourlyRate.Name = "lblHourlyRate"; + this.lblHourlyRate.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); + this.lblHourlyRate.StylePriority.UseBorderColor = false; + this.lblHourlyRate.StylePriority.UseBorders = false; + this.lblHourlyRate.StylePriority.UseFont = false; + this.lblHourlyRate.StylePriority.UsePadding = false; + this.lblHourlyRate.StylePriority.UseTextAlignment = false; + this.lblHourlyRate.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.lblHourlyRate.Weight = 0.48943381421226906D; // // xrTableCell45 // this.xrTableCell45.BorderColor = System.Drawing.Color.DarkGray; this.xrTableCell45.Borders = DevExpress.XtraPrinting.BorderSide.None; this.xrTableCell45.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.NetAmount", "{0:0.00} €")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Claim", "{0:0.00}")}); this.xrTableCell45.Font = new System.Drawing.Font("Calibri", 11F); this.xrTableCell45.Name = "xrTableCell45"; this.xrTableCell45.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); @@ -541,21 +524,13 @@ namespace PerspektivenEV this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell45.Weight = 0.71650711360086339D; // - // GroupFooter1 - // - this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrLabel5, - this.xrTable1}); - this.GroupFooter1.HeightF = 123.9583F; - this.GroupFooter1.Name = "GroupFooter1"; - // // xrLabel5 // this.xrLabel5.BackColor = System.Drawing.Color.Transparent; this.xrLabel5.Borders = DevExpress.XtraPrinting.BorderSide.Bottom; this.xrLabel5.BorderWidth = 2F; this.xrLabel5.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 88.43752F); + this.xrLabel5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 78.02086F); this.xrLabel5.Name = "xrLabel5"; this.xrLabel5.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel5.SizeF = new System.Drawing.SizeF(631F, 20F); @@ -567,7 +542,7 @@ namespace PerspektivenEV // // xrTable1 // - this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 55.20833F); + this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 44.79167F); this.xrTable1.Name = "xrTable1"; this.xrTable1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow6}); @@ -638,6 +613,21 @@ namespace PerspektivenEV this.xrTableCell11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell11.Weight = 0.71650725326721421D; // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable5}); + this.GroupHeader1.HeightF = 50F; + this.GroupHeader1.Name = "GroupHeader1"; + // + // GroupFooter2 + // + this.GroupFooter2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel5, + this.xrTable1}); + this.GroupFooter2.HeightF = 100F; + this.GroupFooter2.Name = "GroupFooter2"; + // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); @@ -664,6 +654,7 @@ namespace PerspektivenEV this.PaperKind = System.Drawing.Printing.PaperKind.A4; this.Version = "17.1"; this.Watermark.Image = ((System.Drawing.Image)(resources.GetObject("Sammelrechnung.Watermark.Image"))); + this.Watermark.PageRange = "1"; ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); @@ -690,19 +681,16 @@ namespace PerspektivenEV private DevExpress.XtraReports.UI.XRTableRow xrTableRow23; private DevExpress.XtraReports.UI.XRTableCell xrTableCell37; private DevExpress.XtraReports.UI.XRTableCell xrTableCell36; - private DevExpress.XtraReports.UI.DetailReportBand DetailReport2; - private DevExpress.XtraReports.UI.DetailBand Detail3; private DevExpress.XtraReports.UI.XRTable xrTable6; private DevExpress.XtraReports.UI.XRTableRow xrTableRow25; private DevExpress.XtraReports.UI.XRTableCell xrTableCell42; private DevExpress.XtraReports.UI.XRTableCell xrTableCell45; private DevExpress.XtraReports.UI.XRLabel lblAdresse; private DevExpress.XtraReports.UI.FormattingRule ruleNoticeNull; - private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; private DevExpress.XtraReports.UI.XRLabel xrLabel1; private DevExpress.XtraReports.UI.XRLabel xrLabel6; private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell10; + private DevExpress.XtraReports.UI.XRTableCell lblHourlyRate; private DevExpress.XtraReports.UI.XRTable xrTable1; private DevExpress.XtraReports.UI.XRTableRow xrTableRow6; private DevExpress.XtraReports.UI.XRTableCell xrTableCell3; @@ -718,5 +706,7 @@ namespace PerspektivenEV private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; private DevExpress.XtraReports.UI.XRLabel xrLabel5; private DevExpress.XtraReports.UI.XRLabel xrLabel7; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; + private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter2; } } diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReport.cs b/ReportImp/PerspektivenEV/CollectiveBillingReport.cs index 18c4fa973..543524e47 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReport.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReport.cs @@ -49,24 +49,7 @@ namespace PerspektivenEV } lblAdresse.Text = sb.ToString(); - - var newSip = new ServiceInvoicePeriodRO(); - - foreach (var sip in pRO.ServiceInvoicePeriods) - { - var newItem = new ServiceInvoiceItemRO(); - - foreach (var item in sip.ServiceInvoiceItems) - { - newItem.UnitCount += item.UnitCount; - newItem.NetAmount += item.NetAmount; - newItem.ServiceDescription = item.ServiceDescription; - } - - newSip.ServiceInvoiceItems.Add(newItem); - } - pRO.ServiceInvoicePeriods = new List(); - pRO.ServiceInvoicePeriods.Add(newSip); + lblHourlyRate.Text = pRO.ServiceInvoicePeriods[0].ServiceInvoiceItems[0].HourlyRate.ToString(); this.bindingSource1.DataSource = pRO; } diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs index 2f20a8a59..dfdf6f021 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs @@ -32,6 +32,7 @@ namespace PerspektivenEV DevExpress.XtraReports.UI.XRSummary xrSummary1 = new DevExpress.XtraReports.UI.XRSummary(); DevExpress.XtraReports.UI.XRSummary xrSummary2 = new DevExpress.XtraReports.UI.XRSummary(); DevExpress.XtraReports.UI.XRSummary xrSummary3 = new DevExpress.XtraReports.UI.XRSummary(); + DevExpress.XtraReports.UI.XRSummary xrSummary4 = new DevExpress.XtraReports.UI.XRSummary(); this.Detail = new DevExpress.XtraReports.UI.DetailBand(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); this.ruleRateFactorNull = new DevExpress.XtraReports.UI.FormattingRule(); @@ -40,6 +41,8 @@ namespace PerspektivenEV this.xrPageInfo2 = new DevExpress.XtraReports.UI.XRPageInfo(); this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); + this.DetailReport1 = new DevExpress.XtraReports.UI.DetailReportBand(); + this.Detail2 = new DevExpress.XtraReports.UI.DetailBand(); this.xrTable6 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow25 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell33 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -51,7 +54,7 @@ namespace PerspektivenEV this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell18 = new DevExpress.XtraReports.UI.XRTableCell(); - this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.xrTable5 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell30 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -73,7 +76,6 @@ namespace PerspektivenEV this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell21 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell(); - this.GroupFooter = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -82,11 +84,13 @@ namespace PerspektivenEV this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); this.ruleNoticeNull = new DevExpress.XtraReports.UI.FormattingRule(); - this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.lblHeader = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); this.fieldMonatskontingent = new DevExpress.XtraReports.UI.CalculatedField(); + this.fieldBetreuungsbeginn = new DevExpress.XtraReports.UI.CalculatedField(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); @@ -143,7 +147,7 @@ namespace PerspektivenEV // this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { this.Detail1, - this.GroupHeader1}); + this.DetailReport1}); this.DetailReport.DataMember = "ServiceInvoicePeriods"; this.DetailReport.DataSource = this.bindingSource1; this.DetailReport.Level = 0; @@ -151,15 +155,32 @@ namespace PerspektivenEV // // Detail1 // - this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable6}); this.Detail1.Font = new System.Drawing.Font("Arial", 11F); - this.Detail1.HeightF = 18F; + this.Detail1.HeightF = 0F; this.Detail1.Name = "Detail1"; this.Detail1.StylePriority.UseFont = false; this.Detail1.StylePriority.UseTextAlignment = false; this.Detail1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; // + // DetailReport1 + // + this.DetailReport1.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { + this.Detail2, + this.GroupHeader2, + this.GroupHeader1, + this.GroupFooter1}); + this.DetailReport1.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems"; + this.DetailReport1.DataSource = this.bindingSource1; + this.DetailReport1.Level = 0; + this.DetailReport1.Name = "DetailReport1"; + // + // Detail2 + // + this.Detail2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable6}); + this.Detail2.HeightF = 18F; + this.Detail2.Name = "Detail2"; + // // xrTable6 // this.xrTable6.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); @@ -210,7 +231,7 @@ namespace PerspektivenEV this.xrTableCell42.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell42.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Customer.LastNameFirstName")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.ServiceDescription")}); this.xrTableCell42.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell42.Name = "xrTableCell42"; this.xrTableCell42.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); @@ -228,7 +249,7 @@ namespace PerspektivenEV this.xrTableCell8.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.CostBearer2SupportConcept.CustomerReferenceNumber")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.Notice")}); this.xrTableCell8.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell8.Name = "xrTableCell8"; this.xrTableCell8.StylePriority.UseBorders = false; @@ -242,12 +263,13 @@ namespace PerspektivenEV // this.xrTableCell34.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell34.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.AccountingPeriodEnd", "{0:dd.MM.yyyy}")}); this.xrTableCell34.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell34.Name = "xrTableCell34"; this.xrTableCell34.StylePriority.UseBorders = false; this.xrTableCell34.StylePriority.UseFont = false; this.xrTableCell34.StylePriority.UseTextAlignment = false; - this.xrTableCell34.Text = "[CostBearer2SupportConcept.ApprovedEndDate!dd.MM.yy]"; this.xrTableCell34.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; this.xrTableCell34.Weight = 0.24966908926408551D; // @@ -255,6 +277,8 @@ namespace PerspektivenEV // this.xrTableCell3.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Customer.AssistanceBegin")}); this.xrTableCell3.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell3.Name = "xrTableCell3"; this.xrTableCell3.StylePriority.UseBorders = false; @@ -269,7 +293,7 @@ namespace PerspektivenEV this.xrTableCell45.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell45.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.SupportConceptApprovalPeriod.ApprovedBEPerInterval", "{0:#}")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.UnitDescription")}); this.xrTableCell45.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell45.Name = "xrTableCell45"; this.xrTableCell45.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); @@ -278,7 +302,6 @@ namespace PerspektivenEV this.xrTableCell45.StylePriority.UseFont = false; this.xrTableCell45.StylePriority.UsePadding = false; this.xrTableCell45.StylePriority.UseTextAlignment = false; - this.xrTableCell45.Text = "xrTableCell45"; this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; this.xrTableCell45.Weight = 0.33289210448805817D; // @@ -287,12 +310,14 @@ namespace PerspektivenEV this.xrTableCell10.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.fieldMonatskontingent", "{0:0.00}")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.UnitCount", "{0:0.00}")}); this.xrTableCell10.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell10.Name = "xrTableCell10"; this.xrTableCell10.StylePriority.UseBorders = false; this.xrTableCell10.StylePriority.UseFont = false; + this.xrTableCell10.StylePriority.UseTextAlignment = false; this.xrTableCell10.Text = "xrTableCell10"; + this.xrTableCell10.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; this.xrTableCell10.Weight = 0.33289210047693363D; // // xrTableCell17 @@ -315,7 +340,7 @@ namespace PerspektivenEV this.xrTableCell18.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell18.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Claim")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.GrossAmount")}); this.xrTableCell18.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold); this.xrTableCell18.Name = "xrTableCell18"; this.xrTableCell18.StylePriority.UseBorders = false; @@ -324,13 +349,13 @@ namespace PerspektivenEV this.xrTableCell18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell18.Weight = 0.332892002330651D; // - // GroupHeader1 + // GroupHeader2 // - this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.GroupHeader2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrTable5}); - this.GroupHeader1.HeightF = 36F; - this.GroupHeader1.Name = "GroupHeader1"; - this.GroupHeader1.RepeatEveryPage = true; + this.GroupHeader2.HeightF = 36F; + this.GroupHeader2.Name = "GroupHeader2"; + this.GroupHeader2.RepeatEveryPage = true; // // xrTable5 // @@ -575,15 +600,6 @@ namespace PerspektivenEV this.xrTableCell22.StylePriority.UseBorders = false; this.xrTableCell22.Weight = 0.33118914272283523D; // - // GroupFooter - // - this.GroupFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable1}); - this.GroupFooter.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold); - this.GroupFooter.HeightF = 25F; - this.GroupFooter.Name = "GroupFooter"; - this.GroupFooter.StylePriority.UseFont = false; - // // xrTable1 // this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); @@ -628,7 +644,7 @@ namespace PerspektivenEV this.xrTableCell23.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell23.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.SupportConceptApprovalPeriod.ApprovedBEPerInterval")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.UnitDescription")}); this.xrTableCell23.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold); this.xrTableCell23.Name = "xrTableCell23"; this.xrTableCell23.StylePriority.UseBorders = false; @@ -645,7 +661,7 @@ namespace PerspektivenEV this.cellTotalPerMonth.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.cellTotalPerMonth.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.fieldMonatskontingent")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.UnitCount")}); this.cellTotalPerMonth.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold); this.cellTotalPerMonth.Name = "cellTotalPerMonth"; this.cellTotalPerMonth.StylePriority.UseBorders = false; @@ -670,12 +686,14 @@ namespace PerspektivenEV this.xrTableCell14.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "GrossClaim")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.GrossAmount")}); this.xrTableCell14.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold); this.xrTableCell14.Name = "xrTableCell14"; this.xrTableCell14.StylePriority.UseBorders = false; this.xrTableCell14.StylePriority.UseFont = false; this.xrTableCell14.StylePriority.UseTextAlignment = false; + xrSummary4.FormatString = "{0:#.00}"; + this.xrTableCell14.Summary = xrSummary4; this.xrTableCell14.Text = "xrTableCell9"; this.xrTableCell14.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell14.Weight = 0.23812008704613302D; @@ -686,25 +704,13 @@ namespace PerspektivenEV this.ruleNoticeNull.Formatting.Visible = DevExpress.Utils.DefaultBoolean.False; this.ruleNoticeNull.Name = "ruleNoticeNull"; // - // Page1 - // - this.Page1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.lblHeader, - this.xrLabel3, - this.xrLabel2}); - this.Page1.Font = new System.Drawing.Font("Arial", 10F); - this.Page1.HeightF = 60F; - this.Page1.Name = "Page1"; - this.Page1.StylePriority.UseBorders = false; - this.Page1.StylePriority.UseFont = false; - // // lblHeader // this.lblHeader.BackColor = System.Drawing.Color.Transparent; this.lblHeader.Borders = DevExpress.XtraPrinting.BorderSide.None; this.lblHeader.CanShrink = true; this.lblHeader.Font = new System.Drawing.Font("Arial", 9F); - this.lblHeader.LocationFloat = new DevExpress.Utils.PointFloat(409.375F, 10.00001F); + this.lblHeader.LocationFloat = new DevExpress.Utils.PointFloat(408.8752F, 10.00001F); this.lblHeader.Multiline = true; this.lblHeader.Name = "lblHeader"; this.lblHeader.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -720,7 +726,7 @@ namespace PerspektivenEV // this.xrLabel3.Borders = DevExpress.XtraPrinting.BorderSide.None; this.xrLabel3.Font = new System.Drawing.Font("Arial", 9F); - this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(938.5001F, 10.00001F); + this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(938.0004F, 10.00001F); this.xrLabel3.Name = "xrLabel3"; this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel3.SizeF = new System.Drawing.SizeF(130.4999F, 25F); @@ -729,7 +735,7 @@ namespace PerspektivenEV this.xrLabel3.StylePriority.UseFont = false; this.xrLabel3.StylePriority.UseForeColor = false; this.xrLabel3.StylePriority.UseTextAlignment = false; - this.xrLabel3.Text = "[AccountingPeriodStart!MMMM yyyy]"; + this.xrLabel3.Text = " [AccountingPeriodEnd!dd.MM.yyyy]"; this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; this.xrLabel3.WordWrap = false; // @@ -738,7 +744,7 @@ namespace PerspektivenEV this.xrLabel2.BackColor = System.Drawing.Color.Transparent; this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.None; this.xrLabel2.Font = new System.Drawing.Font("Arial", 9F); - this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0.4998843F, 10.00001F); + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10.00001F); this.xrLabel2.Multiline = true; this.xrLabel2.Name = "xrLabel2"; this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -758,6 +764,32 @@ namespace PerspektivenEV this.fieldMonatskontingent.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal; this.fieldMonatskontingent.Name = "fieldMonatskontingent"; // + // fieldBetreuungsbeginn + // + this.fieldBetreuungsbeginn.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems"; + this.fieldBetreuungsbeginn.Expression = "Iif([AccountingPeriodStart] < AddYears(Now(), -1000), ?, [AccountingPeriodStart])" + + ""; + this.fieldBetreuungsbeginn.FieldType = DevExpress.XtraReports.UI.FieldType.DateTime; + this.fieldBetreuungsbeginn.Name = "fieldBetreuungsbeginn"; + // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.lblHeader, + this.xrLabel3, + this.xrLabel2}); + this.GroupHeader1.HeightF = 75F; + this.GroupHeader1.Level = 1; + this.GroupHeader1.Name = "GroupHeader1"; + this.GroupHeader1.PageBreak = DevExpress.XtraReports.UI.PageBreak.BeforeBandExceptFirstEntry; + // + // GroupFooter1 + // + this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable1}); + this.GroupFooter1.HeightF = 18F; + this.GroupFooter1.Name = "GroupFooter1"; + // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); @@ -769,11 +801,10 @@ namespace PerspektivenEV this.ReportHeader, this.topMarginBand1, this.bottomMarginBand1, - this.GroupFooter, - this.Page1, this.DetailReport}); this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] { - this.fieldMonatskontingent}); + this.fieldMonatskontingent, + this.fieldBetreuungsbeginn}); this.DataSource = this.bindingSource1; this.ExportOptions.PrintPreview.DefaultFileName = "Spitzabrechnung"; this.Font = new System.Drawing.Font("Verdana", 10F); @@ -801,8 +832,6 @@ namespace PerspektivenEV private DevExpress.XtraReports.UI.FormattingRule ruleRateFactorNull; private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1; private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1; - private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter; - private DevExpress.XtraReports.UI.GroupHeaderBand Page1; private DevExpress.XtraReports.UI.XRLabel xrLabel2; private DevExpress.XtraReports.UI.DetailReportBand DetailReport; private DevExpress.XtraReports.UI.DetailBand Detail1; @@ -842,7 +871,6 @@ namespace PerspektivenEV private DevExpress.XtraReports.UI.XRTableCell xrTableCell21; private DevExpress.XtraReports.UI.XRTableCell xrTableCell22; private DevExpress.XtraReports.UI.XRLabel lblHeader; - private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo2; private DevExpress.XtraReports.UI.XRTableCell xrTableCell33; private DevExpress.XtraReports.UI.XRTableCell xrTableCell30; @@ -851,5 +879,11 @@ namespace PerspektivenEV private DevExpress.XtraReports.UI.XRTableCell xrTableCell37; private DevExpress.XtraReports.UI.XRTableCell xrTableCell36; private DevExpress.XtraReports.UI.XRTableCell xrTableCell23; + private DevExpress.XtraReports.UI.DetailReportBand DetailReport1; + private DevExpress.XtraReports.UI.DetailBand Detail2; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader2; + private DevExpress.XtraReports.UI.CalculatedField fieldBetreuungsbeginn; + private DevExpress.XtraReports.UI.GroupHeaderBand GroupHeader1; + private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; } } diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs index 78c15afe9..cc2ea9896 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs @@ -7,7 +7,7 @@ using BS.Shared.Core; namespace PerspektivenEV { - [IDSpecificClass(Identifier = "Sammelrechnung")] + [IDSpecificClass(Identifier = "SammelrechnungAnhang")] public partial class SammelrechnungTab : XtraReport, IBeWoReport { public SammelrechnungTab() @@ -19,34 +19,24 @@ namespace PerspektivenEV { decimal totalPerMonth = 0; - pRO.ServiceInvoicePeriods.Sort((a, b) => a.Customer.LastNameFirstName.CompareTo(b.Customer.LastNameFirstName)); + //pRO.ServiceInvoicePeriods.Sort((a, b) => a.Customer.LastNameFirstName.CompareTo(b.Customer.LastNameFirstName)); DateTime abrechnungsMonatEnde = pRO.AccountingPeriodEnd; - if (pRO.ServiceInvoicePeriods != null) - { - foreach (var sip in pRO.ServiceInvoicePeriods) - { - if (sip.SupportConceptApprovalPeriod != null && sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue) - { - var month = sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value / 12m; - totalPerMonth += month; - } - if (sip.CostBearer2SupportConcept != null) - { - sip.SupportConceptApprovalPeriod.Notice = String.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}", - sip.CostBearer2SupportConcept.StartDate, pRO.AccountingPeriodEnd); - if (pRO.ServiceInvoicePeriods[0].CostBearer2SupportConcept.ServiceRecords[0].ServiceDescription.ServiceCategory.Name.Contains("HTK")) - lblHeader.Text = "Betreutes Wohnen für Menschen mit psychischer Erkrankung im Hochtaunuskreis"; - else if (pRO.ServiceInvoicePeriods[0].CostBearer2SupportConcept.ServiceRecords[0].ServiceDescription.ServiceCategory.Name.Contains("FFM")) - lblHeader.Text = "Betreutes Wohnen Frankfurt/M."; - else if (pRO.ServiceInvoicePeriods[0].CostBearer2SupportConcept.ServiceRecords[0].ServiceDescription.ServiceCategory.Name.Contains("Tagesstätte")) - lblHeader.Text = "Betreutes Wohnen für Menschen mit körperlicher-/ Sinnesbehinderung"; - } - } - } - cellTotalPerMonth.Text = String.Format("{0:0.00}", totalPerMonth); + if (pRO.ServiceInvoicePeriods != null) + { + foreach (var sip in pRO.ServiceInvoicePeriods) + { + if (sip.Notice.Contains("Hochtaunuskreis")) + lblHeader.Text = "Betreutes Wohnen für Menschen mit psychischer Erkrankung im Hochtaunuskreis"; + else if (sip.Notice.Contains("Frankfurt")) + lblHeader.Text = "Betreutes Wohnen Frankfurt/M."; + else if (sip.Notice.Contains("Körperbehinderte")) + lblHeader.Text = "Betreutes Wohnen für Menschen mit körperlicher-/ Sinnesbehinderung"; + } + } + cellTotalPerMonth.Text = String.Format("{0:0.00}", totalPerMonth); - this.bindingSource1.DataSource = pRO; + this.bindingSource1.DataSource = pRO; } } -} \ No newline at end of file +} diff --git a/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs b/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs index 160fef5f3..4752219a9 100644 --- a/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs +++ b/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs @@ -22,7 +22,60 @@ namespace PerspektivenEV.Invoicing private DateTime? accountingPeriodStart = null; private DateTime? accountingPeriodEnd = null; - public override List GenerateServiceInvoices(long costBearerOid, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords) + public override void SetInvoiceId(ServiceInvoice invoice) + { + invoice.InvoiceBase.InvoiceId = "Sammelrechnung"; + //invoice.InvoiceBase.InvoiceTypeText = "Text in Rechnungsübersicht"; + } + + //public override List GenerateServiceInvoices(long costBearerOid, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords) + //{ + // var newSc2SrList = new Dictionary>(); + + // foreach (var key in supportConcepts2ServiceRecords.Keys) + // { + // if (key.IsApproved) + // { + // newSc2SrList.Add(key, supportConcepts2ServiceRecords[key]); + // } + // } + + // List>> liste = new List>>(); + // liste.Add(new Dictionary>()); + // liste.Add(new Dictionary>()); + // liste.Add(new Dictionary>()); + + // foreach (var item in newSc2SrList) + // { + // if (item.Value.Count!= 0 && item.Value != null && item.Value[0].ServiceDescription.Category != null) + // { + // if (item.Value[0].ServiceDescription.Category.Name.Contains("HTK")) + // liste[0].Add(item.Key, item.Value); + // else if (item.Value[0].ServiceDescription.Category.Name.Contains("FFM")) + // liste[1].Add(item.Key, item.Value); + // else if (item.Value[0].ServiceDescription.Category.Name.Contains("Tagesstätte")) + // liste[2].Add(item.Key, item.Value); + // } + // } + + // var costBearer = DAOFactory.GenericDAO.LoadByID(costBearerOid); + // var invoiceList = new List(); + // var result = new List(); + // ServiceInvoice invoice; + + // foreach (var list in liste) + // { + // invoice = CreateCollectiveBilling(costBearer, invoicePeriod, list); + // if (invoice != null) + // invoiceList.Add(invoice); + + // result = invoiceList.Select(item => MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(item)).ToList(); + // } + + // return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result; + //} + + public override void SetCollectiveBillingServiceInvoicePeriods(ServiceInvoice invoice, DateTimeSpan invoicePeriod, Dictionary> supportConcepts2ServiceRecords) { var newSc2SrList = new Dictionary>(); @@ -34,41 +87,173 @@ namespace PerspektivenEV.Invoicing } } - List>> liste = new List>>(); - liste.Add(new Dictionary>()); - liste.Add(new Dictionary>()); - liste.Add(new Dictionary>()); + + Dictionary> cat2Daten = new Dictionary>(); + foreach (var item in newSc2SrList) { - if (item.Value.Count!= 0 && item.Value != null && item.Value[0].ServiceDescription.Category != null) + var c2s = DAOFactory.GenericDAO.LoadByID(item.Key.CostBearerRelOids[0]); + + foreach (var ap in c2s.ApprovalPeriodList) { - if (item.Value[0].ServiceDescription.Category.Name.Contains("HTK")) - liste[0].Add(item.Key, item.Value); - else if (item.Value[0].ServiceDescription.Category.Name.Contains("FFM")) - liste[1].Add(item.Key, item.Value); - else if (item.Value[0].ServiceDescription.Category.Name.Contains("Tagesstätte")) - liste[2].Add(item.Key, item.Value); + if (ap.EndDate >= invoicePeriod.StartDateTime && ap.StartDate <= invoicePeriod.EndDate && ap.ServiceCategory != null) + { + String key = ap.ServiceCategory.Name; + + if (!cat2Daten.ContainsKey(key)) + { + cat2Daten.Add(key, new List()); + } + + var daten = new Abrechnungsdaten(); + daten.CategoryName = key; + daten.AbrechnungsStartDate = invoicePeriod.StartDate; + daten.AbrechnungsEndDate = invoicePeriod.EndDate; + daten.CompactSupportConcept = item.Key; + daten.CostBearer2SupportConcept = c2s; + daten.SupportConceptApprovalPeriod = ap; + cat2Daten[key].Add(daten); + } + } } - var costBearer = DAOFactory.GenericDAO.LoadByID(costBearerOid); - var invoiceList = new List(); - var result = new List(); - ServiceInvoice invoice; - - foreach (var list in liste) + foreach (var categoryName in cat2Daten.Keys) { - invoice = CreateCollectiveBilling(costBearer, invoicePeriod, list); - if (invoice != null) - invoiceList.Add(invoice); + var datenListe = cat2Daten[categoryName]; - result = invoiceList.Select(item => MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(item)).ToList(); + var sip = ErstelleServiceInvoicePeriod(invoicePeriod, categoryName, datenListe); + + invoice.ServiceInvoicePeriodList.Add(sip); + + } - - return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result; } + private ServiceInvoicePeriod ErstelleServiceInvoicePeriod(DateTimeSpan invoicePeriod, String category, List datenListe) + { + var items = ErstelleInvoiceItems(datenListe); + + ServiceInvoicePeriod period = new ServiceInvoicePeriod(); + period.Start = invoicePeriod.StartDate; + period.End = invoicePeriod.EndDate; + + if (category.Contains("HTK")) + period.Notice = "Betreutes Wohnen im Hochtaunuskreis"; + else if (category.Contains("FFM")) + period.Notice = "Betreutes Wohnen Frankfurt/M."; + else if (category.Contains("Tagesstätte")) + period.Notice = "Betreutes Wohnen Körperbehinderte"; + else + period.Notice = category; + period.ApprovedHours = 0; + period.ApprovedBE = 0; + period.Claim = 0; + period.InvoiceItemList = items; + + foreach (var item in items) + { + period.ApprovedHours += item.UnitCount; + period.ApprovedBE = item.AmountPerUnit; + period.Claim += item.AmountTotal; + } + //period.ApprovedHours + + return period; + } + + private List ErstelleInvoiceItems(List datenListe) + { + var items = new List(); + foreach (var daten in datenListe) + { + var item = CreateInvoiceItem(daten); + if (item.AmountTotal > 0) + { + items.Add(item); + } + } + + + return items.OrderBy(i => i.ItemDescription).ToList(); + } + + private InvoiceItem CreateInvoiceItem(Abrechnungsdaten daten) + { + var calc = new CustomCalculations(); + + + DateTime start = daten.AbrechnungsStartDate; + DateTime end = daten.AbrechnungsEndDate; + + if (daten.SupportConceptApprovalPeriod.StartDate > start) + start = daten.SupportConceptApprovalPeriod.StartDate.Value; + + if (daten.SupportConceptApprovalPeriod.EndDate < end) + end = daten.SupportConceptApprovalPeriod.EndDate.Value; + + var monate = DateTimeUtils.GetTotalMonths(start, end); + + var c2sDc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(daten.CostBearer2SupportConcept); + var scapDc = MapperFactory.SupportConceptApprovalPeriodDC_SupportConceptApprovalPeriod.MapToNewDC(daten.SupportConceptApprovalPeriod); + + var stundenProMonat = calc.GetApprovedHoursForPeriod(c2sDc, scapDc, null, new DateTime(start.Year, start.Month, 1), new DateTime(start.Year, start.Month, 1).AddMonths(1).AddDays(-1), false) ?? 0; + + var abrechnungsMonate = monate.GanzeMonate * stundenProMonat; + if (monate.RestTageAnfang > 0) + { + if (start.Day > 15) + abrechnungsMonate += stundenProMonat / 2; + + else if (start.Day > 1) + abrechnungsMonate += stundenProMonat; + } + if (monate.RestTageEnde > 0) + { + if (end.Day > 15) + abrechnungsMonate += stundenProMonat; + else + abrechnungsMonate += stundenProMonat / 2; + } + + + abrechnungsMonate = Math.Round(abrechnungsMonate, 2, MidpointRounding.AwayFromZero); + decimal hourlyRate = 0; + + if (accountingPeriodStart.HasValue) + { + var crp = c2sDc.CostBearer.CostRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.HourlyRate, + accountingPeriodStart.Value); + + if (crp != null && crp.CostRateValue.HasValue) + hourlyRate = crp.CostRateValue.Value; + } + + String customerName = daten.CompactSupportConcept.CustomerName; + String aktenzeichen = daten.CostBearer2SupportConcept.CustomerReferenceNumber; + DateTime? bewilligtBis = daten.CompactSupportConcept.EndDate; + DateTime beginn = daten.CostBearer2SupportConcept.SupportConcept.Customer.AssistanceBegin ?? DateTime.MinValue; + decimal jahreskontingent = calc.GetJahreskontingent(scapDc); + + var ii = new InvoiceItem + { + ItemPeriodStart = beginn, + ItemPeriodEnd = bewilligtBis, + AccountingInterval = AccountingIntervalType.Monthly, + AmountPerUnit = hourlyRate, + UnitCount = abrechnungsMonate, + ItemDescription = customerName, + UnitDescription = String.Format("{0:0.##}", jahreskontingent), + Notice = aktenzeichen, + MaxApprovedUnitCount = jahreskontingent + }; + + ii.AmountTotal = ii.UnitCount * ii.AmountPerUnit; + ii.GrossAmountTotal = ii.AmountTotal; + + return ii; + } public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod, IList supportConceptList) @@ -81,12 +266,7 @@ namespace PerspektivenEV.Invoicing base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList); } - public override void SetInvoiceItems(ServiceInvoice invoice, ServiceInvoicePeriod serviceInvoicePeriod, - SupportConceptApprovalPeriodDC supportConceptApprovalPeriod, CostBearer2SupportConcept cb2sc, - DateTimeSpan invoicePeriod, List serviceRecords) - { - CreateFixedAmounts(serviceInvoicePeriod, supportConceptApprovalPeriod, cb2sc); - } + public override void CreateFixedAmounts(ServiceInvoicePeriod serviceInvoicePeriod, SupportConceptApprovalPeriodDC scap, CostBearer2SupportConcept cb2sc) { @@ -150,10 +330,19 @@ namespace PerspektivenEV.Invoicing } - public override IList CreateInvoiceItems(List serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, - Calculations calc) - { - return base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc); - } + } + + public class Abrechnungsdaten + { + public String CategoryName { get; set; } + + public CompactSupportConceptDC CompactSupportConcept { get; set; } + + public CostBearer2SupportConcept CostBearer2SupportConcept { get; set; } + + public SupportConceptApprovalPeriod SupportConceptApprovalPeriod { get; set; } + public DateTime AbrechnungsStartDate { get; internal set; } + + public DateTime AbrechnungsEndDate { get; internal set; } } } diff --git a/ReportImp/PerspektivenEV/Invoicing/SelbstzahlerInvoiceCreation.cs b/ReportImp/PerspektivenEV/Invoicing/SelbstzahlerInvoiceCreation.cs index 23e34d6b5..ae68ecc08 100644 --- a/ReportImp/PerspektivenEV/Invoicing/SelbstzahlerInvoiceCreation.cs +++ b/ReportImp/PerspektivenEV/Invoicing/SelbstzahlerInvoiceCreation.cs @@ -18,6 +18,11 @@ namespace PerspektivenEV.Invoicing private DateTime? accountingPeriodStart = null; private DateTime? accountingPeriodEnd = null; + public override void SetInvoiceId(ServiceInvoice invoice) + { + invoice.InvoiceBase.InvoiceId = "Selbstzahler"; + //invoice.InvoiceBase.InvoiceTypeText = "Text in Rechnungsübersicht"; + } public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod, IList supportConceptList) diff --git a/ReportImp/PerspektivenEV/PerspektivenEV.csproj b/ReportImp/PerspektivenEV/PerspektivenEV.csproj index ee0fa56a1..b911b8bf5 100644 --- a/ReportImp/PerspektivenEV/PerspektivenEV.csproj +++ b/ReportImp/PerspektivenEV/PerspektivenEV.csproj @@ -48,6 +48,13 @@ + + Component + + + CollectiveBillingReport.cs + + @@ -87,6 +94,9 @@ + + CollectiveBillingReport.cs + CollectiveBillingReportTab.cs diff --git a/ReportImp/PerspektivenEV/Service/CustomCalculations.cs b/ReportImp/PerspektivenEV/Service/CustomCalculations.cs index 3d15d496c..7a5677fe4 100644 --- a/ReportImp/PerspektivenEV/Service/CustomCalculations.cs +++ b/ReportImp/PerspektivenEV/Service/CustomCalculations.cs @@ -146,6 +146,30 @@ namespace PerspektivenEV.Service return flsProWoche * 4.34m; } + public decimal GetJahreskontingent(SupportConceptApprovalPeriodDC scap) + { + if (scap.ApprovedBEInterval.HasValue && scap.ApprovedBEPerInterval.HasValue) + { + if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly) + { + return scap.ApprovedBEPerInterval.Value * 12; + } + else if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Quarterly) + { + return scap.ApprovedBEPerInterval.Value * 4; + } + else if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.HalfYearly) + { + return scap.ApprovedBEPerInterval.Value * 2; + } + else if (scap.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Yearly) + { + return scap.ApprovedBEPerInterval.Value; + } + } + + return 0; + } } diff --git a/ReportImp/PerspektivenEV/ServiceInvoiceReport.cs b/ReportImp/PerspektivenEV/ServiceInvoiceReport.cs index 7e02b1e9b..703f5a381 100644 --- a/ReportImp/PerspektivenEV/ServiceInvoiceReport.cs +++ b/ReportImp/PerspektivenEV/ServiceInvoiceReport.cs @@ -2,10 +2,12 @@ using System; using System.Text; using BeWo.Report; using BeWo.Report.ReportObjects; +using BS.Shared.Core; using DevExpress.XtraReports.UI; namespace PerspektivenEV { + [IDSpecificClass(Identifier = "Selbstzahler")] public partial class ServiceInvoiceReport : XtraReport, IBeWoReport { public ServiceInvoiceReport() diff --git a/ReportImp/VkmMenden/AllgemeineRechnung.Designer.cs b/ReportImp/VkmMenden/AllgemeineRechnung.Designer.cs index f037b5111..f926bf1e5 100644 --- a/ReportImp/VkmMenden/AllgemeineRechnung.Designer.cs +++ b/ReportImp/VkmMenden/AllgemeineRechnung.Designer.cs @@ -383,7 +383,7 @@ namespace VkmMenden this.xrTableCell21.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrTableCell21.StylePriority.UsePadding = false; this.xrTableCell21.StylePriority.UseTextAlignment = false; - this.xrTableCell21.Text = "marc.brumberg@vkm-menden.de"; + this.xrTableCell21.Text = "kolja.kuepper@vkm-menden.de"; this.xrTableCell21.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; this.xrTableCell21.Weight = 0.31012402011277251D; // diff --git a/ReportImp/VkmMenden/AllgemeineRechnung.resx b/ReportImp/VkmMenden/AllgemeineRechnung.resx index 737ac4f61..4059f4062 100644 --- a/ReportImp/VkmMenden/AllgemeineRechnung.resx +++ b/ReportImp/VkmMenden/AllgemeineRechnung.resx @@ -3314,7 +3314,7 @@ ewBcAHIAdABmADEAXABkAGUAZgBmADAAewBcAGYAbwBuAHQAdABiAGwAewBcAGYAMAAgAEMAYQBsAGkAYgByAGkAOwB9AHsAXABmADEAIABUAGkAbQBlAHMAIABOAGUAdwAgAFIAbwBtAGEAbgA7AH0AewBcAGYAMgAgAFQAYQBoAG8AbQBhADsAfQB9AHsAXABjAG8AbABvAHIAdABiAGwAIAA7AFwAcgBlAGQAMABcAGcAcgBlAGUAbgAwAFwAYgBsAHUAZQAwACAAOwBcAHIAZQBkADAAXABnAHIAZQBlAG4AMABcAGIAbAB1AGUAMgA1ADUAIAA7AH0AewBcACoAXABkAGUAZgBjAGgAcAAgAFwAZgAxAFwAZgBzADIANAB9AHsAXABzAHQAeQBsAGUAcwBoAGUAZQB0ACAAewBcAHEAbABcAGYAMQBcAGYAcwAyADQAIABOAG8AcgBtAGEAbAA7AH0AewBcAHMAMQBcAHMAYgBhAHMAZQBkAG8AbgAwAFwAcwBuAGUAeAB0ADEAXABxAGwAXAB0AHEAYwBcAHQAeAA0ADUAMwA2AFwAdABxAHIAXAB0AHgAOQ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GEAaQBuAFwAcQBjAFwAdQBsAFwAZgAyAFwAZgBzADEANABcAGMAZgAxAFwAcABhAHIAXABwAGEAcgBkAFwAcABsAGEAaQBuAFwAcQBjAHsAXABmADIAXABmAHMAMQA0AFwAYwBmADEAIABNAGEAcgBpAGUALQBFAGwAbABlAG4AIABLAHIAYQB1AHMAZQB9AFwAYgBcAGYAMgBcAGYAcwAxADQAXABjAGYAMQBcAHAAYQByAFwAcABhAHIAZABcAHAAbABhAGkAbgBcAHEAYwBcAGIAXABmADIAXABmAHMAMQA0AFwAYwBmADEAXABwAGEAcgBcAHAAYQByAGQAXABwAGwAYQBpAG4AXABxAGMAewBcAGwAYQBuAGcAMQAwADMAMQBcAGwAYQBuAGcAZgBlADEAMAAzADEAXABmADIAXABmAHMAMQA0AFwAYwBmADEAIABDAFwAdQAyADMAMwBcACcAZQA5AHMAYQByACAAQwBhAHIAdABhAGcAZQBuAGEAfQBcAGwAYQBuAGcAMQAwADMAMQBcAGwAYQBuAGcAZgBlADEAMAAzADEAXABmAHMAMgAwAFwAYwBmADEAXABwAGEAcgB9AA== 17, 17 From 3c4992198558db9ce8eca4b7245ff3061c2fa8f1 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 9 May 2022 16:06:31 +0200 Subject: [PATCH 2/2] GrundsteinEV und PerspektivenEV --- ReportImp/GrundsteinEV/CustomReportCreator.cs | 8 +- .../Quittierungsbeleg.Designer.cs | 2 +- ReportImp/GrundsteinEV/Quittierungsbeleg.cs | 16 +- .../QuittierungsbelegMitHandzeichen.cs | 21 +- .../ServiceInvoiceReport.Designer.cs | 29 ++- .../GrundsteinEV/ServiceInvoiceReport.cs | 26 ++ .../CollectiveBillingReport.Designer.cs | 223 +++++++++--------- .../PerspektivenEV/CollectiveBillingReport.cs | 6 + .../CollectiveBillingReportTab.Designer.cs | 158 +++++++------ .../CollectiveBillingReportTab.cs | 10 +- .../PerspektivenEV/CustomReportCreator.cs | 71 ++++++ .../Invoicing/CollectiveInvoiceCreation.cs | 18 +- 12 files changed, 344 insertions(+), 244 deletions(-) create mode 100644 ReportImp/PerspektivenEV/CustomReportCreator.cs diff --git a/ReportImp/GrundsteinEV/CustomReportCreator.cs b/ReportImp/GrundsteinEV/CustomReportCreator.cs index 5433a78be..54dc4ec1e 100644 --- a/ReportImp/GrundsteinEV/CustomReportCreator.cs +++ b/ReportImp/GrundsteinEV/CustomReportCreator.cs @@ -134,9 +134,13 @@ namespace GrundsteinEV foreach (var ap in c2s.ApprovalPeriodList) { - if (ap.ApprovedBEPerInterval.HasValue) + if (ap.ApprovedBETotal.HasValue) { - ro.ApprovedFLSTotal = ap.ApprovedBETotal.Value; + ro.ApprovedFLSPerWeekTotal = ap.ApprovedBETotal.Value; + } + else if (ap.ApprovedBEPerInterval.HasValue) + { + ro.ApprovedFLSPerWeekTotal = ap.ApprovedBEPerInterval.Value; } } } diff --git a/ReportImp/GrundsteinEV/Quittierungsbeleg.Designer.cs b/ReportImp/GrundsteinEV/Quittierungsbeleg.Designer.cs index aaf6f3934..5d97cbc1e 100644 --- a/ReportImp/GrundsteinEV/Quittierungsbeleg.Designer.cs +++ b/ReportImp/GrundsteinEV/Quittierungsbeleg.Designer.cs @@ -184,7 +184,7 @@ namespace GrundsteinEV // xrTableCell2 // this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "Services.FLSQualifiedString")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "Services.FLSQualifiedString", "{0:#.00}")}); this.xrTableCell2.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.xrTableCell2.Name = "xrTableCell2"; this.xrTableCell2.StylePriority.UseFont = false; diff --git a/ReportImp/GrundsteinEV/Quittierungsbeleg.cs b/ReportImp/GrundsteinEV/Quittierungsbeleg.cs index 45afdb5ff..77f0f328c 100644 --- a/ReportImp/GrundsteinEV/Quittierungsbeleg.cs +++ b/ReportImp/GrundsteinEV/Quittierungsbeleg.cs @@ -37,20 +37,24 @@ namespace GrundsteinEV //sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount); hatGruppen = true; } + if (sd.Minutes == 0) + sd.FLSQualifiedString = ""; + else + { + sd.FLSQualifiedString = String.Format("{0:0.##}", sd.Minutes); + pRO.TotalFLMQualified += sd.Minutes; + } + servicesBillable.Add(sd); } - if (sd.Minutes == 0) + else if (sd.Minutes == 0) { sd.StartDateString = ""; sd.FLSQualifiedString = ""; servicesBillable.Add(sd); } - else - { - sd.FLSQualifiedString = String.Format("{0:0.##}", sd.Minutes); - pRO.TotalFLMQualified += sd.Minutes; - } + } if (pRO.TotalFLMQualified != 0) pRO.TotalFLMQualifiedString = String.Format("{0:0.##}", pRO.TotalFLMQualified); diff --git a/ReportImp/GrundsteinEV/QuittierungsbelegMitHandzeichen.cs b/ReportImp/GrundsteinEV/QuittierungsbelegMitHandzeichen.cs index 5215f3ceb..191082e99 100644 --- a/ReportImp/GrundsteinEV/QuittierungsbelegMitHandzeichen.cs +++ b/ReportImp/GrundsteinEV/QuittierungsbelegMitHandzeichen.cs @@ -35,31 +35,32 @@ namespace GrundsteinEV { hatGruppen = true; } + if (sd.Minutes == 0) + sd.FLSQualifiedString = ""; + else + { + sd.FLSQualifiedString = String.Format("{0:0.##}", sd.Minutes); + pRO.TotalFLMQualified += sd.Minutes; + } + servicesBillable.Add(sd); } - if (sd.Minutes == 0) + else if (sd.Minutes == 0) { sd.StartDateString = ""; sd.FLSQualifiedString = ""; servicesBillable.Add(sd); } - else - { - sd.FLSQualifiedString = String.Format("{0:0.##}", sd.Minutes); - pRO.TotalFLMQualified += sd.Minutes; - } - } + } if (pRO.TotalFLMQualified != 0) pRO.TotalFLMQualifiedString = String.Format("{0:0.##}", pRO.TotalFLMQualified); - else pRO.TotalFLMQualifiedString = ""; - pRO.Services = servicesBillable; } - + bindingSource1.DataSource = pRO; } diff --git a/ReportImp/GrundsteinEV/ServiceInvoiceReport.Designer.cs b/ReportImp/GrundsteinEV/ServiceInvoiceReport.Designer.cs index 6ad6c5bfe..7f2c76f12 100644 --- a/ReportImp/GrundsteinEV/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/GrundsteinEV/ServiceInvoiceReport.Designer.cs @@ -50,7 +50,7 @@ namespace GrundsteinEV this.xrLabel11 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel7 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblAdresse = new DevExpress.XtraReports.UI.XRLabel(); this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); this.xrTable5 = new DevExpress.XtraReports.UI.XRTable(); @@ -128,7 +128,7 @@ namespace GrundsteinEV this.xrLabel11, this.xrLabel10, this.xrLabel6, - this.xrLabel7}); + this.lblAdresse}); this.Page1.Font = new System.Drawing.Font("Verdana", 10F); this.Page1.HeightF = 473.115F; this.Page1.Name = "Page1"; @@ -327,19 +327,18 @@ namespace GrundsteinEV this.xrLabel6.Text = "Telefon: 05222/40951\r\nTelefax: 05222/960873\r\nEmail: info@verein-grundstein.de\r\nFr" + "au Brokmeier / Frau Wasko"; // - // xrLabel7 + // lblAdresse // - this.xrLabel7.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrLabel7.Font = new System.Drawing.Font("Verdana", 10F); - this.xrLabel7.LocationFloat = new DevExpress.Utils.PointFloat(0F, 118.1667F); - this.xrLabel7.Multiline = true; - this.xrLabel7.Name = "xrLabel7"; - this.xrLabel7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel7.SizeF = new System.Drawing.SizeF(317F, 70F); - this.xrLabel7.StylePriority.UseBorders = false; - this.xrLabel7.StylePriority.UseFont = false; - this.xrLabel7.Text = "[RecipientOrganisation]\r\n[RecipientContactPerson]\r\n[RecipientDivision]\r\n[Recipien" + - "tStreet]\r\n"; + this.lblAdresse.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.lblAdresse.Font = new System.Drawing.Font("Verdana", 10F); + this.lblAdresse.LocationFloat = new DevExpress.Utils.PointFloat(0F, 118.1667F); + this.lblAdresse.Multiline = true; + this.lblAdresse.Name = "lblAdresse"; + this.lblAdresse.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblAdresse.SizeF = new System.Drawing.SizeF(317F, 70F); + this.lblAdresse.StylePriority.UseBorders = false; + this.lblAdresse.StylePriority.UseFont = false; + this.lblAdresse.Text = "\r\n"; // // DetailReport // @@ -697,7 +696,7 @@ namespace GrundsteinEV private DevExpress.XtraReports.UI.XRTableCell xrTableCell44; private DevExpress.XtraReports.UI.XRTableCell xrTableCell45; private DevExpress.XtraReports.UI.XRTableCell xrTableCell47; - private DevExpress.XtraReports.UI.XRLabel xrLabel7; + private DevExpress.XtraReports.UI.XRLabel lblAdresse; private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; private DevExpress.XtraReports.UI.XRLabel xrLabel6; private DevExpress.XtraReports.UI.XRLabel xrLabel10; diff --git a/ReportImp/GrundsteinEV/ServiceInvoiceReport.cs b/ReportImp/GrundsteinEV/ServiceInvoiceReport.cs index 9d29b72f0..170f73d69 100644 --- a/ReportImp/GrundsteinEV/ServiceInvoiceReport.cs +++ b/ReportImp/GrundsteinEV/ServiceInvoiceReport.cs @@ -1,4 +1,5 @@ using System; +using System.Text; using BeWo.Report; using BeWo.Report.ReportObjects; @@ -15,6 +16,31 @@ namespace GrundsteinEV public void SetReportDataSource(ServiceInvoiceRO pRO) { + StringBuilder sb = new StringBuilder(); + + if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1) && !String.IsNullOrEmpty(pRO.RecipientAddressLine1.Trim()) && pRO.RecipientOrganisation.Contains(pRO.CustomerLastName)) + { + sb.AppendLine(pRO.RecipientAddressLine1); + } + else if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && !String.IsNullOrEmpty(pRO.RecipientOrganisation.Trim())) + { + sb.AppendLine(pRO.RecipientOrganisation); + } + if (!String.IsNullOrEmpty(pRO.RecipientContactPerson) && !String.IsNullOrEmpty(pRO.RecipientContactPerson.Trim())) + { + sb.AppendLine(pRO.RecipientContactPerson); + } + if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientDivision.Trim())) + { + sb.AppendLine(pRO.RecipientDivision); + } + if (!String.IsNullOrEmpty(pRO.RecipientStreet) && !String.IsNullOrEmpty(pRO.RecipientStreet.Trim())) + { + sb.AppendLine(pRO.RecipientStreet); + } + + lblAdresse.Text = sb.ToString(); + this.bindingSource1.DataSource = pRO; } } diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs b/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs index cb024ed67..47aceec5c 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReport.Designer.cs @@ -48,6 +48,13 @@ namespace PerspektivenEV this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); + this.xrTable6 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow25 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell42 = new DevExpress.XtraReports.UI.XRTableCell(); + this.lblHourlyRate = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell45 = new DevExpress.XtraReports.UI.XRTableCell(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.xrTable5 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow23 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -59,23 +66,16 @@ namespace PerspektivenEV this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell8 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTable6 = new DevExpress.XtraReports.UI.XRTable(); - this.xrTableRow25 = new DevExpress.XtraReports.UI.XRTableRow(); - this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell42 = new DevExpress.XtraReports.UI.XRTableCell(); - this.lblHourlyRate = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell45 = new DevExpress.XtraReports.UI.XRTableCell(); + this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow6 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell3 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); - this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); - ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); @@ -281,6 +281,101 @@ namespace PerspektivenEV this.Detail1.Name = "Detail1"; this.Detail1.StylePriority.UseFont = false; // + // xrTable6 + // + this.xrTable6.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrTable6.Name = "xrTable6"; + this.xrTable6.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow25}); + this.xrTable6.SizeF = new System.Drawing.SizeF(631F, 25F); + this.xrTable6.StylePriority.UseFont = false; + // + // xrTableRow25 + // + this.xrTableRow25.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell2, + this.xrTableCell42, + this.lblHourlyRate, + this.xrTableCell45}); + this.xrTableRow25.Name = "xrTableRow25"; + this.xrTableRow25.Weight = 1D; + // + // xrTableCell2 + // + this.xrTableCell2.BorderColor = System.Drawing.Color.DarkGray; + this.xrTableCell2.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedHours", "{0:n2}")}); + this.xrTableCell2.Font = new System.Drawing.Font("Calibri", 11F); + this.xrTableCell2.Name = "xrTableCell2"; + this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); + this.xrTableCell2.StylePriority.UseBorderColor = false; + this.xrTableCell2.StylePriority.UseBorders = false; + this.xrTableCell2.StylePriority.UseFont = false; + this.xrTableCell2.StylePriority.UsePadding = false; + this.xrTableCell2.StylePriority.UseTextAlignment = false; + this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell2.Weight = 0.57356212115408312D; + // + // xrTableCell42 + // + this.xrTableCell42.BorderColor = System.Drawing.Color.DarkGray; + this.xrTableCell42.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.xrTableCell42.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Notice")}); + this.xrTableCell42.Font = new System.Drawing.Font("Calibri", 11F); + this.xrTableCell42.Name = "xrTableCell42"; + this.xrTableCell42.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); + this.xrTableCell42.StylePriority.UseBorderColor = false; + this.xrTableCell42.StylePriority.UseBorders = false; + this.xrTableCell42.StylePriority.UseFont = false; + this.xrTableCell42.StylePriority.UsePadding = false; + this.xrTableCell42.StylePriority.UseTextAlignment = false; + this.xrTableCell42.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrTableCell42.Weight = 1.2396351551486897D; + // + // lblHourlyRate + // + this.lblHourlyRate.BorderColor = System.Drawing.Color.DarkGray; + this.lblHourlyRate.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.lblHourlyRate.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedBE", "{0:0.00} €")}); + this.lblHourlyRate.Font = new System.Drawing.Font("Calibri", 11F); + this.lblHourlyRate.Name = "lblHourlyRate"; + this.lblHourlyRate.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); + this.lblHourlyRate.StylePriority.UseBorderColor = false; + this.lblHourlyRate.StylePriority.UseBorders = false; + this.lblHourlyRate.StylePriority.UseFont = false; + this.lblHourlyRate.StylePriority.UsePadding = false; + this.lblHourlyRate.StylePriority.UseTextAlignment = false; + this.lblHourlyRate.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.lblHourlyRate.Weight = 0.48943381421226906D; + // + // xrTableCell45 + // + this.xrTableCell45.BorderColor = System.Drawing.Color.DarkGray; + this.xrTableCell45.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.xrTableCell45.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Claim", "{0:0.00}")}); + this.xrTableCell45.Font = new System.Drawing.Font("Calibri", 11F); + this.xrTableCell45.Name = "xrTableCell45"; + this.xrTableCell45.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); + this.xrTableCell45.StylePriority.UseBorderColor = false; + this.xrTableCell45.StylePriority.UseBorders = false; + this.xrTableCell45.StylePriority.UseFont = false; + this.xrTableCell45.StylePriority.UsePadding = false; + this.xrTableCell45.StylePriority.UseTextAlignment = false; + this.xrTableCell45.Text = "xrTableCell45"; + this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.xrTableCell45.Weight = 0.71650711360086339D; + // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable5}); + this.GroupHeader1.HeightF = 50F; + this.GroupHeader1.Name = "GroupHeader1"; + // // xrTable5 // this.xrTable5.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); @@ -436,93 +531,13 @@ namespace PerspektivenEV this.xrTableCell8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell8.Weight = 0.71650711871826434D; // - // xrTable6 + // GroupFooter2 // - this.xrTable6.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.xrTable6.Name = "xrTable6"; - this.xrTable6.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.xrTableRow25}); - this.xrTable6.SizeF = new System.Drawing.SizeF(631F, 25F); - this.xrTable6.StylePriority.UseFont = false; - // - // xrTableRow25 - // - this.xrTableRow25.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell2, - this.xrTableCell42, - this.lblHourlyRate, - this.xrTableCell45}); - this.xrTableRow25.Name = "xrTableRow25"; - this.xrTableRow25.Weight = 1D; - // - // xrTableCell2 - // - this.xrTableCell2.BorderColor = System.Drawing.Color.DarkGray; - this.xrTableCell2.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedHours", "{0:n2}")}); - this.xrTableCell2.Font = new System.Drawing.Font("Calibri", 11F); - this.xrTableCell2.Name = "xrTableCell2"; - this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); - this.xrTableCell2.StylePriority.UseBorderColor = false; - this.xrTableCell2.StylePriority.UseBorders = false; - this.xrTableCell2.StylePriority.UseFont = false; - this.xrTableCell2.StylePriority.UsePadding = false; - this.xrTableCell2.StylePriority.UseTextAlignment = false; - this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.xrTableCell2.Weight = 0.57356212115408312D; - // - // xrTableCell42 - // - this.xrTableCell42.BorderColor = System.Drawing.Color.DarkGray; - this.xrTableCell42.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrTableCell42.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Notice")}); - this.xrTableCell42.Font = new System.Drawing.Font("Calibri", 11F); - this.xrTableCell42.Name = "xrTableCell42"; - this.xrTableCell42.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); - this.xrTableCell42.StylePriority.UseBorderColor = false; - this.xrTableCell42.StylePriority.UseBorders = false; - this.xrTableCell42.StylePriority.UseFont = false; - this.xrTableCell42.StylePriority.UsePadding = false; - this.xrTableCell42.StylePriority.UseTextAlignment = false; - this.xrTableCell42.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.xrTableCell42.Weight = 1.2396351551486897D; - // - // lblHourlyRate - // - this.lblHourlyRate.BorderColor = System.Drawing.Color.DarkGray; - this.lblHourlyRate.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.lblHourlyRate.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedBE", "{0:0.00} €")}); - this.lblHourlyRate.Font = new System.Drawing.Font("Calibri", 11F); - this.lblHourlyRate.Name = "lblHourlyRate"; - this.lblHourlyRate.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); - this.lblHourlyRate.StylePriority.UseBorderColor = false; - this.lblHourlyRate.StylePriority.UseBorders = false; - this.lblHourlyRate.StylePriority.UseFont = false; - this.lblHourlyRate.StylePriority.UsePadding = false; - this.lblHourlyRate.StylePriority.UseTextAlignment = false; - this.lblHourlyRate.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.lblHourlyRate.Weight = 0.48943381421226906D; - // - // xrTableCell45 - // - this.xrTableCell45.BorderColor = System.Drawing.Color.DarkGray; - this.xrTableCell45.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrTableCell45.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Claim", "{0:0.00}")}); - this.xrTableCell45.Font = new System.Drawing.Font("Calibri", 11F); - this.xrTableCell45.Name = "xrTableCell45"; - this.xrTableCell45.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 2, 2, 100F); - this.xrTableCell45.StylePriority.UseBorderColor = false; - this.xrTableCell45.StylePriority.UseBorders = false; - this.xrTableCell45.StylePriority.UseFont = false; - this.xrTableCell45.StylePriority.UsePadding = false; - this.xrTableCell45.StylePriority.UseTextAlignment = false; - this.xrTableCell45.Text = "xrTableCell45"; - this.xrTableCell45.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell45.Weight = 0.71650711360086339D; + this.GroupFooter2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel5, + this.xrTable1}); + this.GroupFooter2.HeightF = 100F; + this.GroupFooter2.Name = "GroupFooter2"; // // xrLabel5 // @@ -574,7 +589,6 @@ namespace PerspektivenEV this.xrTableCell3.StylePriority.UseFont = false; this.xrTableCell3.StylePriority.UsePadding = false; this.xrTableCell3.StylePriority.UseTextAlignment = false; - this.xrTableCell3.Text = "SUMME:"; this.xrTableCell3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; this.xrTableCell3.Weight = 1.8131973371050596D; // @@ -613,21 +627,6 @@ namespace PerspektivenEV this.xrTableCell11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell11.Weight = 0.71650725326721421D; // - // GroupHeader1 - // - this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable5}); - this.GroupHeader1.HeightF = 50F; - this.GroupHeader1.Name = "GroupHeader1"; - // - // GroupFooter2 - // - this.GroupFooter2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrLabel5, - this.xrTable1}); - this.GroupFooter2.HeightF = 100F; - this.GroupFooter2.Name = "GroupFooter2"; - // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); @@ -655,8 +654,8 @@ namespace PerspektivenEV this.Version = "17.1"; this.Watermark.Image = ((System.Drawing.Image)(resources.GetObject("Sammelrechnung.Watermark.Image"))); this.Watermark.PageRange = "1"; - ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReport.cs b/ReportImp/PerspektivenEV/CollectiveBillingReport.cs index 543524e47..12e235d90 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReport.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReport.cs @@ -51,6 +51,12 @@ namespace PerspektivenEV lblAdresse.Text = sb.ToString(); lblHourlyRate.Text = pRO.ServiceInvoicePeriods[0].ServiceInvoiceItems[0].HourlyRate.ToString(); + foreach (var sip in pRO.ServiceInvoicePeriods) + { + sip.ApprovedBE = sip.ApprovedBE.Replace("(", ""); + sip.ApprovedBE = sip.ApprovedBE.Replace(" FLS)", ""); + } + this.bindingSource1.DataSource = pRO; } } diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs index dfdf6f021..b4c7c591d 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.Designer.cs @@ -76,6 +76,11 @@ namespace PerspektivenEV this.xrTableCell20 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell21 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell22 = new DevExpress.XtraReports.UI.XRTableCell(); + this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.lblHeader = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); + this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -84,13 +89,8 @@ namespace PerspektivenEV this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); this.ruleNoticeNull = new DevExpress.XtraReports.UI.FormattingRule(); - this.lblHeader = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); this.fieldMonatskontingent = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldBetreuungsbeginn = new DevExpress.XtraReports.UI.CalculatedField(); - this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); @@ -173,6 +173,7 @@ namespace PerspektivenEV this.DetailReport1.DataSource = this.bindingSource1; this.DetailReport1.Level = 0; this.DetailReport1.Name = "DetailReport1"; + this.DetailReport1.PageBreak = DevExpress.XtraReports.UI.PageBreak.BeforeBandExceptFirstEntry; // // Detail2 // @@ -278,7 +279,7 @@ namespace PerspektivenEV this.xrTableCell3.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Customer.AssistanceBegin")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ServiceInvoiceItems.fieldBetreuungsbeginn", "{0:dd.MM.yyyy}")}); this.xrTableCell3.Font = new System.Drawing.Font("Arial", 8F); this.xrTableCell3.Name = "xrTableCell3"; this.xrTableCell3.StylePriority.UseBorders = false; @@ -600,6 +601,80 @@ namespace PerspektivenEV this.xrTableCell22.StylePriority.UseBorders = false; this.xrTableCell22.Weight = 0.33118914272283523D; // + // GroupHeader1 + // + this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.lblHeader, + this.xrLabel3, + this.xrLabel2}); + this.GroupHeader1.HeightF = 75F; + this.GroupHeader1.Level = 1; + this.GroupHeader1.Name = "GroupHeader1"; + this.GroupHeader1.PageBreak = DevExpress.XtraReports.UI.PageBreak.BeforeBandExceptFirstEntry; + // + // lblHeader + // + this.lblHeader.BackColor = System.Drawing.Color.Transparent; + this.lblHeader.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.lblHeader.CanShrink = true; + this.lblHeader.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Notice")}); + this.lblHeader.Font = new System.Drawing.Font("Arial", 9F); + this.lblHeader.LocationFloat = new DevExpress.Utils.PointFloat(408.8752F, 10.00001F); + this.lblHeader.Multiline = true; + this.lblHeader.Name = "lblHeader"; + this.lblHeader.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblHeader.SizeF = new System.Drawing.SizeF(355.8332F, 39.99999F); + this.lblHeader.StylePriority.UseBackColor = false; + this.lblHeader.StylePriority.UseBorders = false; + this.lblHeader.StylePriority.UseFont = false; + this.lblHeader.StylePriority.UseTextAlignment = false; + this.lblHeader.Text = "Betreutes Wohnen "; + this.lblHeader.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; + // + // xrLabel3 + // + this.xrLabel3.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.xrLabel3.Font = new System.Drawing.Font("Arial", 9F); + this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(938.0004F, 10.00001F); + this.xrLabel3.Name = "xrLabel3"; + this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel3.SizeF = new System.Drawing.SizeF(130.4999F, 25F); + this.xrLabel3.StylePriority.UseBackColor = false; + this.xrLabel3.StylePriority.UseBorders = false; + this.xrLabel3.StylePriority.UseFont = false; + this.xrLabel3.StylePriority.UseForeColor = false; + this.xrLabel3.StylePriority.UseTextAlignment = false; + this.xrLabel3.Text = " [InvoiceBase.AccountingPeriodEnd!MMMM yyyy]"; + this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; + this.xrLabel3.WordWrap = false; + // + // xrLabel2 + // + this.xrLabel2.BackColor = System.Drawing.Color.Transparent; + this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.xrLabel2.Font = new System.Drawing.Font("Arial", 9F); + this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10.00001F); + this.xrLabel2.Multiline = true; + this.xrLabel2.Name = "xrLabel2"; + this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(254.5001F, 39.99999F); + this.xrLabel2.StylePriority.UseBackColor = false; + this.xrLabel2.StylePriority.UseBorders = false; + this.xrLabel2.StylePriority.UseFont = false; + this.xrLabel2.StylePriority.UseTextAlignment = false; + this.xrLabel2.Text = "Perspektiven e.V.\r\nAlberusstraße 5, 61440 Oberursel"; + this.xrLabel2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.xrLabel2.WordWrap = false; + // + // GroupFooter1 + // + this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrTable1}); + this.GroupFooter1.HeightF = 18F; + this.GroupFooter1.Name = "GroupFooter1"; + this.GroupFooter1.PageBreak = DevExpress.XtraReports.UI.PageBreak.AfterBandExceptLastEntry; + // // xrTable1 // this.xrTable1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); @@ -704,59 +779,6 @@ namespace PerspektivenEV this.ruleNoticeNull.Formatting.Visible = DevExpress.Utils.DefaultBoolean.False; this.ruleNoticeNull.Name = "ruleNoticeNull"; // - // lblHeader - // - this.lblHeader.BackColor = System.Drawing.Color.Transparent; - this.lblHeader.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.lblHeader.CanShrink = true; - this.lblHeader.Font = new System.Drawing.Font("Arial", 9F); - this.lblHeader.LocationFloat = new DevExpress.Utils.PointFloat(408.8752F, 10.00001F); - this.lblHeader.Multiline = true; - this.lblHeader.Name = "lblHeader"; - this.lblHeader.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblHeader.SizeF = new System.Drawing.SizeF(355.8332F, 39.99999F); - this.lblHeader.StylePriority.UseBackColor = false; - this.lblHeader.StylePriority.UseBorders = false; - this.lblHeader.StylePriority.UseFont = false; - this.lblHeader.StylePriority.UseTextAlignment = false; - this.lblHeader.Text = "Betreutes Wohnen "; - this.lblHeader.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter; - // - // xrLabel3 - // - this.xrLabel3.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrLabel3.Font = new System.Drawing.Font("Arial", 9F); - this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(938.0004F, 10.00001F); - this.xrLabel3.Name = "xrLabel3"; - this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel3.SizeF = new System.Drawing.SizeF(130.4999F, 25F); - this.xrLabel3.StylePriority.UseBackColor = false; - this.xrLabel3.StylePriority.UseBorders = false; - this.xrLabel3.StylePriority.UseFont = false; - this.xrLabel3.StylePriority.UseForeColor = false; - this.xrLabel3.StylePriority.UseTextAlignment = false; - this.xrLabel3.Text = " [AccountingPeriodEnd!dd.MM.yyyy]"; - this.xrLabel3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrLabel3.WordWrap = false; - // - // xrLabel2 - // - this.xrLabel2.BackColor = System.Drawing.Color.Transparent; - this.xrLabel2.Borders = DevExpress.XtraPrinting.BorderSide.None; - this.xrLabel2.Font = new System.Drawing.Font("Arial", 9F); - this.xrLabel2.LocationFloat = new DevExpress.Utils.PointFloat(0F, 10.00001F); - this.xrLabel2.Multiline = true; - this.xrLabel2.Name = "xrLabel2"; - this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel2.SizeF = new System.Drawing.SizeF(254.5001F, 39.99999F); - this.xrLabel2.StylePriority.UseBackColor = false; - this.xrLabel2.StylePriority.UseBorders = false; - this.xrLabel2.StylePriority.UseFont = false; - this.xrLabel2.StylePriority.UseTextAlignment = false; - this.xrLabel2.Text = "Perspektiven e.V.\r\nAlberusstraße 5, 61440 Oberursel"; - this.xrLabel2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.xrLabel2.WordWrap = false; - // // fieldMonatskontingent // this.fieldMonatskontingent.DataMember = "ServiceInvoicePeriods"; @@ -772,24 +794,6 @@ namespace PerspektivenEV this.fieldBetreuungsbeginn.FieldType = DevExpress.XtraReports.UI.FieldType.DateTime; this.fieldBetreuungsbeginn.Name = "fieldBetreuungsbeginn"; // - // GroupHeader1 - // - this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.lblHeader, - this.xrLabel3, - this.xrLabel2}); - this.GroupHeader1.HeightF = 75F; - this.GroupHeader1.Level = 1; - this.GroupHeader1.Name = "GroupHeader1"; - this.GroupHeader1.PageBreak = DevExpress.XtraReports.UI.PageBreak.BeforeBandExceptFirstEntry; - // - // GroupFooter1 - // - this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrTable1}); - this.GroupFooter1.HeightF = 18F; - this.GroupFooter1.Name = "GroupFooter1"; - // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); diff --git a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs index cc2ea9896..d782e6926 100644 --- a/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs +++ b/ReportImp/PerspektivenEV/CollectiveBillingReportTab.cs @@ -18,8 +18,6 @@ namespace PerspektivenEV public void SetReportDataSource(ServiceInvoiceRO pRO) { decimal totalPerMonth = 0; - - //pRO.ServiceInvoicePeriods.Sort((a, b) => a.Customer.LastNameFirstName.CompareTo(b.Customer.LastNameFirstName)); DateTime abrechnungsMonatEnde = pRO.AccountingPeriodEnd; if (pRO.ServiceInvoicePeriods != null) @@ -27,13 +25,15 @@ namespace PerspektivenEV foreach (var sip in pRO.ServiceInvoicePeriods) { if (sip.Notice.Contains("Hochtaunuskreis")) - lblHeader.Text = "Betreutes Wohnen für Menschen mit psychischer Erkrankung im Hochtaunuskreis"; + sip.Notice = "Betreutes Wohnen für Menschen mit psychischer Erkrankung im Hochtaunuskreis"; else if (sip.Notice.Contains("Frankfurt")) - lblHeader.Text = "Betreutes Wohnen Frankfurt/M."; + sip.Notice = "Betreutes Wohnen Frankfurt/M."; else if (sip.Notice.Contains("Körperbehinderte")) - lblHeader.Text = "Betreutes Wohnen für Menschen mit körperlicher-/ Sinnesbehinderung"; + sip.Notice = "Betreutes Wohnen für Menschen mit körperlicher-/ Sinnesbehinderung"; + sip.ServiceInvoiceItems.Sort((a, b) => a.ServiceDescription.CompareTo(b.ServiceDescription)); } } + cellTotalPerMonth.Text = String.Format("{0:0.00}", totalPerMonth); this.bindingSource1.DataSource = pRO; diff --git a/ReportImp/PerspektivenEV/CustomReportCreator.cs b/ReportImp/PerspektivenEV/CustomReportCreator.cs new file mode 100644 index 000000000..d160c2beb --- /dev/null +++ b/ReportImp/PerspektivenEV/CustomReportCreator.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using BeWo.Data.Access; +using BeWo.Data.Entities; +using BeWo.Report; +using BeWo.Report.ReportObjects; +using BeWo.Service.DCEntityMapper; +using BS.Shared.DataContracts; +using DevExpress.XtraReports.Design; +using DevExpress.XtraReports.UI; + +namespace PerspektivenEV +{ + public class CustomReportCreator : DefaultReportCreator + { + public override XtraReport CreateServiceInvoiceReport(string dcIds, long? invoiceBaseOid) + { + if (String.IsNullOrEmpty(dcIds) && invoiceBaseOid.HasValue) + { + var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid.Value); + dcIds = String.Format("{0}", serviceInvoice.Oid); + } + + if (!string.IsNullOrEmpty(dcIds)) + { + var dcList = new List(); + + var dcidStrs = dcIds.Split(';'); + foreach (var oidStr in dcidStrs) + { + var oid = long.Parse(oidStr); + var invoice = DAOFactory.GenericDAO.LoadByID(oid); + var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice); + dcList.Add(dc); + + } + + IBeWoReport allReports = null; + + foreach (var iDC in dcList) + { + + IBeWoReport singleReport = FindReportImp(iDC.InvoiceBase.InvoiceId); + + var ro = ServiceInvoiceRO.Create(iDC); + singleReport.SetReportDataSource(ro); + ((XtraReport)singleReport).CreateDocument(); + + if (iDC.InvoiceBase.InvoiceId == "Sammelrechnung") + { + var anhang = new SammelrechnungTab(); + anhang.SetReportDataSource(ro); + anhang.CreateDocument(); + ((XtraReport)singleReport).Pages.AddRange(((XtraReport)anhang).Pages); + } + + if (allReports == null) + allReports = singleReport; + else + ((XtraReport)allReports).Pages.AddRange(((XtraReport)singleReport).Pages); + } + + return allReports as XtraReport; + } + return new XtraReport(); + } + + } +} diff --git a/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs b/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs index 4752219a9..40730f200 100644 --- a/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs +++ b/ReportImp/PerspektivenEV/Invoicing/CollectiveInvoiceCreation.cs @@ -87,9 +87,7 @@ namespace PerspektivenEV.Invoicing } } - - Dictionary> cat2Daten = new Dictionary>(); - + Dictionary> cat2Daten = new Dictionary>(); foreach (var item in newSc2SrList) { @@ -115,19 +113,14 @@ namespace PerspektivenEV.Invoicing daten.SupportConceptApprovalPeriod = ap; cat2Daten[key].Add(daten); } - } } foreach (var categoryName in cat2Daten.Keys) { var datenListe = cat2Daten[categoryName]; - var sip = ErstelleServiceInvoicePeriod(invoicePeriod, categoryName, datenListe); - - invoice.ServiceInvoicePeriodList.Add(sip); - - + invoice.ServiceInvoicePeriodList.Add(sip); } } @@ -174,15 +167,12 @@ namespace PerspektivenEV.Invoicing items.Add(item); } } - - return items.OrderBy(i => i.ItemDescription).ToList(); } private InvoiceItem CreateInvoiceItem(Abrechnungsdaten daten) { var calc = new CustomCalculations(); - DateTime start = daten.AbrechnungsStartDate; DateTime end = daten.AbrechnungsEndDate; @@ -266,8 +256,6 @@ namespace PerspektivenEV.Invoicing base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList); } - - public override void CreateFixedAmounts(ServiceInvoicePeriod serviceInvoicePeriod, SupportConceptApprovalPeriodDC scap, CostBearer2SupportConcept cb2sc) { var calc = new CustomCalculations(); @@ -328,8 +316,6 @@ namespace PerspektivenEV.Invoicing ii.GrossAmountTotal = ii.AmountTotal; serviceInvoicePeriod.InvoiceItemList.Add(ii); } - - } public class Abrechnungsdaten