diff --git a/ReportImp/Humanitas/CustomReportCreator.cs b/ReportImp/Humanitas/CustomReportCreator.cs index b2a2d880d..5a9525844 100644 --- a/ReportImp/Humanitas/CustomReportCreator.cs +++ b/ReportImp/Humanitas/CustomReportCreator.cs @@ -22,5 +22,79 @@ namespace Humanitas return report; } + + public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay) + { + List lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay); + + if (lROs.Count > 0) + { + + var rootReport = CreateServicesOverviewReportForRo(lROs[0], serviceCategoryOid); + rootReport.CreateDocument(); + + for (int i = 1; i < lROs.Count; i++) + { + var lNext = CreateServicesOverviewReportForRo(lROs[i], serviceCategoryOid); + lNext.CreateDocument(); + rootReport.Pages.AddRange(lNext.Pages); + } + + return rootReport; + } + return new XtraReport(); + } + + public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay) + { + var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid); + return CreateServicesOverviewReportForRo(ro, serviceCategoryOid); + } + public override XtraReport CreateServiceOverviewReportForCustomers(IList customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende) + { + var roList = new List(); + + foreach (var coid in customerOids) + { + var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid); + if (ro != null) + { + roList.Add(ro); + } + } + + if (roList.Count > 0) + { + + var rootReport = CreateServicesOverviewReportForRo(roList[0], serviceCategoryOid); + rootReport.CreateDocument(); + + for (int i = 1; i < roList.Count; i++) + { + var lNext = CreateServicesOverviewReportForRo(roList[i], serviceCategoryOid); + lNext.CreateDocument(); + rootReport.Pages.AddRange(lNext.Pages); + } + + return rootReport; + } + return new XtraReport(); + + } + + private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, long? serviceCategoryOid) + { + IBeWoReport report = null; + + // Klären, wann QB genommen werden soll + if (ro.StartDate.Date < new DateTime(2024, 11, 01)) + report = new ServicesOverviewReportAlt(); + else + report = new Stundenzettel(); + + report.SetReportDataSource(ro); + + return report as XtraReport; + } } } diff --git a/ReportImp/Humanitas/ServicesOverviewReport.Designer.cs b/ReportImp/Humanitas/ServicesOverviewReport.Designer.cs index 7730bcfbd..5c308fb54 100644 --- a/ReportImp/Humanitas/ServicesOverviewReport.Designer.cs +++ b/ReportImp/Humanitas/ServicesOverviewReport.Designer.cs @@ -30,6 +30,7 @@ namespace Humanitas { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Stundenzettel)); + DevExpress.XtraReports.UI.XRWatermark xrWatermark1 = new DevExpress.XtraReports.UI.XRWatermark(); this.Detail = new DevExpress.XtraReports.UI.DetailBand(); this.xrTableServiceRecords1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow2 = new DevExpress.XtraReports.UI.XRTableRow(); @@ -48,9 +49,13 @@ namespace Humanitas this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); + this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox(); + this.lblUnterschriftMitarbeiter = new DevExpress.XtraReports.UI.XRLabel(); + this.lblUnterschriftKlient = new DevExpress.XtraReports.UI.XRLabel(); + this.xrPictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox(); this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox(); @@ -81,12 +86,7 @@ namespace Humanitas this.fieldBillableFLS = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldAbrechenbareFLS = new DevExpress.XtraReports.UI.CalculatedField(); this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); - this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox(); - this.lblUnterschriftMitarbeiter = new DevExpress.XtraReports.UI.XRLabel(); - this.lblUnterschriftKlient = new DevExpress.XtraReports.UI.XRLabel(); - this.xrPictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox(); - this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); @@ -289,7 +289,6 @@ namespace Humanitas this.lblUnterschriftMitarbeiter, this.lblUnterschriftKlient, this.xrPictureBox3, - this.xrLabel17, this.xrLabel3, this.xrLabel4}); this.GroupFooter1.Font = new DevExpress.Drawing.DXFont("Arial", 8F); @@ -298,6 +297,68 @@ namespace Humanitas this.GroupFooter1.Name = "GroupFooter1"; this.GroupFooter1.StylePriority.UseFont = false; // + // xrLabel18 + // + this.xrLabel18.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy}")}); + this.xrLabel18.LocationFloat = new DevExpress.Utils.PointFloat(0F, 85.63963F); + this.xrLabel18.Name = "xrLabel18"; + this.xrLabel18.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel18.SizeF = new System.Drawing.SizeF(100F, 23.90208F); + this.xrLabel18.StylePriority.UseTextAlignment = false; + this.xrLabel18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; + // + // xrPictureBox2 + // + this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("ImageSource", null, "EmployeeSignature")}); + this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(400F, 74.04169F); + this.xrPictureBox2.Name = "xrPictureBox2"; + this.xrPictureBox2.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint"; + this.xrPictureBox2.SizeF = new System.Drawing.SizeF(275F, 35.50002F); + this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + // + // lblUnterschriftMitarbeiter + // + this.lblUnterschriftMitarbeiter.Borders = DevExpress.XtraPrinting.BorderSide.Top; + this.lblUnterschriftMitarbeiter.Font = new DevExpress.Drawing.DXFont("Arial", 9F); + this.lblUnterschriftMitarbeiter.LocationFloat = new DevExpress.Utils.PointFloat(375F, 109.5417F); + this.lblUnterschriftMitarbeiter.Name = "lblUnterschriftMitarbeiter"; + this.lblUnterschriftMitarbeiter.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F); + this.lblUnterschriftMitarbeiter.SizeF = new System.Drawing.SizeF(300F, 20F); + this.lblUnterschriftMitarbeiter.StylePriority.UseBackColor = false; + this.lblUnterschriftMitarbeiter.StylePriority.UseBorders = false; + this.lblUnterschriftMitarbeiter.StylePriority.UseFont = false; + this.lblUnterschriftMitarbeiter.StylePriority.UsePadding = false; + this.lblUnterschriftMitarbeiter.StylePriority.UseTextAlignment = false; + this.lblUnterschriftMitarbeiter.Text = "Datum, Unterschrift Mitarbeiter/in"; + this.lblUnterschriftMitarbeiter.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + // + // lblUnterschriftKlient + // + this.lblUnterschriftKlient.Borders = DevExpress.XtraPrinting.BorderSide.Top; + this.lblUnterschriftKlient.Font = new DevExpress.Drawing.DXFont("Arial", 9F); + this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(0F, 109.5417F); + this.lblUnterschriftKlient.Name = "lblUnterschriftKlient"; + this.lblUnterschriftKlient.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F); + this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(300F, 20F); + this.lblUnterschriftKlient.StylePriority.UseBackColor = false; + this.lblUnterschriftKlient.StylePriority.UseBorders = false; + this.lblUnterschriftKlient.StylePriority.UseFont = false; + this.lblUnterschriftKlient.StylePriority.UsePadding = false; + this.lblUnterschriftKlient.StylePriority.UseTextAlignment = false; + this.lblUnterschriftKlient.Text = "Datum, Unterschrift Klient/in"; + this.lblUnterschriftKlient.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + // + // xrPictureBox3 + // + this.xrPictureBox3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("ImageSource", null, "CustomerSignature")}); + this.xrPictureBox3.LocationFloat = new DevExpress.Utils.PointFloat(100.6389F, 74.04169F); + this.xrPictureBox3.Name = "xrPictureBox3"; + this.xrPictureBox3.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F); + this.xrPictureBox3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + // // xrLabel3 // this.xrLabel3.Font = new DevExpress.Drawing.DXFont("Arial", 9F); @@ -329,10 +390,6 @@ namespace Humanitas this.xrLabel4.Text = "[TotalFLMBillable] = [fieldBillableFLS!0.##] Std."; this.xrLabel4.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); - // // formattingRuleStartDate // this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]"; @@ -628,80 +685,9 @@ namespace Humanitas this.GroupHeader1.RepeatEveryPage = true; this.GroupHeader1.StylePriority.UseFont = false; // - // xrLabel18 + // bindingSource1 // - this.xrLabel18.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy}")}); - this.xrLabel18.LocationFloat = new DevExpress.Utils.PointFloat(0F, 85.63963F); - this.xrLabel18.Name = "xrLabel18"; - this.xrLabel18.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel18.SizeF = new System.Drawing.SizeF(100F, 23.90208F); - this.xrLabel18.StylePriority.UseTextAlignment = false; - this.xrLabel18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; - // - // xrPictureBox2 - // - this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("ImageSource", null, "EmployeeSignature")}); - this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(475.6389F, 74.04169F); - this.xrPictureBox2.Name = "xrPictureBox2"; - this.xrPictureBox2.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint"; - this.xrPictureBox2.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F); - this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; - // - // lblUnterschriftMitarbeiter - // - this.lblUnterschriftMitarbeiter.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.lblUnterschriftMitarbeiter.Font = new DevExpress.Drawing.DXFont("Arial", 9F); - this.lblUnterschriftMitarbeiter.LocationFloat = new DevExpress.Utils.PointFloat(375F, 109.5417F); - this.lblUnterschriftMitarbeiter.Name = "lblUnterschriftMitarbeiter"; - this.lblUnterschriftMitarbeiter.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F); - this.lblUnterschriftMitarbeiter.SizeF = new System.Drawing.SizeF(300F, 20F); - this.lblUnterschriftMitarbeiter.StylePriority.UseBackColor = false; - this.lblUnterschriftMitarbeiter.StylePriority.UseBorders = false; - this.lblUnterschriftMitarbeiter.StylePriority.UseFont = false; - this.lblUnterschriftMitarbeiter.StylePriority.UsePadding = false; - this.lblUnterschriftMitarbeiter.StylePriority.UseTextAlignment = false; - this.lblUnterschriftMitarbeiter.Text = "Datum, Unterschrift Mitarbeiter/in"; - this.lblUnterschriftMitarbeiter.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // - // lblUnterschriftKlient - // - this.lblUnterschriftKlient.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.lblUnterschriftKlient.Font = new DevExpress.Drawing.DXFont("Arial", 9F); - this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(0F, 109.5417F); - this.lblUnterschriftKlient.Name = "lblUnterschriftKlient"; - this.lblUnterschriftKlient.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F); - this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(300F, 20F); - this.lblUnterschriftKlient.StylePriority.UseBackColor = false; - this.lblUnterschriftKlient.StylePriority.UseBorders = false; - this.lblUnterschriftKlient.StylePriority.UseFont = false; - this.lblUnterschriftKlient.StylePriority.UsePadding = false; - this.lblUnterschriftKlient.StylePriority.UseTextAlignment = false; - this.lblUnterschriftKlient.Text = "Datum, Unterschrift Klient/in"; - this.lblUnterschriftKlient.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // - // xrPictureBox3 - // - this.xrPictureBox3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("ImageSource", null, "CustomerSignature")}); - this.xrPictureBox3.LocationFloat = new DevExpress.Utils.PointFloat(100.6389F, 74.04169F); - this.xrPictureBox3.Name = "xrPictureBox3"; - this.xrPictureBox3.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F); - this.xrPictureBox3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; - // - // xrLabel17 - // - this.xrLabel17.BackColor = System.Drawing.Color.Transparent; - this.xrLabel17.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeSignatureDate", "{0:dd.MM.yyyy}")}); - this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(375F, 85.63963F); - this.xrLabel17.Name = "xrLabel17"; - this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel17.SizeF = new System.Drawing.SizeF(100.6389F, 23.90208F); - this.xrLabel17.StylePriority.UseBackColor = false; - this.xrLabel17.StylePriority.UseTextAlignment = false; - this.xrLabel17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter; + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); // // Stundenzettel // @@ -731,6 +717,8 @@ namespace Humanitas this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4; this.SnapGridSize = 9F; this.Version = "23.2"; + xrWatermark1.Id = "Watermark1"; + this.Watermarks.Add(xrWatermark1); ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); @@ -796,6 +784,5 @@ namespace Humanitas private DevExpress.XtraReports.UI.XRLabel lblUnterschriftMitarbeiter; private DevExpress.XtraReports.UI.XRLabel lblUnterschriftKlient; private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox3; - private DevExpress.XtraReports.UI.XRLabel xrLabel17; } } diff --git a/ReportImp/Humanitas/ServicesOverviewReportAlt.Designer.cs b/ReportImp/Humanitas/ServicesOverviewReportAlt.Designer.cs index 28de686c3..644023509 100644 --- a/ReportImp/Humanitas/ServicesOverviewReportAlt.Designer.cs +++ b/ReportImp/Humanitas/ServicesOverviewReportAlt.Designer.cs @@ -1,4 +1,4 @@ -namespace BeWo.Demo +namespace Humanitas { partial class ServicesOverviewReportAlt { diff --git a/ReportImp/Humanitas/ServicesOverviewReportAlt.cs b/ReportImp/Humanitas/ServicesOverviewReportAlt.cs index 6549f2503..80e3ece0f 100644 --- a/ReportImp/Humanitas/ServicesOverviewReportAlt.cs +++ b/ReportImp/Humanitas/ServicesOverviewReportAlt.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using BeWo.Report; using BeWo.Report.ReportObjects; -namespace BeWo.Demo +namespace Humanitas { - public partial class ServicesOverviewReportAlt : DevExpress.XtraReports.UI.XtraReport//, IBeWoReport + public partial class ServicesOverviewReportAlt : DevExpress.XtraReports.UI.XtraReport, IBeWoReport { public ServicesOverviewReportAlt() {