diff --git a/ReportImp/AlzeyTeilhabe/AlzeyTeilhabe.csproj b/ReportImp/AlzeyTeilhabe/AlzeyTeilhabe.csproj index d5ada93df..0bbc9e4c7 100644 --- a/ReportImp/AlzeyTeilhabe/AlzeyTeilhabe.csproj +++ b/ReportImp/AlzeyTeilhabe/AlzeyTeilhabe.csproj @@ -61,6 +61,7 @@ RechnungPa.cs + Component diff --git a/ReportImp/AlzeyTeilhabe/Invoicing/DefaultInvoiceCreation.cs b/ReportImp/AlzeyTeilhabe/Invoicing/DefaultInvoiceCreation.cs index 011ebc2e6..bf80dc1b8 100644 --- a/ReportImp/AlzeyTeilhabe/Invoicing/DefaultInvoiceCreation.cs +++ b/ReportImp/AlzeyTeilhabe/Invoicing/DefaultInvoiceCreation.cs @@ -75,6 +75,72 @@ namespace AlzeyTeilhabe.Invoicing return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result; } + public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, + CompactSupportConceptDC supportConcept, List serviceRecords) + { + var s = base.CreateSingleInvoice(invoiceCounter, costBearer, invoicePeriod, supportConcept, serviceRecords); + + SetAmountEquityContribution(s); + if (s.AmountEquityContribution != null && s.AmountEquityContribution != 0) + { + foreach (var sipl in s.ServiceInvoicePeriodList) + { + if (sipl == s.ServiceInvoicePeriodList.Last()) + { + sipl.InvoiceItemList.Add(new InvoiceItem() + { + AmountPerUnit = s.AmountEquityContribution.Value, + AmountTotal = s.AmountEquityContribution.Value, + GrossAmountTotal = s.AmountEquityContribution.Value, + ItemDescription = "Eigenanteil", + ItemPeriodStart = sipl.Start, + ItemPeriodEnd = sipl.End, + RateFactor = null, + UnitCount = 1, + UnitDescription = "Eigenanteil" + }); + } + } + } + + return s; + } + + public override void SetAmountEquityContribution(ServiceInvoice invoice) + { + decimal equity = 0; + + IList EquityInvoiceList = + DAOFactory.SearchDAO.GetInvoiceBaseByTypeAndSupportConceptOid(InvoiceType.CustomerEquity, invoice.InvoiceBase.SupportConceptOid.Value); + + var list = new List(); + + foreach (var ib in EquityInvoiceList) + { + if (ib.AccountingPeriodStart.HasValue && ib.AccountingPeriodEnd.HasValue) + { + if (ib.AccountingPeriodStart <= invoice.InvoiceBase.AccountingPeriodEnd && + ib.AccountingPeriodEnd >= invoice.InvoiceBase.AccountingPeriodStart) + { + list.Add(ib); + } + } + } + + foreach (InvoiceBase iEquityInvoice in list) + { + foreach (InvoiceItem item in iEquityInvoice.InvoiceItems) + { + if (item.AmountTotal != null) + { + equity += item.AmountTotal.Value; + } + } + } + + invoice.AmountEquityContribution = equity; + } + public override IList CreateSummaryInvoiceItems(IList itemList, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc) { diff --git a/ReportImp/AlzeyTeilhabe/RechnungPa.Designer.cs b/ReportImp/AlzeyTeilhabe/RechnungPa.Designer.cs index 63911efcb..0eb16d2c4 100644 --- a/ReportImp/AlzeyTeilhabe/RechnungPa.Designer.cs +++ b/ReportImp/AlzeyTeilhabe/RechnungPa.Designer.cs @@ -54,6 +54,7 @@ namespace AlzeyTeilhabe this.xrPictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox(); this.xrRichText2 = new DevExpress.XtraReports.UI.XRRichText(); this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); + this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -89,7 +90,6 @@ namespace AlzeyTeilhabe this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit(); @@ -333,6 +333,19 @@ namespace AlzeyTeilhabe this.Page1.Name = "Page1"; this.Page1.StylePriority.UseFont = false; // + // xrLabel8 + // + this.xrLabel8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "AccountingPeriodEnd", "{0:dd.MM.yyyy}")}); + this.xrLabel8.Font = new System.Drawing.Font("Arial", 12F); + this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(419.7223F, 263.9127F); + this.xrLabel8.Name = "xrLabel8"; + this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.xrLabel8.SizeF = new System.Drawing.SizeF(257.2777F, 19.99994F); + this.xrLabel8.StylePriority.UseFont = false; + this.xrLabel8.StylePriority.UseTextAlignment = false; + this.xrLabel8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // // xrTable1 // this.xrTable1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -734,18 +747,6 @@ namespace AlzeyTeilhabe this.xrLabel1.StylePriority.UseTextAlignment = false; this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; // - // xrLabel8 - // - this.xrLabel8.Font = new System.Drawing.Font("Arial", 12F); - this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(419.7223F, 263.9127F); - this.xrLabel8.Name = "xrLabel8"; - this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel8.SizeF = new System.Drawing.SizeF(257.2777F, 19.99994F); - this.xrLabel8.StylePriority.UseFont = false; - this.xrLabel8.StylePriority.UseTextAlignment = false; - this.xrLabel8.Text = "[InvoiceDate]"; - this.xrLabel8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); diff --git a/ReportImp/AlzeyTeilhabe/RechnungPa.cs b/ReportImp/AlzeyTeilhabe/RechnungPa.cs index 08a279bba..f610fff93 100644 --- a/ReportImp/AlzeyTeilhabe/RechnungPa.cs +++ b/ReportImp/AlzeyTeilhabe/RechnungPa.cs @@ -61,6 +61,13 @@ namespace AlzeyTeilhabe foreach (var ii in sip.ServiceInvoiceItems) { ii.UnitCountString = String.Format("{0:0.00}", ii.UnitCount); + if (ii.ServiceDescription == "Eigenanteil") + { + ii.GrossAmount = "-" + ii.GrossAmount; + string[] grossClaimStringArray = pRO.GrossClaim.Split(' '); + var grossClaimOhneEigenanteil = Convert.ToDecimal(grossClaimStringArray[0]) - ii.AmountPerUnit; + pRO.GrossClaim = string.Format("{0:0.00} €", grossClaimOhneEigenanteil); + } } } this.bindingSource1.DataSource = pRO; diff --git a/ReportImp/AlzeyTeilhabe/Service/CustomSaveInterceptor.cs b/ReportImp/AlzeyTeilhabe/Service/CustomSaveInterceptor.cs new file mode 100644 index 000000000..08f6dbc70 --- /dev/null +++ b/ReportImp/AlzeyTeilhabe/Service/CustomSaveInterceptor.cs @@ -0,0 +1,19 @@ +using BeWo.Data.Entities; +using BeWo.Service.Plugins; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AlzeyTeilhabe.Service +{ + public class CustomSaveInterceptor : SaveInterceptor + { + public override void BeforeSaveServiceRecord(ServiceRecord sr) + { + if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("fahrt")) + sr.DistanceInMeter = sr.Customer.DistanceInMeter; + } + } +} diff --git a/ReportImp/AlzeyTeilhabe/StundenzettelSoziotherapie.Designer.cs b/ReportImp/AlzeyTeilhabe/StundenzettelSoziotherapie.Designer.cs index 2bd89ccc4..8360aeaf0 100644 --- a/ReportImp/AlzeyTeilhabe/StundenzettelSoziotherapie.Designer.cs +++ b/ReportImp/AlzeyTeilhabe/StundenzettelSoziotherapie.Designer.cs @@ -51,6 +51,7 @@ namespace AlzeyTeilhabe this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); @@ -62,9 +63,11 @@ namespace AlzeyTeilhabe this.xrLabel21 = new DevExpress.XtraReports.UI.XRLabel(); this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel(); - this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo(); - this.piPage = new DevExpress.XtraReports.UI.XRPageInfo(); this.ReportFooter = new DevExpress.XtraReports.UI.ReportFooterBand(); + this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); + this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); + this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); + this.lblGesamtpreis = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTable1 = new DevExpress.XtraReports.UI.XRTable(); this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell(); @@ -74,16 +77,12 @@ namespace AlzeyTeilhabe this.fieldAbrechenbareFLS = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldStunden = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldTotalSum = new DevExpress.XtraReports.UI.CalculatedField(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); - this.xrTable2 = new DevExpress.XtraReports.UI.XRTable(); - this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow(); - this.lblGesamtpreis = new DevExpress.XtraReports.UI.XRTableCell(); - this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel(); ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // Detail @@ -343,6 +342,10 @@ namespace AlzeyTeilhabe this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; this.xrTableCell16.Weight = 0.11742309062325153D; // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); + // // formattingRuleStartDate // this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]"; @@ -394,6 +397,7 @@ namespace AlzeyTeilhabe // topMarginBand1 // this.topMarginBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.xrLabel3, this.lblVersichertennummer, this.xrLabel21, this.xrLabel1}); @@ -431,9 +435,7 @@ namespace AlzeyTeilhabe // bottomMarginBand1 // this.bottomMarginBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { - this.xrLabel2, - this.xrPageInfo1, - this.piPage}); + this.xrLabel2}); this.bottomMarginBand1.HeightF = 98.95837F; this.bottomMarginBand1.Name = "bottomMarginBand1"; // @@ -451,24 +453,6 @@ namespace AlzeyTeilhabe "kumentation"; this.xrLabel2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft; // - // xrPageInfo1 - // - this.xrPageInfo1.Format = "{0:dd.MM.yyyy}"; - this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(871.9999F, 50.33331F); - this.xrPageInfo1.Name = "xrPageInfo1"; - this.xrPageInfo1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrPageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime; - this.xrPageInfo1.SizeF = new System.Drawing.SizeF(100F, 23F); - // - // piPage - // - this.piPage.LocationFloat = new DevExpress.Utils.PointFloat(971.9999F, 50.33331F); - this.piPage.Name = "piPage"; - this.piPage.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.piPage.SizeF = new System.Drawing.SizeF(100F, 23F); - this.piPage.StylePriority.UseTextAlignment = false; - this.piPage.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; - // // ReportFooter // this.ReportFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { @@ -479,6 +463,49 @@ namespace AlzeyTeilhabe this.ReportFooter.Name = "ReportFooter"; this.ReportFooter.StylePriority.UseFont = false; // + // xrTable2 + // + this.xrTable2.BorderColor = System.Drawing.Color.Black; + this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) + | DevExpress.XtraPrinting.BorderSide.Bottom))); + this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(802.0005F, 0F); + this.xrTable2.Name = "xrTable2"; + this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { + this.xrTableRow3}); + this.xrTable2.SizeF = new System.Drawing.SizeF(177.0001F, 40F); + this.xrTable2.StylePriority.UseFont = false; + this.xrTable2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + // + // xrTableRow3 + // + this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.xrTableCell6, + this.lblGesamtpreis}); + this.xrTableRow3.Name = "xrTableRow3"; + this.xrTableRow3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); + this.xrTableRow3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; + this.xrTableRow3.Weight = 2D; + // + // xrTableCell6 + // + this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.Right; + this.xrTableCell6.Name = "xrTableCell6"; + this.xrTableCell6.StylePriority.UseBorders = false; + this.xrTableCell6.StylePriority.UseTextAlignment = false; + this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; + this.xrTableCell6.Weight = 0.11174248242405439D; + // + // lblGesamtpreis + // + this.lblGesamtpreis.Name = "lblGesamtpreis"; + this.lblGesamtpreis.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); + this.lblGesamtpreis.StylePriority.UseFont = false; + this.lblGesamtpreis.StylePriority.UsePadding = false; + this.lblGesamtpreis.StylePriority.UseTextAlignment = false; + this.lblGesamtpreis.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; + this.lblGesamtpreis.Weight = 0.11174248242405439D; + // // xrTable1 // this.xrTable1.BorderColor = System.Drawing.Color.Black; @@ -554,52 +581,17 @@ namespace AlzeyTeilhabe this.fieldTotalSum.Expression = "Round([TotalFLMBillable] / 60, 2) * [RateFactor]"; this.fieldTotalSum.Name = "fieldTotalSum"; // - // bindingSource1 + // xrLabel3 // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO); - // - // xrTable2 - // - this.xrTable2.BorderColor = System.Drawing.Color.Black; - this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right) - | DevExpress.XtraPrinting.BorderSide.Bottom))); - this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(802.0005F, 0F); - this.xrTable2.Name = "xrTable2"; - this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); - this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { - this.xrTableRow3}); - this.xrTable2.SizeF = new System.Drawing.SizeF(177.0001F, 40F); - this.xrTable2.StylePriority.UseFont = false; - this.xrTable2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - // - // xrTableRow3 - // - this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { - this.xrTableCell6, - this.lblGesamtpreis}); - this.xrTableRow3.Name = "xrTableRow3"; - this.xrTableRow3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F); - this.xrTableRow3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft; - this.xrTableRow3.Weight = 2D; - // - // lblGesamtpreis - // - this.lblGesamtpreis.Name = "lblGesamtpreis"; - this.lblGesamtpreis.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F); - this.lblGesamtpreis.StylePriority.UseFont = false; - this.lblGesamtpreis.StylePriority.UsePadding = false; - this.lblGesamtpreis.StylePriority.UseTextAlignment = false; - this.lblGesamtpreis.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft; - this.lblGesamtpreis.Weight = 0.11174248242405439D; - // - // xrTableCell6 - // - this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.Right; - this.xrTableCell6.Name = "xrTableCell6"; - this.xrTableCell6.StylePriority.UseBorders = false; - this.xrTableCell6.StylePriority.UseTextAlignment = false; - this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter; - this.xrTableCell6.Weight = 0.11174248242405439D; + this.xrLabel3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CostBearer2SupportConceptList.CostBearer.Organisation.Name")}); + this.xrLabel3.Font = new System.Drawing.Font("Arial", 11F); + this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(788.8334F, 53.75001F); + this.xrLabel3.Name = "xrLabel3"; + this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); + this.xrLabel3.SizeF = new System.Drawing.SizeF(273.1666F, 34.79166F); + this.xrLabel3.StylePriority.UseFont = false; + this.xrLabel3.Text = "xrLabel3"; // // StundenzettelSoziotherapie // @@ -631,9 +623,9 @@ namespace AlzeyTeilhabe this.Version = "17.1"; ((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } @@ -683,11 +675,10 @@ namespace AlzeyTeilhabe private DevExpress.XtraReports.UI.XRTableCell xrTableCell15; private DevExpress.XtraReports.UI.XRTableCell xrTableCell16; private DevExpress.XtraReports.UI.XRLabel xrLabel2; - private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1; - private DevExpress.XtraReports.UI.XRPageInfo piPage; private DevExpress.XtraReports.UI.XRTable xrTable2; private DevExpress.XtraReports.UI.XRTableRow xrTableRow3; private DevExpress.XtraReports.UI.XRTableCell lblGesamtpreis; private DevExpress.XtraReports.UI.XRTableCell xrTableCell6; + private DevExpress.XtraReports.UI.XRLabel xrLabel3; } }