MH: Schubkraft SaveInterceptor + neu auf alt umgestellt

This commit is contained in:
2025-04-02 12:00:36 +02:00
parent 3514c7d762
commit 57b3fffd4f
8 changed files with 33 additions and 9 deletions

View File

@@ -83,6 +83,7 @@
<Compile Include="Quittierungsbeleg.Designer.cs">
<DependentUpon>Quittierungsbeleg.cs</DependentUpon>
</Compile>
<Compile Include="Service\CustomSaveInterceptor.cs" />
<Compile Include="Service\CustomServiceRecordValidator.cs" />
<Compile Include="SettlementReport2.cs">
<SubType>Component</SubType>

View File

@@ -20,7 +20,7 @@ namespace ABCBetreuungenReports.Calculation
if (scap.ApprovedBETotal.HasValue)
{
if (org.Name.ToLower().Contains("neu"))
if (!org.Name.ToLower().Contains("alt"))
return scap.ApprovedBETotal / 60 * 50;
return scap.ApprovedBETotal;
}
@@ -64,7 +64,7 @@ namespace ABCBetreuungenReports.Calculation
}
if (org.Name.ToLower().Contains("neu") && scap.ApprovedBEPerInterval.HasValue)
if (!org.Name.ToLower().Contains("alt") && scap.ApprovedBEPerInterval.HasValue)
{
var weeksInAP = Math.Round(Convert.ToDecimal(((pEnd.Value.Date - pStart.Value.Date).TotalDays + 1) / 7), 2); // Anzahl Wochen im Bewilligungszeitraum
var months = weeksInAP / 4.35m; // 1 Monat hat bei denen Pauschal 4.35 Wochen, also Wochen im Bewilligungszeitraum / Wochen pro Monat

View File

@@ -95,7 +95,7 @@ namespace ABCBetreuungenReports
//}
// Klären, wann QB genommen werden soll
if (ro.Costbearer != null && ro.StartDate.Date >= new DateTime(2023, 10, 01) && ro.Costbearer.ToLower().Contains("neu"))
if (ro.Costbearer != null && ro.StartDate.Date >= new DateTime(2023, 10, 01) && !ro.Costbearer.ToLower().Contains("alt"))
report = new Quittierungsbeleg();
else
report = new Stundenzettel();

View File

@@ -34,7 +34,7 @@ namespace ABCBetreuungenReports.Invoicing
{
var list = base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc);
if (scap.CostBearer2SupportConcept.CostBearer.Organisation.Name.ToLower().Contains("neu"))
if (!scap.CostBearer2SupportConcept.CostBearer.Organisation.Name.ToLower().Contains("alt"))
{
var crp = scap.CostBearer2SupportConcept.CostBearer.CostRatePeriods;
@@ -75,7 +75,7 @@ namespace ABCBetreuungenReports.Invoicing
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc)
{
var invoiceItem = base.CreateInvoiceItem(iServiceRecord, scap, calc);
if (scap.CostBearer2SupportConcept.CostBearer.Organisation.Name.ToLower().Contains("neu"))
if (!scap.CostBearer2SupportConcept.CostBearer.Organisation.Name.ToLower().Contains("alt"))
{
var crp = scap.CostBearer2SupportConcept.CostBearer.CostRatePeriods;
if (iServiceRecord.Start.HasValue && iServiceRecord.Start.Value.Date >= new DateTime(2023, 09, 01))

View File

@@ -45,7 +45,7 @@ namespace ABCBetreuungenReports.Invoicing
invoiceItems.Add(ii);
// ANPASSUNG
if (si.RecipientOrganisation.ToLower().Contains("neu"))
if (!si.RecipientOrganisation.ToLower().Contains("alt"))
{
InvoiceItemDC pauschalenItem = CreateKontaktpauschalenItem(ap, si.RecipientOrganisation);
if (pauschalenItem != null)
@@ -154,7 +154,7 @@ namespace ABCBetreuungenReports.Invoicing
}
public override void CalculateInvoiceItemAmounts(Settlement2DC si)
{
if (si.RecipientOrganisation != null && si.RecipientOrganisation.ToLower().Contains("neu"))
if (si.RecipientOrganisation != null && !si.RecipientOrganisation.ToLower().Contains("alt"))
{
si.ApprovedFLS = si.ApprovedFLS != null ? si.ApprovedFLS / 50 * 60 : si.ApprovedFLS;
si.ApprovedFLSWeekly = si.ApprovedFLSWeekly != null ? si.ApprovedFLSWeekly / 50 * 60 : si.ApprovedFLSWeekly;

View File

@@ -0,0 +1,23 @@
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 ABCBetreuungenReports.Service
{
public class CustomSaveInterceptor : SaveInterceptor
{
public override void BeforeSaveServiceRecord(ServiceRecord sr)
{
if (sr.ServiceDescription.Name.ToLower().Contains("terminausfall pauschale"))
{
if (sr.Start.HasValue)
sr.End = sr.Start.Value.AddMinutes(50);
sr.RoundedDuration = 50;
}
}
}
}

View File

@@ -18,7 +18,7 @@ namespace BeWo.ABCBetreuungenReports.Alt
public void SetReportDataSource(SettlementRO pRO)
{
if (pRO.RecipientOrganisation.ToLower().Contains("neu"))
if (!pRO.RecipientOrganisation.ToLower().Contains("alt"))
{
var fls = pRO.ApprovedFLS.Split(' ')[0];
pRO.ApprovedFLS = string.Format("{0:0.00} FLS", Convert.ToDecimal(fls) / 50 * 60);

View File

@@ -18,7 +18,7 @@ namespace BeWo.ABCBetreuungenReports
public void SetReportDataSource(Settlement2RO pRO)
{
//if (pRO.RecipientOrganisation.ToLower().Contains("neu"))
//if (!pRO.RecipientOrganisation.ToLower().Contains("alt"))
//{
// var fls = pRO.ApprovedFLS.Split(' ')[0];
// pRO.ApprovedFLS = string.Format("{0:0.00} FLS", Convert.ToDecimal(fls) / 50 * 60);