diff --git a/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs b/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs index 5260b6fc9..f295fd360 100644 --- a/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs +++ b/ReportImp/LebenshilfeBadKreuznachFUD/Invoicing/CustomInvoiceCreation.cs @@ -15,7 +15,12 @@ using BS.Shared.Services; namespace LebenshilfeBadKreuznachFUD.Invoicing { - // weitgehend normal, für Entlastung kommt eine Hausbesuchspauschale und für Q1 KANN eine Wegevergütung hinzugefügt werden + // Drei Abrechnungsarten: + // 1) Entlastungsleistungen mit Hausbesuchspauschale + // 2) Integrationsdienst nach Qualifikation - aber das über Leistungskategorie geregelt + // 2) bei Q1 KANN eine Wegevergütung hinzugefügt werden, ansonsten können Zuschläge u Weitere Kosten im HP über kurze Bewilligungen ergänzt werden + // 3) Pflegesätze bei Kita und Kindergarten - stumpfe Tagespauschale + public class CustomInvoiceCreation : InvoiceCreation { public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod, IList supportConceptList) @@ -102,6 +107,16 @@ namespace LebenshilfeBadKreuznachFUD.Invoicing { return true; } + if (supportConceptApprovalPeriod.ServiceCategory != null) + { + List crList = supportConceptApprovalPeriod.ServiceCategory.CostRatePeriods; + AccountingIntervalType? ai = supportConceptApprovalPeriod.ServiceCategory.AccountingInterval; + + if (ai.HasValue && crList.Count(c => c.CostRateValue.HasValue) > 0) + { + return ai.Value != AccountingIntervalType.Hourly; + } + } return false; } @@ -204,21 +219,41 @@ namespace LebenshilfeBadKreuznachFUD.Invoicing desc = supportConceptApprovalPeriod.ServiceCategory.Name; } } - - foreach (var billingData in data) - { - serviceInvoicePeriod.InvoiceItemList.Add(new InvoiceItem + if (desc.Contains("Pflegesatz")) + { + if (data != null && data.Count > 0) + { + serviceInvoicePeriod.InvoiceItemList.Add(new InvoiceItem + { + ItemPeriodStart = data[0].BillingPeriodStart, + ItemPeriodEnd = data[0].BillingPeriodEnd, + AccountingInterval = data[0].AccountingInterval, + AmountPerUnit = data[0].AmountTotal, + UnitCount = data.Count, + UnitDescription = "Tage", + AmountTotal = data[0].AmountTotal * data.Count, + GrossAmountTotal = data[0].AmountTotal * data.Count, + ItemDescription = desc + }); + } + } + else + { + foreach (var billingData in data) { - AmountTotal = billingData.AmountTotal, - GrossAmountTotal = billingData.GrossAmountTotal, - ItemPeriodStart = billingData.BillingPeriodStart, - ItemPeriodEnd = billingData.BillingPeriodEnd, - AccountingInterval = billingData.AccountingInterval, - AmountPerUnit = billingData.AmountPerUnit, - UnitCount = billingData.UnitCount, - UnitDescription = "Stk", - ItemDescription = desc - }); + serviceInvoicePeriod.InvoiceItemList.Add(new InvoiceItem + { + AmountTotal = billingData.AmountTotal, + GrossAmountTotal = billingData.GrossAmountTotal, + ItemPeriodStart = billingData.BillingPeriodStart, + ItemPeriodEnd = billingData.BillingPeriodEnd, + AccountingInterval = billingData.AccountingInterval, + AmountPerUnit = billingData.AmountPerUnit, + UnitCount = billingData.UnitCount, + UnitDescription = "Stk", + ItemDescription = desc + }); + } } } diff --git a/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/ServiceInvoiceReport.cs b/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/ServiceInvoiceReport.cs index 810c08c7e..343585cd4 100644 --- a/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/ServiceInvoiceReport.cs +++ b/ReportImp/LebenshilfeBadKreuznachFUD/Reporting/Reports/ServiceInvoiceReport.cs @@ -19,13 +19,17 @@ namespace LebenshilfeBadKreuznachFUD public void SetReportDataSource(ServiceInvoiceRO pRO) { - bool entlastung = false; + string art = ""; decimal hours = 0; if (pRO.ServiceInvoicePeriods != null) { - if (pRO.ServiceInvoicePeriods.Any(s => s.SupportConceptApprovalPeriod.ServiceCategory.Name.ToLower().Contains("entlastung"))) + if (pRO.ServiceInvoicePeriods.Any(s => (s.SupportConceptApprovalPeriod.ServiceCategory?.Name.ToLower() ?? "").Contains("entlastung"))) { - entlastung = true; + art = "entlastung"; + } + if (pRO.ServiceInvoicePeriods.Any(s => (s.SupportConceptApprovalPeriod.ServiceCategory?.Name.ToLower() ?? "").Contains("pflegesatz"))) + { + art = "pflegesatz"; } foreach (var sip in pRO.ServiceInvoicePeriods) { @@ -39,13 +43,18 @@ namespace LebenshilfeBadKreuznachFUD } } - if (entlastung) + if (art == "entlastung") { lblZahlziel.Visible = true; lblIk.Visible = true; lblZahlziel.Text = String.Format("(bis {0:dd.MM.yyyy})", pRO.InvoiceDateTime.Value.AddDays(30)); lblZahlzeit.Text = "30 Tage"; } + else if (art == "pflegesatz") + { + lblVers.Text = String.Format("Aktenzeichen {0}", pRO.CustomerReferenceNumber); + lblHeader.Text = "Eingliederungshilfe nach SGB IX"; + } else { lblVers.Text = String.Format("Aktenzeichen {0}", pRO.CustomerReferenceNumber);