diff --git a/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj b/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj index e3635185c..55a6148d5 100644 --- a/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj +++ b/ReportImp/ChristopherusHaus/ChristopherusHaus.csproj @@ -82,6 +82,8 @@ Finanzauswertung.cs + + Component diff --git a/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceCreation.cs b/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceCreation.cs new file mode 100644 index 000000000..5e8741bde --- /dev/null +++ b/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceCreation.cs @@ -0,0 +1,45 @@ +using BeWo.Data.Entities; +using BeWo.Service.Invoicing; +using BS.Shared.Core; +using BS.Shared.DataContracts; +using BS.Shared.DataContracts.Compact; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ChristopherusHaus.Invoicing +{ + public class CustomInvoiceCreation : InvoiceCreation + { + public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List serviceRecords) + { + if (!supportConcept.IsDeleted && !supportConcept.IsArchived) + { + var invoice = new ServiceInvoice(); + + var supportConceptList = new List { supportConcept }; + + + SetSenderInformation(invoice); + SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList); + SetSingleInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConcept); + + SetRecipientInformation(invoice, costBearer); + + SetServiceInvoicePeriods(invoice, invoice.InvoiceBase.CostBearer2SupportConcept, invoicePeriod, + serviceRecords); + + SetServiceInvoicePeriodAmounts(invoice); + SetAmountAdvancePayments(invoice); + SetAmountEquityContribution(invoice); + + + return invoice; + } + + return null; + } + } +} diff --git a/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceFactory.cs b/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceFactory.cs new file mode 100644 index 000000000..0e1e47a23 --- /dev/null +++ b/ReportImp/ChristopherusHaus/Invoicing/CustomInvoiceFactory.cs @@ -0,0 +1,19 @@ +using BeWo.Service.Invoicing; +using BS.Shared.DataContracts; +using BS.Shared.DataContracts.Compact; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ChristopherusHaus.Invoicing +{ + public class CustomInvoiceFactory : InvoiceFactory + { + public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) + { + return new CustomInvoiceCreation(); + } + } +} diff --git a/ReportImp/ChristopherusHaus/ServiceInvoiceReport.Designer.cs b/ReportImp/ChristopherusHaus/ServiceInvoiceReport.Designer.cs index e516e62ca..4b2532e28 100644 --- a/ReportImp/ChristopherusHaus/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/ChristopherusHaus/ServiceInvoiceReport.Designer.cs @@ -95,6 +95,8 @@ namespace ChristopherusHaus this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.lblAbschlagszahlungen = new DevExpress.XtraReports.UI.XRLabel(); + this.lblEndbetrag = new DevExpress.XtraReports.UI.XRLabel(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); @@ -417,7 +419,7 @@ namespace ChristopherusHaus // xrLabel15 // this.xrLabel15.Font = new DevExpress.Drawing.DXFont("Verdana", 10F); - this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0F, 106.5833F); + this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0F, 163.75F); this.xrLabel15.Name = "xrLabel15"; this.xrLabel15.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel15.SizeF = new System.Drawing.SizeF(175F, 17F); @@ -427,7 +429,7 @@ namespace ChristopherusHaus // xrTable4 // this.xrTable4.Font = new DevExpress.Drawing.DXFont("Verdana", 10F); - this.xrTable4.LocationFloat = new DevExpress.Utils.PointFloat(0F, 60.75F); + this.xrTable4.LocationFloat = new DevExpress.Utils.PointFloat(0F, 117.9167F); this.xrTable4.Name = "xrTable4"; this.xrTable4.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow10, @@ -469,7 +471,7 @@ namespace ChristopherusHaus this.xrLabel14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "CreatorName")}); this.xrLabel14.Font = new DevExpress.Drawing.DXFont("Verdana", 10F); - this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0F, 181.5833F); + this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(0F, 238.75F); this.xrLabel14.Name = "xrLabel14"; this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel14.SizeF = new System.Drawing.SizeF(225F, 17F); @@ -479,7 +481,7 @@ namespace ChristopherusHaus // xrLabel9 // this.xrLabel9.Font = new DevExpress.Drawing.DXFont("Verdana", 10F, DevExpress.Drawing.DXFontStyle.Italic); - this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(0F, 35.75F); + this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(0F, 92.91668F); this.xrLabel9.Name = "xrLabel9"; this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); this.xrLabel9.SizeF = new System.Drawing.SizeF(250F, 17F); @@ -810,12 +812,14 @@ namespace ChristopherusHaus // GroupFooter1 // this.GroupFooter1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.lblEndbetrag, + this.lblAbschlagszahlungen, this.xrLabel1, this.xrLabel9, this.xrTable4, this.xrLabel14, this.xrLabel15}); - this.GroupFooter1.HeightF = 198.5833F; + this.GroupFooter1.HeightF = 255.75F; this.GroupFooter1.Name = "GroupFooter1"; // // xrLabel1 @@ -823,10 +827,10 @@ namespace ChristopherusHaus this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "GrossClaim", "Gesamtsumme: {0}")}); this.xrLabel1.Font = new DevExpress.Drawing.DXFont("Verdana", 9F, DevExpress.Drawing.DXFontStyle.Bold); - this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(420.9999F, 0F); + this.xrLabel1.LocationFloat = new DevExpress.Utils.PointFloat(362.5F, 0F); this.xrLabel1.Name = "xrLabel1"; this.xrLabel1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); - this.xrLabel1.SizeF = new System.Drawing.SizeF(255.8333F, 25F); + this.xrLabel1.SizeF = new System.Drawing.SizeF(314.3332F, 25F); this.xrLabel1.StylePriority.UseFont = false; this.xrLabel1.StylePriority.UsePadding = false; this.xrLabel1.StylePriority.UseTextAlignment = false; @@ -837,6 +841,39 @@ namespace ChristopherusHaus // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); // + // lblAbschlagszahlungen + // + this.lblAbschlagszahlungen.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "AmountAdvancedPayments")}); + this.lblAbschlagszahlungen.Font = new DevExpress.Drawing.DXFont("Verdana", 9F); + this.lblAbschlagszahlungen.LocationFloat = new DevExpress.Utils.PointFloat(362.6669F, 25F); + this.lblAbschlagszahlungen.Multiline = true; + this.lblAbschlagszahlungen.Name = "lblAbschlagszahlungen"; + this.lblAbschlagszahlungen.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F); + this.lblAbschlagszahlungen.SizeF = new System.Drawing.SizeF(314.3331F, 23F); + this.lblAbschlagszahlungen.StylePriority.UseFont = false; + this.lblAbschlagszahlungen.StylePriority.UseTextAlignment = false; + this.lblAbschlagszahlungen.Text = "lblAbschlagszahlungen"; + this.lblAbschlagszahlungen.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.lblAbschlagszahlungen.TextFormatString = "gel. Abschlagszahlungen: {0}"; + this.lblAbschlagszahlungen.Visible = false; + // + // lblEndbetrag + // + this.lblEndbetrag.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "NetClaim")}); + this.lblEndbetrag.Font = new DevExpress.Drawing.DXFont("Verdana", 9F, DevExpress.Drawing.DXFontStyle.Bold); + this.lblEndbetrag.LocationFloat = new DevExpress.Utils.PointFloat(362.6668F, 48F); + this.lblEndbetrag.Name = "lblEndbetrag"; + this.lblEndbetrag.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 5, 0, 0, 100F); + this.lblEndbetrag.SizeF = new System.Drawing.SizeF(314.3332F, 25F); + this.lblEndbetrag.StylePriority.UseFont = false; + this.lblEndbetrag.StylePriority.UsePadding = false; + this.lblEndbetrag.StylePriority.UseTextAlignment = false; + this.lblEndbetrag.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; + this.lblEndbetrag.TextFormatString = "Endbetrag: {0}"; + this.lblEndbetrag.Visible = false; + // // ServiceInvoiceReport // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -933,6 +970,8 @@ namespace ChristopherusHaus private DevExpress.XtraReports.UI.XRLabel xrLabel1; private DevExpress.XtraReports.UI.XRLabel lblRechnungsnummer; private DevExpress.XtraReports.UI.XRTableRow xrTableRow7; - private DevExpress.XtraReports.UI.XRTableCell xrTableCell3; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell3; + private DevExpress.XtraReports.UI.XRLabel lblAbschlagszahlungen; + private DevExpress.XtraReports.UI.XRLabel lblEndbetrag; } } diff --git a/ReportImp/ChristopherusHaus/ServiceInvoiceReport.cs b/ReportImp/ChristopherusHaus/ServiceInvoiceReport.cs index c6a20d284..a6e003c93 100644 --- a/ReportImp/ChristopherusHaus/ServiceInvoiceReport.cs +++ b/ReportImp/ChristopherusHaus/ServiceInvoiceReport.cs @@ -31,6 +31,12 @@ namespace ChristopherusHaus SetzeAdresse(pRO); + if (pRO.NetClaim != pRO.GrossClaim) + { + lblAbschlagszahlungen.Visible = true; + lblEndbetrag.Visible = true; + } + this.bindingSource1.DataSource = pRO; }