diff --git a/ReportImp/Biotop/ServiceInvoiceReport.Designer.cs b/ReportImp/Biotop/ServiceInvoiceReport.Designer.cs index 7fd82394e..ea7f6de92 100644 --- a/ReportImp/Biotop/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/Biotop/ServiceInvoiceReport.Designer.cs @@ -36,6 +36,11 @@ namespace Biotop this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand(); this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.xrLabel21 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel20 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel19 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel(); this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); @@ -82,16 +87,12 @@ namespace Biotop this.xrTableCell44 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell45 = new DevExpress.XtraReports.UI.XRTableCell(); this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); - this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel19 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel20 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel21 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel12 = new DevExpress.XtraReports.UI.XRLabel(); + this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.calculatedField1 = new DevExpress.XtraReports.UI.CalculatedField(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable6)).BeginInit(); @@ -152,6 +153,81 @@ namespace Biotop this.Page1.Name = "Page1"; this.Page1.StylePriority.UseFont = false; // + // xrLabel21 + // + this.xrLabel21.BackColor = System.Drawing.Color.Transparent; + this.xrLabel21.CanShrink = true; + this.xrLabel21.Font = new System.Drawing.Font("Verdana", 9.75F); + this.xrLabel21.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 371.8751F); + this.xrLabel21.Multiline = true; + this.xrLabel21.Name = "xrLabel21"; + this.xrLabel21.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel21.SizeF = new System.Drawing.SizeF(256.25F, 20F); + this.xrLabel21.StylePriority.UseBackColor = false; + this.xrLabel21.StylePriority.UseFont = false; + this.xrLabel21.Text = "[CustomerReferenceNumber]"; + this.xrLabel21.WordWrap = false; + // + // xrLabel16 + // + this.xrLabel16.BackColor = System.Drawing.Color.Transparent; + this.xrLabel16.CanShrink = true; + this.xrLabel16.Font = new System.Drawing.Font("Verdana", 9.75F); + this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(3.178914E-05F, 351.875F); + this.xrLabel16.Multiline = true; + this.xrLabel16.Name = "xrLabel16"; + this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel16.SizeF = new System.Drawing.SizeF(178.125F, 20F); + this.xrLabel16.StylePriority.UseBackColor = false; + this.xrLabel16.StylePriority.UseFont = false; + this.xrLabel16.Text = "Geb. Datum:"; + this.xrLabel16.WordWrap = false; + // + // xrLabel20 + // + this.xrLabel20.BackColor = System.Drawing.Color.Transparent; + this.xrLabel20.CanShrink = true; + this.xrLabel20.Font = new System.Drawing.Font("Verdana", 9.75F); + this.xrLabel20.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 351.8751F); + this.xrLabel20.Multiline = true; + this.xrLabel20.Name = "xrLabel20"; + this.xrLabel20.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel20.SizeF = new System.Drawing.SizeF(256.25F, 20F); + this.xrLabel20.StylePriority.UseBackColor = false; + this.xrLabel20.StylePriority.UseFont = false; + this.xrLabel20.Text = "[CustomerBirthdate!dd.MM.yyyy]"; + this.xrLabel20.WordWrap = false; + // + // xrLabel19 + // + this.xrLabel19.BackColor = System.Drawing.Color.Transparent; + this.xrLabel19.CanShrink = true; + this.xrLabel19.Font = new System.Drawing.Font("Verdana", 9.75F); + this.xrLabel19.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 331.875F); + this.xrLabel19.Multiline = true; + this.xrLabel19.Name = "xrLabel19"; + this.xrLabel19.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel19.SizeF = new System.Drawing.SizeF(256.25F, 20F); + this.xrLabel19.StylePriority.UseBackColor = false; + this.xrLabel19.StylePriority.UseFont = false; + this.xrLabel19.Text = "[CustomerName]"; + this.xrLabel19.WordWrap = false; + // + // xrLabel17 + // + this.xrLabel17.BackColor = System.Drawing.Color.Transparent; + this.xrLabel17.CanShrink = true; + this.xrLabel17.Font = new System.Drawing.Font("Verdana", 9.75F); + this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(0F, 371.875F); + this.xrLabel17.Multiline = true; + this.xrLabel17.Name = "xrLabel17"; + this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel17.SizeF = new System.Drawing.SizeF(178.125F, 20F); + this.xrLabel17.StylePriority.UseBackColor = false; + this.xrLabel17.StylePriority.UseFont = false; + this.xrLabel17.Text = "Aktenzeichen: "; + this.xrLabel17.WordWrap = false; + // // xrLabel8 // this.xrLabel8.Font = new System.Drawing.Font("Verdana", 9F); @@ -725,6 +801,43 @@ namespace Biotop this.GroupFooter1.HeightF = 305.5417F; this.GroupFooter1.Name = "GroupFooter1"; // + // xrLabel13 + // + this.xrLabel13.Borders = DevExpress.XtraPrinting.BorderSide.Top; + this.xrLabel13.Font = new System.Drawing.Font("Verdana", 10F); + this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(292.1458F, 161.7916F); + this.xrLabel13.Name = "xrLabel13"; + this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel13.SizeF = new System.Drawing.SizeF(349.8542F, 17F); + this.xrLabel13.StylePriority.UseBorders = false; + this.xrLabel13.StylePriority.UseFont = false; + this.xrLabel13.Text = "Stempel, rechtsverbindliche Unterschrift"; + // + // xrLabel9 + // + this.xrLabel9.Borders = DevExpress.XtraPrinting.BorderSide.Top; + this.xrLabel9.Font = new System.Drawing.Font("Verdana", 10F); + this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(0F, 161.7916F); + this.xrLabel9.Name = "xrLabel9"; + this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel9.SizeF = new System.Drawing.SizeF(213.5417F, 17F); + this.xrLabel9.StylePriority.UseBorders = false; + this.xrLabel9.StylePriority.UseFont = false; + this.xrLabel9.Text = "Ort, Datum"; + // + // xrLabel12 + // + this.xrLabel12.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold); + this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrLabel12.Name = "xrLabel12"; + this.xrLabel12.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); + this.xrLabel12.SizeF = new System.Drawing.SizeF(270.0416F, 25F); + this.xrLabel12.StylePriority.UseFont = false; + this.xrLabel12.StylePriority.UsePadding = false; + this.xrLabel12.StylePriority.UseTextAlignment = false; + this.xrLabel12.Text = "Rechnungsbetrag"; + this.xrLabel12.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + // // xrLabel1 // this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { @@ -740,122 +853,15 @@ namespace Biotop this.xrLabel1.Text = "xrLabel1"; this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; // - // xrLabel12 - // - this.xrLabel12.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold); - this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); - this.xrLabel12.Name = "xrLabel12"; - this.xrLabel12.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); - this.xrLabel12.SizeF = new System.Drawing.SizeF(270.0416F, 25F); - this.xrLabel12.StylePriority.UseFont = false; - this.xrLabel12.StylePriority.UsePadding = false; - this.xrLabel12.StylePriority.UseTextAlignment = false; - this.xrLabel12.Text = "Rechnungsbetrag"; - this.xrLabel12.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - // - // xrLabel9 - // - this.xrLabel9.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.xrLabel9.Font = new System.Drawing.Font("Verdana", 10F); - this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(0F, 161.7916F); - this.xrLabel9.Name = "xrLabel9"; - this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel9.SizeF = new System.Drawing.SizeF(213.5417F, 17F); - this.xrLabel9.StylePriority.UseBorders = false; - this.xrLabel9.StylePriority.UseFont = false; - this.xrLabel9.Text = "Ort, Datum"; - // - // xrLabel13 - // - this.xrLabel13.Borders = DevExpress.XtraPrinting.BorderSide.Top; - this.xrLabel13.Font = new System.Drawing.Font("Verdana", 10F); - this.xrLabel13.LocationFloat = new DevExpress.Utils.PointFloat(292.1458F, 161.7916F); - this.xrLabel13.Name = "xrLabel13"; - this.xrLabel13.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel13.SizeF = new System.Drawing.SizeF(349.8542F, 17F); - this.xrLabel13.StylePriority.UseBorders = false; - this.xrLabel13.StylePriority.UseFont = false; - this.xrLabel13.Text = "Stempel, rechtsverbindliche Unterschrift"; - // - // xrLabel17 - // - this.xrLabel17.BackColor = System.Drawing.Color.Transparent; - this.xrLabel17.CanShrink = true; - this.xrLabel17.Font = new System.Drawing.Font("Verdana", 9.75F); - this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(0F, 371.875F); - this.xrLabel17.Multiline = true; - this.xrLabel17.Name = "xrLabel17"; - this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel17.SizeF = new System.Drawing.SizeF(178.125F, 20F); - this.xrLabel17.StylePriority.UseBackColor = false; - this.xrLabel17.StylePriority.UseFont = false; - this.xrLabel17.Text = "Aktenzeichen: "; - this.xrLabel17.WordWrap = false; - // - // xrLabel19 - // - this.xrLabel19.BackColor = System.Drawing.Color.Transparent; - this.xrLabel19.CanShrink = true; - this.xrLabel19.Font = new System.Drawing.Font("Verdana", 9.75F); - this.xrLabel19.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 331.875F); - this.xrLabel19.Multiline = true; - this.xrLabel19.Name = "xrLabel19"; - this.xrLabel19.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel19.SizeF = new System.Drawing.SizeF(256.25F, 20F); - this.xrLabel19.StylePriority.UseBackColor = false; - this.xrLabel19.StylePriority.UseFont = false; - this.xrLabel19.Text = "[CustomerName]"; - this.xrLabel19.WordWrap = false; - // - // xrLabel16 - // - this.xrLabel16.BackColor = System.Drawing.Color.Transparent; - this.xrLabel16.CanShrink = true; - this.xrLabel16.Font = new System.Drawing.Font("Verdana", 9.75F); - this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(3.178914E-05F, 351.875F); - this.xrLabel16.Multiline = true; - this.xrLabel16.Name = "xrLabel16"; - this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel16.SizeF = new System.Drawing.SizeF(178.125F, 20F); - this.xrLabel16.StylePriority.UseBackColor = false; - this.xrLabel16.StylePriority.UseFont = false; - this.xrLabel16.Text = "Geb. Datum:"; - this.xrLabel16.WordWrap = false; - // - // xrLabel20 - // - this.xrLabel20.BackColor = System.Drawing.Color.Transparent; - this.xrLabel20.CanShrink = true; - this.xrLabel20.Font = new System.Drawing.Font("Verdana", 9.75F); - this.xrLabel20.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 351.8751F); - this.xrLabel20.Multiline = true; - this.xrLabel20.Name = "xrLabel20"; - this.xrLabel20.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel20.SizeF = new System.Drawing.SizeF(256.25F, 20F); - this.xrLabel20.StylePriority.UseBackColor = false; - this.xrLabel20.StylePriority.UseFont = false; - this.xrLabel20.Text = "[CustomerBirthdate!dd.MM.yyyy]"; - this.xrLabel20.WordWrap = false; - // - // xrLabel21 - // - this.xrLabel21.BackColor = System.Drawing.Color.Transparent; - this.xrLabel21.CanShrink = true; - this.xrLabel21.Font = new System.Drawing.Font("Verdana", 9.75F); - this.xrLabel21.LocationFloat = new DevExpress.Utils.PointFloat(178.125F, 371.8751F); - this.xrLabel21.Multiline = true; - this.xrLabel21.Name = "xrLabel21"; - this.xrLabel21.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel21.SizeF = new System.Drawing.SizeF(256.25F, 20F); - this.xrLabel21.StylePriority.UseBackColor = false; - this.xrLabel21.StylePriority.UseFont = false; - this.xrLabel21.Text = "[CustomerReferenceNumber]"; - this.xrLabel21.WordWrap = false; - // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); // + // calculatedField1 + // + this.calculatedField1.DataMember = "ServiceInvoicePeriods.ServiceInvoiceItems"; + this.calculatedField1.Name = "calculatedField1"; + // // ServiceInvoiceReport // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -865,6 +871,8 @@ namespace Biotop this.bottomMarginBand1, this.Page1, this.DetailReport}); + this.CalculatedFields.AddRange(new DevExpress.XtraReports.UI.CalculatedField[] { + this.calculatedField1}); this.DataSource = this.bindingSource1; this.ExportOptions.PrintPreview.DefaultFileName = "Spitzabrechnung"; this.Font = new System.Drawing.Font("Verdana", 10F); @@ -947,5 +955,6 @@ namespace Biotop private DevExpress.XtraReports.UI.XRLabel xrLabel20; private DevExpress.XtraReports.UI.XRLabel xrLabel19; private DevExpress.XtraReports.UI.XRLabel xrLabel17; + private DevExpress.XtraReports.UI.CalculatedField calculatedField1; } } diff --git a/ReportImp/Biotop/ServiceInvoiceReport.cs b/ReportImp/Biotop/ServiceInvoiceReport.cs index 0fb16e31d..759b1b680 100644 --- a/ReportImp/Biotop/ServiceInvoiceReport.cs +++ b/ReportImp/Biotop/ServiceInvoiceReport.cs @@ -17,7 +17,31 @@ namespace Biotop { DateTime start = pRO.AccountingPeriodStart; DateTime end = pRO.AccountingPeriodEnd; - if (start.Month == end.Month && start.Year == end.Year) + //auf deren Wunsch den Faktor in die Stundenzahl einmultipliziert... + decimal rateFactor = 1; + if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0) + { + foreach (var p in pRO.ServiceInvoicePeriods) + { + if (p.ServiceInvoiceItems != null && p.ServiceInvoiceItems.Count > 0) + { + foreach (var i in p.ServiceInvoiceItems) + { + if (!String.IsNullOrEmpty(i.RateFactor)) + { + var rfStr = i.RateFactor.Replace("%", "").Replace(",00", "").Trim(); + int rfInt = 0; + Int32.TryParse(rfStr, out rfInt); + + rateFactor = (100m + rfInt) / 100m; + if (i.Hours.HasValue) + i.Hours *= rateFactor; + } + } + } + } + } + if (start.Month == end.Month && start.Year == end.Year) { lblAbrechnungszeitraum.Text = String.Format("Abrechnungszeitraum {0:MMMM yyyy}", start); }