From 43f737e7f8a9629e9da461d4703db98e3cf5b793 Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Wed, 18 Jan 2023 11:27:21 +0100 Subject: [PATCH] MH: Fehlkontakt BeWoAmRhein --- Host/Host.csproj.user | 2 +- .../ServicesOverviewReport.Designer.cs | 129 +++++++++++++++--- .../ServicesOverviewReport.cs | 35 ++++- 3 files changed, 142 insertions(+), 24 deletions(-) diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user index a441248c4..47b4326c0 100644 --- a/Host/Host.csproj.user +++ b/Host/Host.csproj.user @@ -3,7 +3,7 @@ BeWo2.0 true - Release|Any CPU + Debug|Any CPU false diff --git a/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.Designer.cs b/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.Designer.cs index c79a59c47..e8f10d9fb 100644 --- a/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.Designer.cs +++ b/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.Designer.cs @@ -38,6 +38,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); this.xrTable3 = new DevExpress.XtraReports.UI.XRTable(); @@ -47,6 +48,8 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell7 = new DevExpress.XtraReports.UI.XRTableCell(); + this.picSignature = new DevExpress.XtraReports.UI.XRPictureBox(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); @@ -83,6 +86,10 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.customerCountField = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldBillableFLS = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldAbrechenbareFLS = new DevExpress.XtraReports.UI.CalculatedField(); + this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox(); + this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrPictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox(); ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); @@ -109,7 +116,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableServiceRecords1.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTableServiceRecords1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow2}); - this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(675F, 18.00003F); + this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(740F, 18.00003F); this.xrTableServiceRecords1.StylePriority.UseBackColor = false; this.xrTableServiceRecords1.StylePriority.UseFont = false; this.xrTableServiceRecords1.StylePriority.UseTextAlignment = false; @@ -122,7 +129,8 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell5, this.xrTableCell9, this.xrTableCell12, - this.xrTableCell1}); + this.xrTableCell1, + this.xrTableCell4}); this.xrTableRow2.Name = "xrTableRow2"; this.xrTableRow2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTableRow2.StylePriority.UseFont = false; @@ -142,7 +150,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports // this.xrTableCell5.Name = "xrTableCell5"; this.xrTableCell5.Text = "Uhrzeit"; - this.xrTableCell5.Weight = 0.40236764521500384D; + this.xrTableCell5.Weight = 0.3083802401994884D; // // xrTableCell9 // @@ -151,7 +159,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell9.StylePriority.UseFont = false; this.xrTableCell9.StylePriority.UseTextAlignment = false; this.xrTableCell9.Text = "Anzahl Minuten"; - this.xrTableCell9.Weight = 0.32920989628762409D; + this.xrTableCell9.Weight = 0.31142848528199735D; // // xrTableCell12 // @@ -163,13 +171,19 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell12.StylePriority.UseTextAlignment = false; this.xrTableCell12.Text = "Gruppe"; this.xrTableCell12.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell12.Weight = 0.29263101788877588D; + this.xrTableCell12.Weight = 0.25706827029743851D; // // xrTableCell1 // this.xrTableCell1.Name = "xrTableCell1"; this.xrTableCell1.Text = "Mitarbeiter(in)"; - this.xrTableCell1.Weight = 0.37798173117985129D; + this.xrTableCell1.Weight = 0.29923556217627167D; + // + // xrTableCell4 + // + this.xrTableCell4.Name = "xrTableCell4"; + this.xrTableCell4.Text = "Unterschrift Klient(in)"; + this.xrTableCell4.Weight = 0.38458627920617711D; // // DetailReport // @@ -202,7 +216,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow6}); - this.xrTable3.SizeF = new System.Drawing.SizeF(675F, 18F); + this.xrTable3.SizeF = new System.Drawing.SizeF(739.9999F, 18F); this.xrTable3.StylePriority.UseFont = false; this.xrTable3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; // @@ -213,7 +227,8 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell6, this.xrTableCell16, this.xrTableCell17, - this.xrTableCell2}); + this.xrTableCell2, + this.xrTableCell7}); this.xrTableRow6.Name = "xrTableRow6"; this.xrTableRow6.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTableRow6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; @@ -240,7 +255,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell6.StylePriority.UseTextAlignment = false; this.xrTableCell6.Text = "xrTableCell6"; this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell6.Weight = 0.2083332888606978D; + this.xrTableCell6.Weight = 0.15966957296093959D; // // xrTableCell16 // @@ -252,7 +267,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell16.StylePriority.UseTextAlignment = false; this.xrTableCell16.Text = "xrTableCell16"; this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell16.Weight = 0.17045448578923902D; + this.xrTableCell16.Weight = 0.16124781236202151D; // // xrTableCell17 // @@ -267,7 +282,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell17.Text = "xrTableCell17"; this.xrTableCell17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; this.xrTableCell17.TextTrimming = System.Drawing.StringTrimming.Word; - this.xrTableCell17.Weight = 0.15151511598001524D; + this.xrTableCell17.Weight = 0.13310188472244075D; // // xrTableCell2 // @@ -277,7 +292,27 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrTableCell2.StylePriority.UseTextAlignment = false; this.xrTableCell2.Text = "xrTableCell2"; this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell2.Weight = 0.19570704439348488D; + this.xrTableCell2.Weight = 0.15493474084146347D; + // + // xrTableCell7 + // + this.xrTableCell7.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.picSignature}); + this.xrTableCell7.Name = "xrTableCell7"; + this.xrTableCell7.StylePriority.UseTextAlignment = false; + this.xrTableCell7.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; + this.xrTableCell7.Weight = 0.19912657478272541D; + // + // picSignature + // + this.picSignature.Borders = DevExpress.XtraPrinting.BorderSide.None; + this.picSignature.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Tag", null, "Services.Signature")}); + this.picSignature.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.picSignature.Name = "picSignature"; + this.picSignature.SizeF = new System.Drawing.SizeF(157.7082F, 18.00003F); + this.picSignature.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + this.picSignature.StylePriority.UseBorders = false; // // bindingSource1 // @@ -514,7 +549,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.xrPictureBox1, this.lblTitle}); this.topMarginBand1.Font = new System.Drawing.Font("Times New Roman", 9.75F); - this.topMarginBand1.HeightF = 148.3056F; + this.topMarginBand1.HeightF = 148.3055F; this.topMarginBand1.Name = "topMarginBand1"; this.topMarginBand1.StylePriority.UseFont = false; // @@ -528,12 +563,16 @@ namespace BeWo.BetreutesWohnenAmRheinReports // // bottomMarginBand1 // - this.bottomMarginBand1.HeightF = 36.41669F; + this.bottomMarginBand1.HeightF = 36F; this.bottomMarginBand1.Name = "bottomMarginBand1"; // // ReportFooter // this.ReportFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel17, + this.xrPictureBox3, + this.xrPictureBox2, + this.xrLabel18, this.xrLabel7, this.xrLabel6, this.xrLabel3, @@ -547,10 +586,10 @@ namespace BeWo.BetreutesWohnenAmRheinReports // xrLabel7 // this.xrLabel7.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.xrLabel7.LocationFloat = new DevExpress.Utils.PointFloat(435.1248F, 130F); + this.xrLabel7.LocationFloat = new DevExpress.Utils.PointFloat(482.8607F, 130F); this.xrLabel7.Name = "xrLabel7"; this.xrLabel7.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel7.SizeF = new System.Drawing.SizeF(197F, 17.99997F); + this.xrLabel7.SizeF = new System.Drawing.SizeF(257.139F, 17.99997F); this.xrLabel7.StylePriority.UseBorders = false; this.xrLabel7.StylePriority.UseFont = false; this.xrLabel7.Text = "Unterschrift Klient/in"; @@ -558,10 +597,10 @@ namespace BeWo.BetreutesWohnenAmRheinReports // xrLabel6 // this.xrLabel6.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.xrLabel6.LocationFloat = new DevExpress.Utils.PointFloat(183.1249F, 130F); + this.xrLabel6.LocationFloat = new DevExpress.Utils.PointFloat(159.722F, 130F); this.xrLabel6.Name = "xrLabel6"; this.xrLabel6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel6.SizeF = new System.Drawing.SizeF(216.8751F, 17.99997F); + this.xrLabel6.SizeF = new System.Drawing.SizeF(299.8613F, 17.99997F); this.xrLabel6.StylePriority.UseBorders = false; this.xrLabel6.StylePriority.UseFont = false; this.xrLabel6.Text = "Unterschrift Mitarbeiter/in"; @@ -569,7 +608,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports // xrLabel3 // this.xrLabel3.Font = new System.Drawing.Font("Arial", 9F); - this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(37.99998F, 0F); + this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0.45832F, 0F); this.xrLabel3.Multiline = true; this.xrLabel3.Name = "xrLabel3"; this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -585,10 +624,10 @@ namespace BeWo.BetreutesWohnenAmRheinReports | DevExpress.XtraPrinting.BorderSide.Bottom))); this.xrLabel4.BorderWidth = 2F; this.xrLabel4.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold); - this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(264F, 0F); + this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(226.4583F, 0F); this.xrLabel4.Name = "xrLabel4"; this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 3, 0, 0, 100F); - this.xrLabel4.SizeF = new System.Drawing.SizeF(136F, 48.20836F); + this.xrLabel4.SizeF = new System.Drawing.SizeF(127.7083F, 48.20836F); this.xrLabel4.StylePriority.UseBorders = false; this.xrLabel4.StylePriority.UseBorderWidth = false; this.xrLabel4.StylePriority.UseFont = false; @@ -646,6 +685,45 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.fieldAbrechenbareFLS.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal; this.fieldAbrechenbareFLS.Name = "fieldAbrechenbareFLS"; // + // xrPictureBox2 + // + this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Image", null, "CustomerSignature")}); + this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(582.2917F, 94.49997F); + this.xrPictureBox2.Name = "xrPictureBox2"; + this.xrPictureBox2.SizeF = new System.Drawing.SizeF(157.7081F, 35.50002F); + this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + // + // 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(482.2915F, 107F); + this.xrLabel18.Name = "xrLabel18"; + this.xrLabel18.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel18.SizeF = new System.Drawing.SizeF(100F, 23F); + this.xrLabel18.Visible = false; + // + // xrLabel17 + // + 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(159.722F, 107F); + this.xrLabel17.Name = "xrLabel17"; + this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel17.SizeF = new System.Drawing.SizeF(100F, 23F); + this.xrLabel17.Visible = false; + // + // xrPictureBox3 + // + this.xrPictureBox3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Image", null, "EmployeeSignature")}); + this.xrPictureBox3.LocationFloat = new DevExpress.Utils.PointFloat(260.2221F, 94.50003F); + this.xrPictureBox3.Name = "xrPictureBox3"; + this.xrPictureBox3.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint"; + this.xrPictureBox3.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F); + this.xrPictureBox3.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + // // Stundenzettel // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -668,7 +746,7 @@ namespace BeWo.BetreutesWohnenAmRheinReports this.formattingRuleServiceDesc, this.formattingRuleCostBearer, this.formattingRuleEmployeeName}); - this.Margins = new System.Drawing.Printing.Margins(75, 75, 148, 36); + this.Margins = new System.Drawing.Printing.Margins(61, 26, 148, 36); this.PageHeight = 1169; this.PageWidth = 827; this.PaperKind = System.Drawing.Printing.PaperKind.A4; @@ -736,5 +814,12 @@ namespace BeWo.BetreutesWohnenAmRheinReports private DevExpress.XtraReports.UI.CalculatedField fieldBillableFLS; private DevExpress.XtraReports.UI.CalculatedField fieldAbrechenbareFLS; private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell4; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell7; + private DevExpress.XtraReports.UI.XRPictureBox picSignature; + private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox2; + private DevExpress.XtraReports.UI.XRLabel xrLabel18; + private DevExpress.XtraReports.UI.XRLabel xrLabel17; + private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox3; } } diff --git a/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.cs b/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.cs index 122a4dabc..b0e817274 100644 --- a/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.cs +++ b/ReportImp/BetreutesWohnenAmRheinReports/ServicesOverviewReport.cs @@ -1,10 +1,15 @@ using System; using System.Collections.Generic; +using System.Drawing; +using System.IO; using System.Linq; +using System.Text.RegularExpressions; using BeWo.Report; using BeWo.Report.ReportObjects; using BeWo.Service.ServiceImplementations; +using BS.Shared.Core; using BS.Shared.DataContracts; +using DevExpress.XtraReports.UI; namespace BeWo.BetreutesWohnenAmRheinReports { @@ -25,8 +30,10 @@ namespace BeWo.BetreutesWohnenAmRheinReports foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services) { - if (s.IsBillable) + if (s.IsBillable || s.ServiceCategory == "Fehlkontakt") { + ServicesOverviewRO.CreateSignatureString(s); + if (!cats.ContainsKey(s.ServiceCategory)) { cats.Add(s.ServiceCategory, s.ServiceCategory); @@ -105,5 +112,31 @@ namespace BeWo.BetreutesWohnenAmRheinReports } return null; } + + private void picSignature_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) + { + XRPictureBox xrBox = sender as XRPictureBox; + //var test = this.GetCurrent + string base64String = xrBox.Tag as string; + if (!String.IsNullOrWhiteSpace(base64String)) + { + var base64Data = Regex.Match(base64String, @"data:image/(?.+?),(?.+)").Groups["data"].Value; + var binData = Convert.FromBase64String(base64Data); + Image img = ByteArrayToImage(binData); + xrBox.Image = Utils.CropImage(img); + } + else + { + xrBox.Image = null; + } + } + + public Image ByteArrayToImage(byte[] byteArrayIn) + { + using (var memoryStream = new MemoryStream(byteArrayIn)) + { + return Image.FromStream(memoryStream); + } + } } }