diff --git a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs index b26a0b7f2..f2a292df0 100644 --- a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs +++ b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs @@ -34,7 +34,7 @@ namespace BeWo.View.Controls if (overtime != null) { TxtUeberstunden.Text = string.Format("{0:0.00}", overtime.Betrag); - TxtAuszahlungsart.Text = overtime.Auszahlungsart.Name; + TxtAuszahlungsart.Text = overtime.Auszahlungsart != null ? overtime.Auszahlungsart.Name : "-"; TxtUeberstunden.Visibility = Visibility.Visible; TxtAuszahlungsart.Visibility = Visibility.Visible; diff --git a/ReportImp/BetreutesWohnenAmRheinReports/BWARMitarbeiterstundenkontoBerechnung.cs b/ReportImp/BetreutesWohnenAmRheinReports/BWARMitarbeiterstundenkontoBerechnung.cs index 7d351c77a..3eca53ffd 100644 --- a/ReportImp/BetreutesWohnenAmRheinReports/BWARMitarbeiterstundenkontoBerechnung.cs +++ b/ReportImp/BetreutesWohnenAmRheinReports/BWARMitarbeiterstundenkontoBerechnung.cs @@ -258,6 +258,23 @@ namespace BeWo.BetreutesWohnenAmRheinReports } return pausenZeit; } + + public override decimal GetFeiertagsFaktor(DateTime start) + { + if (start.Year >= 2024 && start.Month == 12 && (start.Day == 24 || start.Day == 31)) + { + return 0.5m; + } + + return base.GetFeiertagsFaktor(start); + } + public override bool IstAnrechenbareAbsenceTime(AbsenceTime item) + { + if (item.AbsenceReason.Description == "Überstundenfrei") + return false; + else + return base.IstAnrechenbareAbsenceTime(item); + } } } diff --git a/ReportImp/BetreutesWohnenAmRheinReports/Service/CustomVacationService.cs b/ReportImp/BetreutesWohnenAmRheinReports/Service/CustomVacationService.cs index 4366b9986..f2fbff112 100644 --- a/ReportImp/BetreutesWohnenAmRheinReports/Service/CustomVacationService.cs +++ b/ReportImp/BetreutesWohnenAmRheinReports/Service/CustomVacationService.cs @@ -19,21 +19,29 @@ namespace BetreutesWohnenAmRheinReports.Service // return list; //} + public override List GetFeiertage(int year, string bundesland) { var list = base.GetFeiertage(year, bundesland); var osterSonntag = GetOsterSonntag(year); - list.Add(new FeiertagDC() {Datum = osterSonntag.AddDays(-48), Name = "Rosenmontag" }); // "Rosenmontag" + list.Add(new FeiertagDC() { Datum = osterSonntag.AddDays(-48), Name = "Rosenmontag" }); // "Rosenmontag" if (year >= 2024) { - var heiligabend = list.FirstOrDefault(l => l.Name == "Heilig Abend"); - if (heiligabend != null) - list.Remove(heiligabend); + list.Add(new FeiertagDC() { Datum = new DateTime(year, 12, 31), Name = "Silvester" }); } return list; } + public override decimal GetFeiertagsFaktor(DateTime start) + { + if (start.Year >= 2024 && start.Month == 12 && (start.Day == 24 || start.Day == 31)) + { + return 0.5m; + } + + return base.GetFeiertagsFaktor(start); + } } } diff --git a/ReportImp/BetreutesWohnenWoellReports/Invoicing/JugendamtInvoiceCreation.cs b/ReportImp/BetreutesWohnenWoellReports/Invoicing/JugendamtInvoiceCreation.cs index 20c225539..2de570420 100644 --- a/ReportImp/BetreutesWohnenWoellReports/Invoicing/JugendamtInvoiceCreation.cs +++ b/ReportImp/BetreutesWohnenWoellReports/Invoicing/JugendamtInvoiceCreation.cs @@ -1,15 +1,17 @@ using BeWo.Data.Entities; using BeWo.Service.Invoicing; +using BS.Shared; using BS.Shared.Core; using BS.Shared.DataContracts; using BS.Shared.Services; using System; using System.Collections.Generic; +using System.Linq; namespace BetreutesWohnenWoellReports.Invoicing { public class JugendamtInvoiceCreation : InvoiceCreation - { + { public override IList CreateInvoiceItems(List serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc) { var list = new List(); @@ -20,6 +22,7 @@ namespace BetreutesWohnenWoellReports.Invoicing if (!iServiceRecord.AlreadyAccounted) { InvoiceItem invoiceItem = CreateInvoiceItem(iServiceRecord, scap, calc); + invoiceItem.Notice = iServiceRecord.ServiceDescription.CategoryName; if (invoiceItem != null) { list.Add(invoiceItem); @@ -31,7 +34,12 @@ namespace BetreutesWohnenWoellReports.Invoicing } } - return CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc); + if (scap.CostBearer2SupportConcept.CostBearer.Organisation.Function != null && scap.CostBearer2SupportConcept.CostBearer.Organisation.Function.Value == "Jugendamt") + return CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc, false, true); + else + return CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc, false); + + //return CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc); } private InvoiceItem CreateFahrtkostenItem(InvoiceItem item) @@ -63,5 +71,136 @@ namespace BetreutesWohnenWoellReports.Invoicing return key; } + + public override IList CreateSummaryInvoiceItems(IList itemList, + DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc, bool summaryPerMonth, bool addRateFactorToUnitCount) + { + #region Standard + //Fasse InvoiceItems mit gleichem Stundensatz zusammen: + + var newlist = new List(); + + var rateToItem = new Dictionary(); + foreach (InvoiceItem iitem in itemList) + { + InvoiceItem item; + + var key = GetSummaryItemKey(scap, iitem, summaryPerMonth); + + if (rateToItem.ContainsKey(key)) + { + item = rateToItem[key]; + } + else + { + item = new InvoiceItem(); + #endregion + item.Notice = iitem.Notice; // Brauche die Notice.. + #region Standard + + newlist.Add(item); + + item.AmountPerUnit = iitem.AmountPerUnit; + if (invoicePeriod != null) + { + item.ItemPeriodStart = invoicePeriod.StartDate; + item.ItemPeriodEnd = invoicePeriod.EndDate; + } + else + { + item.ItemPeriodStart = scap.StartDate; + item.ItemPeriodEnd = scap.EndDate; + } + if (summaryPerMonth && iitem.ItemPeriodStart.HasValue) + { + DateTime start = new DateTime(iitem.ItemPeriodStart.Value.Year, iitem.ItemPeriodStart.Value.Month, 1); + DateTime end = start.AddMonths(1).AddDays(-1); + + if (item.ItemPeriodStart < start) + { + item.ItemPeriodStart = start; + } + if (item.ItemPeriodEnd > end) + { + item.ItemPeriodEnd = end; + } + } + item.RateFactor = iitem.RateFactor; + + item.AccountingInterval = iitem.AccountingInterval; + item.ItemDescription = iitem.ItemDescription; + item.UnitDescription = iitem.UnitDescription; + item.SupportConceptApprovalPeriodOid = scap.Oid; + + + rateToItem[key] = item; + } + + + if (!item.UnitCount.HasValue) + { + item.UnitCount = 0; + } + item.UnitCount += iitem.UnitCount ?? 0; + } + + BerechneSummaryItemsSummen(newlist, addRateFactorToUnitCount); + return newlist; + #endregion + } + + public override void CheckMaxApprovedAmount(ServiceInvoice invoice, ServiceInvoicePeriod sip, SupportConceptApprovalPeriodDC scap, CostBearer2SupportConcept costBearer2SupportConcept, DateTimeSpan invoicePeriod, List serviceRecords) + { + if (sip.ApprovedHours.HasValue && !scap.IsApprovedBEShifting) + { + //Prüfen ob der abzurechnende Zeitraum kleiner als das Bewilligungsintervall ist + if (scap.ApprovedBEInterval.HasValue) + { + var days = invoicePeriod.GetTimeSpan().Days + 1; + switch (scap.ApprovedBEInterval.Value) + { + case SupportConceptApprovalInterval.Quarterly: + if (days < 89) //CB: Machen wir es mal nicht zu kompliziert, wenn man weniger als 89 Tage abrechnet, gehen wir davon aus, dass nicht das gesamte Quartal abgerechnet wird + { + return; // Mach nix. TODO: Gesamtstunden prüfen und dann nur das abrechnen, was noch offen ist. Wer das macht bekommt ein Fleißsternchen:-) + } + break; + case SupportConceptApprovalInterval.HalfYearly: + if (days < 178) //CB: Siehe oben + { + return; // Mach nix. TODO: Gesamtstunden prüfen und dann nur das abrechnen, was noch offen ist. Wer das macht bekommt ein Fleißsternchen:-) + } + break; + case SupportConceptApprovalInterval.Yearly: + if (days < 365) //CB: Siehe oben + { + return; // Mach nix. TODO: Gesamtstunden prüfen und dann nur das abrechnen, was noch offen ist. Wer das macht bekommt ein Fleißsternchen:-) + } + break; + default: + break; + } + } + decimal totalHours = 0; + + foreach (var ii in sip.InvoiceItemList.Where(ii => ii.UnitCount.HasValue && ii.ItemDescription != "Fahrkosten pro km")) // KM werden immer abgerechnet, wie werden nicht vom Budget abgezogen + { + if (totalHours + ii.UnitCount.Value > sip.ApprovedHours) + { + ii.UnitCount = Math.Round(sip.ApprovedHours.Value - totalHours, 2, MidpointRounding.AwayFromZero); + if (ii.AmountPerUnit.HasValue) + { + ii.AmountTotal = ii.AmountPerUnit.Value * ii.UnitCount; + ii.GrossAmountTotal = ii.AmountTotal; + } + totalHours = sip.ApprovedHours.Value; + } + else + { + totalHours += ii.UnitCount.Value; + } + } + } + } } } \ No newline at end of file diff --git a/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.Designer.cs b/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.Designer.cs index 01f2def2d..8032d0b2d 100644 --- a/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.Designer.cs +++ b/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.Designer.cs @@ -153,8 +153,7 @@ namespace BeWo.Report.DefaultReports this.xrLabel5.SizeF = new System.Drawing.SizeF(240.5833F, 65.66664F); this.xrLabel5.StylePriority.UseFont = false; this.xrLabel5.StylePriority.UseTextAlignment = false; - this.xrLabel5.Text = "Geschäftsführung:\r\nFiona Wöll, B.A. Soziale Arbeit\r\nLisa Wöll, Dipl- Sozialarbeit" + - "erin"; + this.xrLabel5.Text = "Geschäftsführung:\r\nFiona Wöll, B.A. Soziale Arbeit"; this.xrLabel5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; // // xrLabel4 @@ -277,6 +276,8 @@ namespace BeWo.Report.DefaultReports // xrTableCell8 // this.xrTableCell8.CanShrink = true; + this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { + new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerInsuranceNumber")}); this.xrTableCell8.Multiline = true; this.xrTableCell8.Name = "xrTableCell8"; this.xrTableCell8.Weight = 5.0079144287109374D; diff --git a/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.cs b/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.cs index ac6f24476..95f13925f 100644 --- a/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.cs +++ b/ReportImp/BetreutesWohnenWoellReports/ServiceInvoiceReport.cs @@ -1,7 +1,7 @@ using System; using System.Text; using BeWo.Report.ReportObjects; - +using BS.Shared.Extensions; using DevExpress.XtraReports.UI; namespace BeWo.Report.DefaultReports @@ -18,16 +18,28 @@ namespace BeWo.Report.DefaultReports DateTime start = pRO.AccountingPeriodStart; DateTime end = pRO.AccountingPeriodEnd; + var istJugendamt = false; // Überschrift je nach Leistung setzen und Briefkopf nach Kostenträgerfunktion foreach (var ip in pRO.ServiceInvoicePeriods) { foreach (var ap in ip.CostBearer2SupportConcept.ApprovalPeriodList) { + if (ap.CostBearer2SupportConcept.CostBearer.Organisation.Function != null && ap.CostBearer2SupportConcept.CostBearer.Organisation.Function.Value == "Jugendamt") + istJugendamt = true; + if (ap.ServiceCategory != null && ap.ServiceCategory.Name.Contains("§")) { lblUeberschrift.Text = ap.ServiceCategory.Name; } - + else + { + foreach (var item in ip.ServiceInvoiceItems) + { + if (!item.Notice.IsNullOrEmpty() && item.Notice.Contains("§")) + lblUeberschrift.Text = item.Notice; + } + } + // Wenn es keine Rechnung an ein Jugendamt ist, Briefkopf ändern if (ap.CostBearer2SupportConcept.CostBearer.Organisation.Function == null || ap.CostBearer2SupportConcept.CostBearer.Organisation.Function.Value != "Jugendamt") { lblFachbereich.Text = null; @@ -41,8 +53,8 @@ namespace BeWo.Report.DefaultReports { rowFamilienhilfe.Visible = false; rowVersicherungsnummer.Visible = false; - //rowZeichen.Visible = false; rowBewilligungsumfang.Visible = false; + labelIKoderGP.Text = "GP-Nummer:"; WertIKoderGP.Text = pRO.BusinessPartnerId; } @@ -56,20 +68,28 @@ namespace BeWo.Report.DefaultReports string periode = ""; switch (ip.SupportConceptApprovalPeriod.ApprovedBEInterval) { - case BS.Shared.SupportConceptApprovalInterval.Daily: periode = "Tag";break; - case BS.Shared.SupportConceptApprovalInterval.Weekly: periode = "Woche";break; - case BS.Shared.SupportConceptApprovalInterval.Monthly: periode = "Monat";break; - case BS.Shared.SupportConceptApprovalInterval.HalfYearly: periode = "Halbjahr";break; - case BS.Shared.SupportConceptApprovalInterval.Yearly: periode = "Jahr";break; - case BS.Shared.SupportConceptApprovalInterval.Fortnightly: periode = "Pauschal";break; + case BS.Shared.SupportConceptApprovalInterval.Daily: periode = "Tag"; break; + case BS.Shared.SupportConceptApprovalInterval.Weekly: periode = "Woche"; break; + case BS.Shared.SupportConceptApprovalInterval.Monthly: periode = "Monat"; break; + case BS.Shared.SupportConceptApprovalInterval.HalfYearly: periode = "Halbjahr"; break; + case BS.Shared.SupportConceptApprovalInterval.Yearly: periode = "Jahr"; break; + case BS.Shared.SupportConceptApprovalInterval.Fortnightly: periode = "Pauschal"; break; } - + cellBewilligungsumfang.Text += string.Format("{0:0.00}", ip.SupportConceptApprovalPeriod.ApprovedBEPerInterval) + " FLS / " + periode + " bis " + string.Format("{0:dd.MM.yyyy}", ip.SupportConceptApprovalPeriod.EndDate) + "\n"; } } + // Für Jugendamt IK und Versicherungsnummer raus + if (istJugendamt) + { + rowIKNummer.Visible = false; + rowVersicherungsnummer.Visible = false; + } + + if (start.Month == end.Month && start.Year == end.Year) { diff --git a/ReportImp/KomMitBewo/Service/CustomVacationService.cs b/ReportImp/KomMitBewo/Service/CustomVacationService.cs index 733a9b77b..2a6657a74 100644 --- a/ReportImp/KomMitBewo/Service/CustomVacationService.cs +++ b/ReportImp/KomMitBewo/Service/CustomVacationService.cs @@ -26,6 +26,19 @@ namespace KommMit.Service } return list; - } + } + + public override decimal GetFeiertagsFaktor(DateTime start) + { + if (start.Year >= 2024 && start.Month == 12 && (start.Day == 24 || start.Day == 31)) + { + return 0.5m; + } + else if (IstFeiertag(start)) + { + return 1; + } + return 0; + } } } diff --git a/ReportImp/SKMAachen/RechnungBeWo67.Designer.cs b/ReportImp/SKMAachen/RechnungBeWo67.Designer.cs index bd666fc12..8e2583ec2 100644 --- a/ReportImp/SKMAachen/RechnungBeWo67.Designer.cs +++ b/ReportImp/SKMAachen/RechnungBeWo67.Designer.cs @@ -69,6 +69,8 @@ namespace SKMAachen this.xrLabel15 = new DevExpress.XtraReports.UI.XRLabel(); this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand(); this.xrLabel4 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblDifferenzrechnung1 = new DevExpress.XtraReports.UI.XRLabel(); + this.lblDifferenzrechnung2 = new DevExpress.XtraReports.UI.XRLabel(); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); @@ -93,7 +95,7 @@ namespace SKMAachen // xrPictureBox1 // this.xrPictureBox1.ImageSource = new DevExpress.XtraPrinting.Drawing.ImageSource("img", resources.GetString("xrPictureBox1.ImageSource")); - this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(421.7502F, 0F); + this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(440.5837F, 0F); this.xrPictureBox1.Name = "xrPictureBox1"; this.xrPictureBox1.SizeF = new System.Drawing.SizeF(255.2498F, 80.70667F); this.xrPictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage; @@ -123,7 +125,7 @@ namespace SKMAachen // this.xrLabel10.Font = new DevExpress.Drawing.DXFont("Verdana", 7F); this.xrLabel10.ForeColor = System.Drawing.Color.Gray; - this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(578.1249F, 0F); + this.xrLabel10.LocationFloat = new DevExpress.Utils.PointFloat(596.9584F, 0F); this.xrLabel10.Multiline = true; this.xrLabel10.Name = "xrLabel10"; this.xrLabel10.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -138,11 +140,11 @@ namespace SKMAachen // this.xrLabel9.Font = new DevExpress.Drawing.DXFont("Verdana", 7F); this.xrLabel9.ForeColor = System.Drawing.Color.Gray; - this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(385.4167F, 0F); + this.xrLabel9.LocationFloat = new DevExpress.Utils.PointFloat(396.875F, 0F); this.xrLabel9.Multiline = true; this.xrLabel9.Name = "xrLabel9"; this.xrLabel9.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel9.SizeF = new System.Drawing.SizeF(192.7083F, 71.10926F); + this.xrLabel9.SizeF = new System.Drawing.SizeF(200.0835F, 71.10926F); this.xrLabel9.StylePriority.UseFont = false; this.xrLabel9.StylePriority.UseForeColor = false; this.xrLabel9.StylePriority.UseTextAlignment = false; @@ -158,7 +160,7 @@ namespace SKMAachen this.xrLabel6.Multiline = true; this.xrLabel6.Name = "xrLabel6"; this.xrLabel6.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel6.SizeF = new System.Drawing.SizeF(192.7083F, 71.10926F); + this.xrLabel6.SizeF = new System.Drawing.SizeF(204.1667F, 71.10926F); this.xrLabel6.StylePriority.UseFont = false; this.xrLabel6.StylePriority.UseForeColor = false; this.xrLabel6.StylePriority.UseTextAlignment = false; @@ -184,6 +186,8 @@ namespace SKMAachen // Page1 // this.Page1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { + this.lblDifferenzrechnung2, + this.lblDifferenzrechnung1, this.xrLabel11, this.xrLabel3, this.xrLabel1, @@ -193,7 +197,7 @@ namespace SKMAachen this.lblForderung, this.xrLabel2, this.lblAbrechnungszeitraum}); - this.Page1.HeightF = 473.1048F; + this.Page1.HeightF = 488.313F; this.Page1.Name = "Page1"; this.Page1.StylePriority.UseFont = false; // @@ -258,14 +262,14 @@ namespace SKMAachen this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(501.3751F, 217.6081F); this.xrLabel8.Name = "xrLabel8"; this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel8.SizeF = new System.Drawing.SizeF(148.6251F, 23F); + this.xrLabel8.SizeF = new System.Drawing.SizeF(194.4584F, 23F); this.xrLabel8.StylePriority.UseTextAlignment = false; this.xrLabel8.Text = "xrLabel8"; this.xrLabel8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; // // xrTable2 // - this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(367.0001F, 10F); + this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(367.0001F, 10.00001F); this.xrTable2.Name = "xrTable2"; this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] { this.xrTableRow2, @@ -275,7 +279,7 @@ namespace SKMAachen this.xrTableRow1, this.xrTableRow6, this.xrTableRow8}); - this.xrTable2.SizeF = new System.Drawing.SizeF(283F, 134F); + this.xrTable2.SizeF = new System.Drawing.SizeF(328.8332F, 134F); // // xrTableRow2 // @@ -406,13 +410,12 @@ namespace SKMAachen // // lblForderung // - this.lblForderung.Font = new DevExpress.Drawing.DXFont("Verdana", 9.75F, DevExpress.Drawing.DXFontStyle.Bold, DevExpress.Drawing.DXGraphicsUnit.Point, new DevExpress.Drawing.DXFontAdditionalProperty[] { - new DevExpress.Drawing.DXFontAdditionalProperty("GdiCharSet", ((byte)(0)))}); + this.lblForderung.Font = new DevExpress.Drawing.DXFont("Verdana", 9.75F); this.lblForderung.LocationFloat = new DevExpress.Utils.PointFloat(0F, 432.6881F); this.lblForderung.Multiline = true; this.lblForderung.Name = "lblForderung"; this.lblForderung.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblForderung.SizeF = new System.Drawing.SizeF(650F, 40.41666F); + this.lblForderung.SizeF = new System.Drawing.SizeF(695.8333F, 18.54166F); this.lblForderung.StylePriority.UseFont = false; this.lblForderung.Text = "Hieraus ergibt sich eine Forderung von ___ Std. x 61,40 EUR = ________ EUR."; // @@ -423,7 +426,7 @@ namespace SKMAachen this.xrLabel2.Multiline = true; this.xrLabel2.Name = "xrLabel2"; this.xrLabel2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel2.SizeF = new System.Drawing.SizeF(650F, 112.9134F); + this.xrLabel2.SizeF = new System.Drawing.SizeF(695.8333F, 112.9134F); this.xrLabel2.StylePriority.UseBackColor = false; this.xrLabel2.StylePriority.UseFont = false; this.xrLabel2.Text = resources.GetString("xrLabel2.Text"); @@ -435,7 +438,7 @@ namespace SKMAachen this.lblAbrechnungszeitraum.Multiline = true; this.lblAbrechnungszeitraum.Name = "lblAbrechnungszeitraum"; this.lblAbrechnungszeitraum.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.lblAbrechnungszeitraum.SizeF = new System.Drawing.SizeF(650F, 62F); + this.lblAbrechnungszeitraum.SizeF = new System.Drawing.SizeF(695.8333F, 62F); this.lblAbrechnungszeitraum.StylePriority.UseFont = false; this.lblAbrechnungszeitraum.Text = "Im Zeitraum [AccountingPeriodStart!dd.MM.yyyy] bis [AccountingPeriodEnd!dd.MM.yyy" + "y] wurden ____ Dienstleistungsstunden unmittelbare Betreuungsleistungen des Ambu" + @@ -450,11 +453,11 @@ namespace SKMAachen // // xrLabel15 // - this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F); + this.xrLabel15.LocationFloat = new DevExpress.Utils.PointFloat(0.0002066294F, 21.875F); this.xrLabel15.Multiline = true; this.xrLabel15.Name = "xrLabel15"; this.xrLabel15.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); - this.xrLabel15.SizeF = new System.Drawing.SizeF(650F, 124.7343F); + this.xrLabel15.SizeF = new System.Drawing.SizeF(695.8333F, 124.7343F); this.xrLabel15.StylePriority.UseFont = false; this.xrLabel15.StylePriority.UseTextAlignment = false; this.xrLabel15.Text = resources.GetString("xrLabel15.Text"); @@ -465,12 +468,12 @@ namespace SKMAachen this.GroupFooter2.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] { this.xrLabel4, this.xrLabel15}); - this.GroupFooter2.HeightF = 229.1258F; + this.GroupFooter2.HeightF = 247.6877F; this.GroupFooter2.Name = "GroupFooter2"; // // xrLabel4 // - this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(0F, 188.7091F); + this.xrLabel4.LocationFloat = new DevExpress.Utils.PointFloat(0F, 207.271F); this.xrLabel4.Multiline = true; this.xrLabel4.Name = "xrLabel4"; this.xrLabel4.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -478,6 +481,28 @@ namespace SKMAachen this.xrLabel4.StylePriority.UseFont = false; this.xrLabel4.Text = "Unterschrift und Stempel des Anbieters "; // + // lblDifferenzrechnung1 + // + this.lblDifferenzrechnung1.CanShrink = true; + this.lblDifferenzrechnung1.Font = new DevExpress.Drawing.DXFont("Verdana", 9.75F); + this.lblDifferenzrechnung1.LocationFloat = new DevExpress.Utils.PointFloat(0F, 451.2297F); + this.lblDifferenzrechnung1.Multiline = true; + this.lblDifferenzrechnung1.Name = "lblDifferenzrechnung1"; + this.lblDifferenzrechnung1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblDifferenzrechnung1.SizeF = new System.Drawing.SizeF(695.8333F, 18.54166F); + this.lblDifferenzrechnung1.StylePriority.UseFont = false; + // + // lblDifferenzrechnung2 + // + this.lblDifferenzrechnung2.CanShrink = true; + this.lblDifferenzrechnung2.Font = new DevExpress.Drawing.DXFont("Verdana", 9.75F, DevExpress.Drawing.DXFontStyle.Bold); + this.lblDifferenzrechnung2.LocationFloat = new DevExpress.Utils.PointFloat(0.0002066294F, 469.7714F); + this.lblDifferenzrechnung2.Multiline = true; + this.lblDifferenzrechnung2.Name = "lblDifferenzrechnung2"; + this.lblDifferenzrechnung2.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); + this.lblDifferenzrechnung2.SizeF = new System.Drawing.SizeF(695.8333F, 18.54166F); + this.lblDifferenzrechnung2.StylePriority.UseFont = false; + // // bindingSource1 // this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO); @@ -500,7 +525,7 @@ namespace SKMAachen this.Font = new DevExpress.Drawing.DXFont("Verdana", 10F); this.FormattingRuleSheet.AddRange(new DevExpress.XtraReports.UI.FormattingRule[] { this.ruleRateFactorNull}); - this.Margins = new DevExpress.Drawing.DXMargins(75F, 75F, 135.5417F, 125.5471F); + this.Margins = new DevExpress.Drawing.DXMargins(75F, 24F, 135.5417F, 125.5471F); this.PageHeight = 1169; this.PageWidth = 827; this.PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4; @@ -553,5 +578,7 @@ namespace SKMAachen private DevExpress.XtraReports.UI.XRLabel xrLabel5; private DevExpress.XtraReports.UI.XRPictureBox xrPictureBox1; private DevExpress.XtraReports.UI.XRLabel xrLabel11; + private DevExpress.XtraReports.UI.XRLabel lblDifferenzrechnung1; + private DevExpress.XtraReports.UI.XRLabel lblDifferenzrechnung2; } } diff --git a/ReportImp/SKMAachen/RechnungBeWo67.cs b/ReportImp/SKMAachen/RechnungBeWo67.cs index d164fa04b..0c4c00997 100644 --- a/ReportImp/SKMAachen/RechnungBeWo67.cs +++ b/ReportImp/SKMAachen/RechnungBeWo67.cs @@ -20,6 +20,9 @@ namespace SKMAachen { decimal hourlyRate = 0; decimal hours = 0; + + ServiceInvoiceItemRO bereitsBerechnetesItem = null; + if (pRO.ServiceInvoicePeriods != null && pRO.ServiceInvoicePeriods.Count > 0) { foreach (var p in pRO.ServiceInvoicePeriods) @@ -32,7 +35,8 @@ namespace SKMAachen { if (i.HourlyRate.HasValue) { - hourlyRate = i.HourlyRate.Value; + if (i.HourlyRate.Value >= 0) + hourlyRate = i.HourlyRate.Value; if (!String.IsNullOrEmpty(i.RateFactor)) { @@ -44,7 +48,10 @@ namespace SKMAachen if (i.Hours.HasValue) { - hours += i.Hours.Value; + if (!i.ServiceDescription.Contains("Rechnungsnummer")) + hours += i.Hours.Value; + else + bereitsBerechnetesItem = i; } } } @@ -52,8 +59,13 @@ namespace SKMAachen } lblForderung.Text = - String.Format("Hieraus ergibt sich eine Forderung von {0:0.00} Std. x {1:0.00} EUR = {2:0.00}.", hours, hourlyRate, pRO.NetClaim.Replace("€", "EUR")); - + String.Format("Hieraus ergibt sich eine Forderung von {0:0.00} Std. x {1:0.00} EUR = {2:0.00}.", hours, hourlyRate, string.Format("{0:0.00} EUR", hours * hourlyRate)); + //String.Format("Hieraus ergibt sich eine Forderung von {0:0.00} Std. x {1:0.00} EUR = {2:0.00}.", hours, hourlyRate, pRO.NetClaim.Replace("€", "EUR")); + if (pRO.InvoiceBase.InvoiceTypeText == "Differenzrechnung" && bereitsBerechnetesItem != null) + { + lblDifferenzrechnung1.Text = string.Format("{0}: {1:0.00} Std. x {2:0.00} EUR = {3:0.00} EUR", bereitsBerechnetesItem.ServiceDescription, bereitsBerechnetesItem.Hours, bereitsBerechnetesItem.HourlyRate * -1, Convert.ToDecimal(bereitsBerechnetesItem.GrossAmount.Split(' ')[0]) * -1); + lblDifferenzrechnung2.Text = string.Format("Daraus ergibt sich eine zu zahlende Summe von {0} EUR.", pRO.NetClaim.Replace("€", "")); + } lblAbrechnungszeitraum.Text = String.Format( "Im Zeitraum vom {0:dd.MM.yyyy} bis {1:dd.MM.yyyy} wurden {2:0.00} Dienstleistungsstunden unmittelbare Betreuungsleistungen des Ambulant Betreuten Wohnens erbracht.",