diff --git a/ReportImp/AlphaEv/InvoiceCustomerReport.Designer.cs b/ReportImp/AlphaEv/InvoiceCustomerReport.Designer.cs index b08d72e50..fd95bd1ee 100644 --- a/ReportImp/AlphaEv/InvoiceCustomerReport.Designer.cs +++ b/ReportImp/AlphaEv/InvoiceCustomerReport.Designer.cs @@ -178,8 +178,8 @@ namespace AlphaEv this.xrLabel10.StylePriority.UseFont = false; this.xrLabel10.StylePriority.UseForeColor = false; this.xrLabel10.StylePriority.UsePadding = false; - this.xrLabel10.Text = "Ihr Ansprechpartner:\r\nFrau Howe-Jakob\r\nFon: 0 21 96 - 72 63 - 16\r\nFax: 0 21 96 - " + - "72 63 - 32\r\njakob@alphaev.de\r\nwww.alphaev.de"; + this.xrLabel10.Text = "Ihr Ansprechpartner:\r\n[SenderFirstName] [SenderLastName]\r\n[SenderPhone]\r\n[SenderF" + + "ax]\r\n[SenderMail]\r\nwww.alphaev.de"; // // xrLabel1 // diff --git a/ReportImp/AlphaEv/SammelrechnungWuppertal.cs b/ReportImp/AlphaEv/SammelrechnungWuppertal.cs index 8ee514693..8dbc4d777 100644 --- a/ReportImp/AlphaEv/SammelrechnungWuppertal.cs +++ b/ReportImp/AlphaEv/SammelrechnungWuppertal.cs @@ -76,7 +76,7 @@ namespace AlphaEv Int32.TryParse(rfStr, out rfInt); rateFactor = (100m + rfInt)/100m; - i.RateFactor = string.Format("0:0.00", rateFactor); + i.RateFactor = string.Format("{0:0.00}", rateFactor); } } diff --git a/ReportImp/AlphaEv/ServiceInvoiceReport.Designer.cs b/ReportImp/AlphaEv/ServiceInvoiceReport.Designer.cs index 4e790e240..895607dba 100644 --- a/ReportImp/AlphaEv/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/AlphaEv/ServiceInvoiceReport.Designer.cs @@ -30,6 +30,7 @@ namespace AlphaEv { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceInvoiceReport)); + DevExpress.XtraReports.UI.XRWatermark xrWatermark1 = new DevExpress.XtraReports.UI.XRWatermark(); this.Detail = new DevExpress.XtraReports.UI.DetailBand(); this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand(); this.xrRichText2 = new DevExpress.XtraReports.UI.XRRichText(); @@ -52,7 +53,6 @@ namespace AlphaEv this.ReportFooter = new DevExpress.XtraReports.UI.ReportFooterBand(); this.xrLabel5 = new DevExpress.XtraReports.UI.XRLabel(); this.xrRichText1 = new DevExpress.XtraReports.UI.XRRichText(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.DetailReport = new DevExpress.XtraReports.UI.DetailReportBand(); this.Detail1 = new DevExpress.XtraReports.UI.DetailBand(); this.DetailReport1 = new DevExpress.XtraReports.UI.DetailReportBand(); @@ -79,12 +79,13 @@ namespace AlphaEv this.xrTableCell9 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell11 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell13 = new DevExpress.XtraReports.UI.XRTableCell(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // Detail @@ -208,8 +209,8 @@ namespace AlphaEv this.xrLabel10.StylePriority.UseFont = false; this.xrLabel10.StylePriority.UseForeColor = false; this.xrLabel10.StylePriority.UsePadding = false; - this.xrLabel10.Text = "Ihr Ansprechpartner:\r\nFrau Howe-Jakob\r\nFon: 0 21 96 - 72 63 - 16\r\nFax: 0 21 96 - " + - "72 63 - 32\r\njakob@alphaev.de\r\nwww.alphaev.de"; + this.xrLabel10.Text = "Ihr Ansprechpartner:\r\n[SenderContactPerson]\r\n[SenderContactPersonPhone]\r\n[SenderC" + + "ontactPersonFax]\r\n[SenderContactPersonMail]\r\nwww.alphaev.de"; // // xrLabel9 // @@ -338,10 +339,6 @@ namespace AlphaEv this.xrRichText1.SerializableRtfString = resources.GetString("xrRichText1.SerializableRtfString"); this.xrRichText1.SizeF = new System.Drawing.SizeF(170.25F, 156.8542F); // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); - // // DetailReport // this.DetailReport.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -633,6 +630,10 @@ namespace AlphaEv this.xrTableCell13.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; this.xrTableCell13.Weight = 0.030769235304504289D; // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); + // // ServiceInvoiceReport // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -654,12 +655,14 @@ namespace AlphaEv this.PageWidth = 827; this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4; this.Version = "23.2"; + xrWatermark1.Id = "Watermark1"; + this.Watermarks.Add(xrWatermark1); ((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } diff --git a/ReportImp/Mittelpunkt/CustomReportCreator.cs b/ReportImp/Mittelpunkt/CustomReportCreator.cs index 91ef244db..d05c5ab72 100644 --- a/ReportImp/Mittelpunkt/CustomReportCreator.cs +++ b/ReportImp/Mittelpunkt/CustomReportCreator.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using BeWo.Report; using BeWo.Report.ReportObjects; +using BS.Shared.Extensions; using DevExpress.XtraReports.UI; namespace Mittelpunkt @@ -9,7 +10,7 @@ namespace Mittelpunkt { public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay) { - List lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid); + List lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid, false); if (lROs.Count > 0) { @@ -80,11 +81,14 @@ namespace Mittelpunkt if (ro.Services != null) { + if (ro.Services.Count == 0) + ro.Services.Add(new ServicesOverviewRO.ServiceDetail()); + foreach (ServicesOverviewRO.ServiceDetail s in ro.Services) { ServicesOverviewRO.CreateSignatureString(s); - if (s.ServiceCategory.ToLower().Contains("assistenz")) + if (!s.ServiceCategory.IsNullOrEmpty() && s.ServiceCategory.ToLower().Contains("assistenz")) { assiRo.Services.Add(s); } diff --git a/ReportImp/Mittelpunkt/Invoicing/CustomInvoiceCreation.cs b/ReportImp/Mittelpunkt/Invoicing/CustomInvoiceCreation.cs new file mode 100644 index 000000000..5e1053ab3 --- /dev/null +++ b/ReportImp/Mittelpunkt/Invoicing/CustomInvoiceCreation.cs @@ -0,0 +1,61 @@ +using BeWo.Data.Entities; +using BeWo.Service.Invoicing; +using BS.Shared.Core; +using BS.Shared.DataContracts; +using BS.Shared.Services; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mittelpunkt.Invoicing +{ + public class CustomInvoiceCreation : InvoiceCreation + { + public override IList CreateInvoiceItems(List serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc) + { + if (!scap.ApprovedBETotal.HasValue) + return base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc); + + var crpWithRateFactor = scap.CostBearer2SupportConcept.CostBearer.CostRatePeriods.FirstOrDefault(crp => crp.CostRateType == BS.Shared.CostRatePeriodType.RateFactor); + var ratefactor = crpWithRateFactor != null ? (100 + crpWithRateFactor.CostRateValue.Value) / 100: 1m; + + var offeneBewilligteStunden = scap.ApprovedBETotal.Value; + + var list = new List(); + foreach (ServiceRecordDC iServiceRecord in serviceRecordsInPeriod) + { + if (iServiceRecord.ServiceDescription.Category.IsBillable) + { + if (!iServiceRecord.AlreadyAccounted) + { + var differenz = offeneBewilligteStunden - iServiceRecord.RoundedDuration * ratefactor / 60 ; + if (differenz < 0) + { + iServiceRecord.RoundedDuration += differenz / 1.2m * 60; // += weil die Zahl ja negativ ist + if (iServiceRecord.End.HasValue) + iServiceRecord.End.Value.AddMinutes(Convert.ToDouble(differenz)); + } + + InvoiceItem invoiceItem = CreateInvoiceItem(iServiceRecord, scap, calc); + if (invoiceItem != null) + { + list.Add(invoiceItem); + } + iServiceRecord.AlreadyAccounted = true; + offeneBewilligteStunden -= iServiceRecord.RoundedDuration * ratefactor / 60; + } + } + } + + return CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc); + } + + + public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc) + { + return base.CreateInvoiceItem(iServiceRecord, scap, calc); + } + } +} diff --git a/ReportImp/Mittelpunkt/Invoicing/CustomInvoiceFactory.cs b/ReportImp/Mittelpunkt/Invoicing/CustomInvoiceFactory.cs new file mode 100644 index 000000000..da757d7ef --- /dev/null +++ b/ReportImp/Mittelpunkt/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 Mittelpunkt.Invoicing +{ + public class CustomInvoiceFactory : InvoiceFactory + { + public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) + { + return new CustomInvoiceCreation(); + } + } +} diff --git a/ReportImp/Mittelpunkt/Mittelpunkt.csproj b/ReportImp/Mittelpunkt/Mittelpunkt.csproj index bc105fc1b..3182951ee 100644 --- a/ReportImp/Mittelpunkt/Mittelpunkt.csproj +++ b/ReportImp/Mittelpunkt/Mittelpunkt.csproj @@ -64,6 +64,8 @@ + + Component diff --git a/ReportImp/Mittelpunkt/Quittierungsbeleg.cs b/ReportImp/Mittelpunkt/Quittierungsbeleg.cs index 8ca2496b9..67310dd50 100644 --- a/ReportImp/Mittelpunkt/Quittierungsbeleg.cs +++ b/ReportImp/Mittelpunkt/Quittierungsbeleg.cs @@ -6,6 +6,7 @@ using System.Text.RegularExpressions; using BeWo.Report; using BeWo.Report.ReportObjects; using BS.Shared.Core; +using BS.Shared.Extensions; using DevExpress.XtraReports.UI; namespace Mittelpunkt @@ -32,7 +33,7 @@ namespace Mittelpunkt foreach (var sd in pRO.Services) { - if (sd.IsBillable || sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt")) + if (!sd.ServiceDescription.IsNullOrEmpty() && (sd.IsBillable || sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))) { ServicesOverviewRO.CreateSignatureString(sd); @@ -42,7 +43,7 @@ namespace Mittelpunkt sd.Notice5 = "GR"; hatGruppen = true; } - if (sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt")) + if (!sd.ServiceDescription.IsNullOrEmpty() && (sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))) { sd.Notice5 = "F"; totalFK += sd.Minutes;