From 8d3b2350dec86720d80a18fdeb0ad790774e5cef Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 23 Jan 2023 16:00:53 +0100 Subject: [PATCH] BetreutesWohnenWoellReports/QuittierungsbelegASL und FLS angepasst SHKService Mitarbeiterarbeitszeitkonto --- .../QuittierungsbelegASL.cs | 31 ++++ .../QuittierungsbelegASL.designer.cs | 76 ++++++--- .../QuittierungsbelegFLS.cs | 31 ++++ .../QuittierungsbelegFLS.designer.cs | 71 ++++++-- ...CustomMitarbeiterstundenkontoBerechnung.cs | 152 +++++++++++++++--- ...MitarbeiterstundenkontoBerechnungMonate.cs | 2 +- .../SHKService/Mitarbeiterarbeitszeitkonto.cs | 9 +- .../Mitarbeiterarbeitszeitkonto.designer.cs | 2 +- .../SHKService/Mitarbeiterstundenkonto.cs | 5 +- .../Mitarbeiterstundenkonto.designer.cs | 2 +- .../SHKService/MitarbeiterstundenkontoJahr.cs | 5 +- .../MitarbeiterstundenkontoJahr.designer.cs | 2 +- ReportImp/SHKService/Teamstundenkonto.cs | 2 +- .../SHKService/Teamstundenkonto.designer.cs | 2 +- 14 files changed, 314 insertions(+), 78 deletions(-) diff --git a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.cs b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.cs index 8b912671a..64c30e66d 100644 --- a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.cs +++ b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.cs @@ -5,6 +5,10 @@ using System.ComponentModel; using DevExpress.XtraReports.UI; using BeWo.Report.ReportObjects; using BeWo.Report; +using System.Text.RegularExpressions; +using System.Drawing; +using BS.Shared.Core; +using System.IO; namespace BeWo.BetreutesWohnenWoellReports { @@ -26,6 +30,7 @@ namespace BeWo.BetreutesWohnenWoellReports { if (s.IsBillable) { + ServicesOverviewRO.CreateSignatureString(s); total += s.Minutes; servicesBillable.Add(s); } @@ -38,5 +43,31 @@ namespace BeWo.BetreutesWohnenWoellReports this.bindingSource1.DataSource = pRO; } + + 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); + } + } } } diff --git a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.designer.cs b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.designer.cs index 4dc8c582f..1bc7a58e1 100644 --- a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.designer.cs +++ b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegASL.designer.cs @@ -54,7 +54,6 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel3 = 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,6 +80,10 @@ namespace BeWo.BetreutesWohnenWoellReports this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.fieldAbrechenbareMinuten = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldFLSBillable = new DevExpress.XtraReports.UI.CalculatedField(); + this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell2 = new DevExpress.XtraReports.UI.XRTableCell(); + this.picSignature = new DevExpress.XtraReports.UI.XRPictureBox(); + 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(); @@ -118,7 +121,8 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell3, this.xrTableCell4, this.xrTableCell9, - this.xrTableCell12}); + this.xrTableCell12, + this.xrTableCell1}); this.xrTableRow2.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.xrTableRow2.Name = "xrTableRow2"; this.xrTableRow2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); @@ -152,7 +156,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell9.StylePriority.UseFont = false; this.xrTableCell9.StylePriority.UseTextAlignment = false; this.xrTableCell9.Text = "Personenzahl"; - this.xrTableCell9.Weight = 0.58526203379294373D; + this.xrTableCell9.Weight = 0.32189411849476823D; // // xrTableCell12 // @@ -162,7 +166,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell12.StylePriority.UseFont = false; this.xrTableCell12.StylePriority.UseTextAlignment = false; this.xrTableCell12.Text = "Minuten"; - this.xrTableCell12.Weight = 0.32920989590432559D; + this.xrTableCell12.Weight = 0.24142059080493378D; // // DetailReport // @@ -180,7 +184,7 @@ namespace BeWo.BetreutesWohnenWoellReports // this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrTable3}); - this.Detail1.HeightF = 17F; + this.Detail1.HeightF = 25F; this.Detail1.Name = "Detail1"; this.Detail1.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.Detail1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; @@ -196,7 +200,7 @@ namespace BeWo.BetreutesWohnenWoellReports 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(674.9999F, 17F); + this.xrTable3.SizeF = new System.Drawing.SizeF(675F, 25F); this.xrTable3.StylePriority.UseFont = false; this.xrTable3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; // @@ -206,11 +210,12 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell13, this.xrTableCell14, this.xrTableCell16, - this.xrTableCell17}); + this.xrTableCell17, + this.xrTableCell2}); this.xrTableRow6.Name = "xrTableRow6"; this.xrTableRow6.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTableRow6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - this.xrTableRow6.Weight = 0.85D; + this.xrTableRow6.Weight = 0.78703753742202731D; // // xrTableCell13 // @@ -248,7 +253,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell16.StylePriority.UseTextAlignment = false; this.xrTableCell16.Text = "xrTableCell16"; this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell16.Weight = 0.30303017304321878D; + this.xrTableCell16.Weight = 0.16666665861053989D; // // xrTableCell17 // @@ -261,7 +266,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell17.StylePriority.UseTextAlignment = false; this.xrTableCell17.Text = "xrTableCell17"; this.xrTableCell17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell17.Weight = 0.1704545045180518D; + this.xrTableCell17.Weight = 0.12499999970715883D; // // GroupFooter1 // @@ -284,7 +289,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fieldFLSBillable", "{0:0.##}")}); this.xrLabel10.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold); - this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(539.9999F, 36F); + this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(396F, 36F); this.xrLabel10.Name = "xrLabel10"; this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 5, 0, 0, 100F); this.xrLabel10.SizeF = new System.Drawing.SizeF(135.0001F, 18.00003F); @@ -299,7 +304,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 36F); this.xrLabel8.Name = "xrLabel8"; this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel8.SizeF = new System.Drawing.SizeF(539.9999F, 18.00003F); + this.xrLabel8.SizeF = new System.Drawing.SizeF(351F, 18.00003F); this.xrLabel8.StylePriority.UseFont = false; this.xrLabel8.Text = "Summe unmittelbarer Betreuungsleistungen in Stunden"; // @@ -341,7 +346,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "TotalFLMBillable", "{0:0.##}")}); this.xrLabel4.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold); - this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(539.9999F, 0F); + this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(396F, 0F); this.xrLabel4.Name = "xrLabel4"; this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 5, 0, 0, 100F); this.xrLabel4.SizeF = new System.Drawing.SizeF(135.0001F, 18.00003F); @@ -356,14 +361,10 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); this.xrLabel3.Name = "xrLabel3"; this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel3.SizeF = new System.Drawing.SizeF(539.9999F, 18.00003F); + this.xrLabel3.SizeF = new System.Drawing.SizeF(351F, 18.00003F); this.xrLabel3.StylePriority.UseFont = false; this.xrLabel3.Text = "Summe unmittelbarer Betreuungsleistungen in Minuten"; // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); - // // formattingRuleStartDate // this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]"; @@ -614,6 +615,42 @@ namespace BeWo.BetreutesWohnenWoellReports this.fieldFLSBillable.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal; this.fieldFLSBillable.Name = "fieldFLSBillable"; // + // xrTableCell1 + // + this.xrTableCell1.Name = "xrTableCell1"; + this.xrTableCell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 2, 0, 0, 100F); + this.xrTableCell1.StylePriority.UsePadding = false; + this.xrTableCell1.Text = "Unterschrift"; + this.xrTableCell1.Weight = 0.35115722230643115D; + // + // xrTableCell2 + // + this.xrTableCell2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.picSignature}); + this.xrTableCell2.Name = "xrTableCell2"; + this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); + this.xrTableCell2.StylePriority.UsePadding = false; + this.xrTableCell2.StylePriority.UseTextAlignment = false; + this.xrTableCell2.Text = "xrTableCell2"; + this.xrTableCell2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.xrTableCell2.Weight = 0.18181817927995625D; + // + // 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(135F, 24F); + this.picSignature.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + this.picSignature.StylePriority.UseBorders = false; + this.picSignature.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.picSignature_BeforePrint); + // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); + // // QuittierungsbelegASL // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -697,5 +734,8 @@ namespace BeWo.BetreutesWohnenWoellReports private DevExpress.XtraReports.UI.XRLabel xrLabel8; private DevExpress.XtraReports.UI.CalculatedField fieldFLSBillable; private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; + private DevExpress.XtraReports.UI.XRPictureBox picSignature; } } diff --git a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.cs b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.cs index 97d924580..1918ffd36 100644 --- a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.cs +++ b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.cs @@ -5,6 +5,10 @@ using System.ComponentModel; using DevExpress.XtraReports.UI; using BeWo.Report.ReportObjects; using BeWo.Report; +using System.Text.RegularExpressions; +using System.Drawing; +using BS.Shared.Core; +using System.IO; namespace BeWo.BetreutesWohnenWoellReports { @@ -26,6 +30,7 @@ namespace BeWo.BetreutesWohnenWoellReports { if (s.IsBillable) { + ServicesOverviewRO.CreateSignatureString(s); total += s.Minutes; servicesBillable.Add(s); } @@ -38,5 +43,31 @@ namespace BeWo.BetreutesWohnenWoellReports this.bindingSource1.DataSource = pRO; } + + 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); + } + } } } diff --git a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.designer.cs b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.designer.cs index ca27c2a9d..124d20294 100644 --- a/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.designer.cs +++ b/ReportImp/BetreutesWohnenWoellReports/QuittierungsbelegFLS.designer.cs @@ -38,6 +38,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell4 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell2 = 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(); @@ -46,6 +47,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell17 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); @@ -81,6 +83,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.fieldAbrechenbareMinuten = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldFLSBillable = new DevExpress.XtraReports.UI.CalculatedField(); + this.picSignature = new DevExpress.XtraReports.UI.XRPictureBox(); ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); @@ -106,7 +109,7 @@ namespace BeWo.BetreutesWohnenWoellReports 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, 22F); + this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(672F, 22F); this.xrTableServiceRecords1.StylePriority.UseBackColor = false; this.xrTableServiceRecords1.StylePriority.UseFont = false; this.xrTableServiceRecords1.StylePriority.UseTextAlignment = false; @@ -118,7 +121,8 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell3, this.xrTableCell4, this.xrTableCell9, - this.xrTableCell12}); + this.xrTableCell12, + this.xrTableCell2}); this.xrTableRow2.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.xrTableRow2.Name = "xrTableRow2"; this.xrTableRow2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); @@ -152,7 +156,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell9.StylePriority.UseFont = false; this.xrTableCell9.StylePriority.UseTextAlignment = false; this.xrTableCell9.Text = "Personenzahl"; - this.xrTableCell9.Weight = 0.58526203379294373D; + this.xrTableCell9.Weight = 0.3218941929146843D; // // xrTableCell12 // @@ -162,7 +166,15 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell12.StylePriority.UseFont = false; this.xrTableCell12.StylePriority.UseTextAlignment = false; this.xrTableCell12.Text = "Minuten"; - this.xrTableCell12.Weight = 0.32920989590432559D; + this.xrTableCell12.Weight = 0.24142068144853554D; + // + // xrTableCell2 + // + this.xrTableCell2.Name = "xrTableCell2"; + this.xrTableCell2.Padding = new DevExpress.XtraPrinting.PaddingInfo(5, 2, 0, 0, 100F); + this.xrTableCell2.StylePriority.UsePadding = false; + this.xrTableCell2.Text = "Unterschrift"; + this.xrTableCell2.Weight = 0.34384135611062244D; // // DetailReport // @@ -180,7 +192,7 @@ namespace BeWo.BetreutesWohnenWoellReports // this.Detail1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrTable3}); - this.Detail1.HeightF = 17F; + this.Detail1.HeightF = 25F; this.Detail1.Name = "Detail1"; this.Detail1.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.Detail1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; @@ -196,7 +208,7 @@ namespace BeWo.BetreutesWohnenWoellReports 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(674.9999F, 17F); + this.xrTable3.SizeF = new System.Drawing.SizeF(672F, 25F); this.xrTable3.StylePriority.UseFont = false; this.xrTable3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; // @@ -206,11 +218,12 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell13, this.xrTableCell14, this.xrTableCell16, - this.xrTableCell17}); + this.xrTableCell17, + this.xrTableCell1}); this.xrTableRow6.Name = "xrTableRow6"; this.xrTableRow6.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); this.xrTableRow6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - this.xrTableRow6.Weight = 0.85D; + this.xrTableRow6.Weight = 1.25D; // // xrTableCell13 // @@ -248,7 +261,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell16.StylePriority.UseTextAlignment = false; this.xrTableCell16.Text = "xrTableCell16"; this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell16.Weight = 0.30303017304321878D; + this.xrTableCell16.Weight = 0.16666669714283369D; // // xrTableCell17 // @@ -261,7 +274,18 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrTableCell17.StylePriority.UseTextAlignment = false; this.xrTableCell17.Text = "xrTableCell17"; this.xrTableCell17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; - this.xrTableCell17.Weight = 0.1704545045180518D; + this.xrTableCell17.Weight = 0.12499995243419743D; + // + // xrTableCell1 + // + this.xrTableCell1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.picSignature}); + this.xrTableCell1.Name = "xrTableCell1"; + this.xrTableCell1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); + this.xrTableCell1.StylePriority.UsePadding = false; + this.xrTableCell1.StylePriority.UseTextAlignment = false; + this.xrTableCell1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.xrTableCell1.Weight = 0.17803027018512233D; // // GroupFooter1 // @@ -284,10 +308,10 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fieldFLSBillable", "{0:0.##}")}); this.xrLabel10.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold); - this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(539.9999F, 36F); + this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(414F, 36F); this.xrLabel10.Name = "xrLabel10"; this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 5, 0, 0, 100F); - this.xrLabel10.SizeF = new System.Drawing.SizeF(135.0001F, 18.00003F); + this.xrLabel10.SizeF = new System.Drawing.SizeF(117F, 18.00003F); this.xrLabel10.StylePriority.UseFont = false; this.xrLabel10.StylePriority.UsePadding = false; this.xrLabel10.StylePriority.UseTextAlignment = false; @@ -299,7 +323,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(0F, 36F); this.xrLabel8.Name = "xrLabel8"; this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel8.SizeF = new System.Drawing.SizeF(539.9999F, 18.00003F); + this.xrLabel8.SizeF = new System.Drawing.SizeF(360F, 18.00003F); this.xrLabel8.StylePriority.UseFont = false; this.xrLabel8.Text = "Summe unmittelbarer Betreuungsleistungen in Stunden"; // @@ -341,10 +365,10 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "TotalFLMBillable", "{0:0.##}")}); this.xrLabel4.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Bold); - this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(539.9999F, 0F); + this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(414F, 0F); this.xrLabel4.Name = "xrLabel4"; this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 5, 0, 0, 100F); - this.xrLabel4.SizeF = new System.Drawing.SizeF(135.0001F, 18.00003F); + this.xrLabel4.SizeF = new System.Drawing.SizeF(117F, 18.00003F); this.xrLabel4.StylePriority.UseFont = false; this.xrLabel4.StylePriority.UsePadding = false; this.xrLabel4.StylePriority.UseTextAlignment = false; @@ -356,7 +380,7 @@ namespace BeWo.BetreutesWohnenWoellReports this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); this.xrLabel3.Name = "xrLabel3"; this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel3.SizeF = new System.Drawing.SizeF(539.9999F, 18.00003F); + this.xrLabel3.SizeF = new System.Drawing.SizeF(360F, 18.00003F); this.xrLabel3.StylePriority.UseFont = false; this.xrLabel3.Text = "Summe unmittelbarer Betreuungsleistungen in Minuten"; // @@ -614,6 +638,18 @@ namespace BeWo.BetreutesWohnenWoellReports this.fieldFLSBillable.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal; this.fieldFLSBillable.Name = "fieldFLSBillable"; // + // 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(135F, 26.99998F); + this.picSignature.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; + this.picSignature.StylePriority.UseBorders = false; + this.picSignature.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.picSignature_BeforePrint); + // // QuittierungsbelegFLS // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -697,5 +733,8 @@ namespace BeWo.BetreutesWohnenWoellReports private DevExpress.XtraReports.UI.XRLabel xrLabel8; private DevExpress.XtraReports.UI.CalculatedField fieldFLSBillable; private DevExpress.XtraReports.UI.GroupFooterBand GroupFooter1; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell2; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell1; + private DevExpress.XtraReports.UI.XRPictureBox picSignature; } } diff --git a/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnung.cs b/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnung.cs index fc6dc57ae..7ec9f3669 100644 --- a/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnung.cs +++ b/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnung.cs @@ -1,38 +1,24 @@ using System; using System.Collections.Generic; +using System.Linq; using BeWo.Data.Entities; using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung { - public override bool ShouldCreateDayDetails() - { - return true; - } - - - public override MitarbeiterstundenkontoRO.DayDetail CreateDayDetail(DateTime date, MitarbeiterstundenkontoRO.EmployeeDetail ed) - { - var dd = base.CreateDayDetail(date, ed); - dd.MaxHoursUntilBreak = null; - dd.MaxHoursUntilBreak2 = null; - dd.BreakMinutes = null; - dd.BreakMinutes2 = null; - - return dd; - } - public override bool AddServiceRecordToDuration(ServiceRecord item) { if (item.ServiceDescription != null && item.ServiceDescription.ServiceCategory != null) { - if (item.ServiceDescription.ServiceCategory.Name == "Arbeitszeit") + if (item.ServiceDescription.Name != "Pause") { - if (item.ServiceDescription.Name == "Arbeitszeit") + if (item.ServiceDescription.ServiceCategory.Name == "Arbeitszeit") + { return true; + } } } return false; @@ -72,8 +58,15 @@ namespace GrundsteinEV { if (item.ServiceDescription.ServiceCategory.Name == "Arbeitszeit") { - if (item.ServiceDescription.Name == "Arbeitszeit") + + if (item.ServiceDescription.Name != "Pause") + { arbeitszeit += duration; + } + else + { + //arbeitszeit -= duration; + } } else if (item.ServiceDescription.ServiceCategory.IsBillable) { @@ -86,12 +79,123 @@ namespace GrundsteinEV } } - sum.IstAbrechenbar = flsGesamt; sum.IstNichtAbrechenbar = arbeitszeit - flsGesamt; - return sum; } + + public override MitarbeiterstundenkontoRO.EmployeeDetail BerechneUeberstundenBis(MitarbeiterstundenkontoRO.EmployeeDetail edOrig, IList records, DateTime monat, out decimal? ueberstunden, + out decimal alteExtraUeberstunden) + { + return base.BerechneUeberstundenBis(edOrig, records, monat, out ueberstunden, out alteExtraUeberstunden); + } + + public override IList CreateDayDetails(DateTime berichtStart, DateTime berichtEnde, MitarbeiterstundenkontoRO.EmployeeDetail ed, IList recordsAll) + { + var list = base.CreateDayDetails(berichtStart, berichtEnde, ed, recordsAll); + foreach (var dd in list) + { + dd.MinutesTotal = 0; + dd.SpecialHours = 0; + dd.PauseInMinuten = 0; + + foreach (var sr in recordsAll) + { + if (sr.Start.HasValue && sr.Start >= berichtStart && sr.Start < berichtEnde && sr.End.HasValue && sr.Start.Value.Day == dd.Date.Day) + { + decimal duration = GetDuration(sr); + + if (sr.ServiceDescription.Name == "Pause") + { + dd.PauseInMinuten += (decimal)sr.DurationMinutes; + + } + else if (sr.ServiceDescription.ServiceCategory.Name == "Arbeitszeit") + { + dd.MinutesTotal += (decimal)sr.DurationMinutes; + } + else if (sr.ServiceDescription.Name != "Arbeitszeit" && + sr.ServiceDescription.ServiceCategory.IsBillable) + { + dd.SpecialHours += (decimal)sr.DurationMinutes; + } + } + } + + if (dd.PauseInMinuten > 0) + { + dd.MinutesTotal -= dd.PauseInMinuten; + if (dd.MinutesTotal < 0) + { + dd.MinutesTotal = 0; + } + } + } + return list; + } + + private decimal GetDuration(ServiceRecord sr) + { + decimal duration = 0; + + if (sr.GroupRoundedDuration.HasValue) + { + duration = sr.GroupRoundedDuration.Value; + } + else + { + duration = sr.RoundedDuration; + } + + return duration; + } + + public override bool SollPauseBerechnen() + { + return true; + } + + public override bool ShouldCreateDayDetails() + { + return true; + } + + public override MitarbeiterstundenkontoRO.DayDetail CreateDayDetail(DateTime date, MitarbeiterstundenkontoRO.EmployeeDetail ed) + { + var dd = base.CreateDayDetail(date, ed); + dd.MaxHoursUntilBreak = null; + dd.MaxHoursUntilBreak2 = null; + dd.BreakMinutes = null; + dd.BreakMinutes2 = null; + return dd; + } + + public override decimal BerechnePauseMinuten(IList srListAlle) + { + var srList = srListAlle.Where(s => s.ServiceDescription.ServiceCategory.Name == "Arbeitszeit"); + decimal pausenZeit = 0; + + List pausen = new List(); + List nichtpausen = new List(); + + foreach (var sr in srList) + { + if (sr.ServiceDescription.Name == "Pause") + { + pausen.Add(sr); + } + else + { + nichtpausen.Add(sr); + } + } + + foreach (var pause in pausen) + { + pausenZeit += pause.RoundedDuration; + } + return pausenZeit; + } } -} +} \ No newline at end of file diff --git a/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnungMonate.cs b/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnungMonate.cs index 0119c3c1e..6faae53a0 100644 --- a/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnungMonate.cs +++ b/ReportImp/SHKService/CustomMitarbeiterstundenkontoBerechnungMonate.cs @@ -7,7 +7,7 @@ using BeWo.Data.Entities; using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { public class CustomMitarbeiterstundenkontoBerechnungMonate : MitarbeiterstundenkontoBerechnungMonate { diff --git a/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.cs b/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.cs index 614387a53..76155dcd2 100644 --- a/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.cs +++ b/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.cs @@ -4,11 +4,10 @@ using System.Collections.Generic; using System.Linq; using BeWo.Report; using BeWo.Report.ReportObjects; - using BS.Shared.Core; using DevExpress.XtraReports.UI; -namespace GrundsteinEV +namespace SHKService { [IDSpecificClass(Identifier = "Mitarbeiterarbeitszeitkonto")] public partial class Mitarbeiterarbeitszeitkonto : DevExpress.XtraReports.UI.XtraReport, IBeWoReport @@ -43,11 +42,9 @@ namespace GrundsteinEV foreach (var day in ed.Days) { ed.UrlaubUndKrankheit += (day.HoursSick + day.HoursInVacation); - } - + } } this.bindingSource1.DataSource = pRO; - } - + } } } diff --git a/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.designer.cs b/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.designer.cs index 093c462ab..f0c0d7654 100644 --- a/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.designer.cs +++ b/ReportImp/SHKService/Mitarbeiterarbeitszeitkonto.designer.cs @@ -1,5 +1,5 @@ using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { partial class Mitarbeiterarbeitszeitkonto { diff --git a/ReportImp/SHKService/Mitarbeiterstundenkonto.cs b/ReportImp/SHKService/Mitarbeiterstundenkonto.cs index ed6e33a35..ee33b9a66 100644 --- a/ReportImp/SHKService/Mitarbeiterstundenkonto.cs +++ b/ReportImp/SHKService/Mitarbeiterstundenkonto.cs @@ -4,13 +4,11 @@ using BeWo.Report.ReportObjects; using BS.Shared.Core; -namespace GrundsteinEV +namespace SHKService { [IDSpecificClass(Identifier = "Mitarbeiterstundenkonto")] public partial class Mitarbeiterstundenkonto : DevExpress.XtraReports.UI.XtraReport, IBeWoReport { - - public Mitarbeiterstundenkonto() { InitializeComponent(); @@ -23,6 +21,5 @@ namespace GrundsteinEV this.bindingSource1.DataSource = pRO; } - } } diff --git a/ReportImp/SHKService/Mitarbeiterstundenkonto.designer.cs b/ReportImp/SHKService/Mitarbeiterstundenkonto.designer.cs index d8fede237..e9b21615a 100644 --- a/ReportImp/SHKService/Mitarbeiterstundenkonto.designer.cs +++ b/ReportImp/SHKService/Mitarbeiterstundenkonto.designer.cs @@ -1,5 +1,5 @@ using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { partial class Mitarbeiterstundenkonto { diff --git a/ReportImp/SHKService/MitarbeiterstundenkontoJahr.cs b/ReportImp/SHKService/MitarbeiterstundenkontoJahr.cs index 0e8d3803c..5795e1981 100644 --- a/ReportImp/SHKService/MitarbeiterstundenkontoJahr.cs +++ b/ReportImp/SHKService/MitarbeiterstundenkontoJahr.cs @@ -4,13 +4,11 @@ using BeWo.Report.ReportObjects; using BS.Shared.Core; -namespace GrundsteinEV +namespace SHKService { [IDSpecificClass(Identifier = "MitarbeiterstundenkontoJahr")] public partial class MitarbeiterstundenkontoJahr : DevExpress.XtraReports.UI.XtraReport, IBeWoReport { - - public MitarbeiterstundenkontoJahr() { InitializeComponent(); @@ -23,6 +21,5 @@ namespace GrundsteinEV this.bindingSource1.DataSource = pRO; } - } } diff --git a/ReportImp/SHKService/MitarbeiterstundenkontoJahr.designer.cs b/ReportImp/SHKService/MitarbeiterstundenkontoJahr.designer.cs index e49727820..74df77c79 100644 --- a/ReportImp/SHKService/MitarbeiterstundenkontoJahr.designer.cs +++ b/ReportImp/SHKService/MitarbeiterstundenkontoJahr.designer.cs @@ -1,5 +1,5 @@ using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { partial class MitarbeiterstundenkontoJahr { diff --git a/ReportImp/SHKService/Teamstundenkonto.cs b/ReportImp/SHKService/Teamstundenkonto.cs index 67f034131..374fda460 100644 --- a/ReportImp/SHKService/Teamstundenkonto.cs +++ b/ReportImp/SHKService/Teamstundenkonto.cs @@ -4,7 +4,7 @@ using BeWo.Report.ReportObjects; using BS.Shared.Core; -namespace GrundsteinEV +namespace SHKService { [IDSpecificClass(Identifier = "Teamstundenkonto")] public partial class Teamstundenkonto : DevExpress.XtraReports.UI.XtraReport, IBeWoReport diff --git a/ReportImp/SHKService/Teamstundenkonto.designer.cs b/ReportImp/SHKService/Teamstundenkonto.designer.cs index 516ddaa0b..84bad41fe 100644 --- a/ReportImp/SHKService/Teamstundenkonto.designer.cs +++ b/ReportImp/SHKService/Teamstundenkonto.designer.cs @@ -1,5 +1,5 @@ using BeWo.Report.ReportObjects; -namespace GrundsteinEV +namespace SHKService { partial class Teamstundenkonto {