MH: Coburg InvoiceCreation + Anpassung Rechnung Christopherushaus

This commit is contained in:
2022-12-28 14:04:10 +01:00
parent 69ffe62415
commit 6a02baec3e
4 changed files with 188 additions and 1 deletions

View File

@@ -20,7 +20,13 @@ namespace ChristopherusHausFamilienhilfe
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
// Klientin Maren Völpert wird noch bis Juli 23 betreut und bekommt unabhängig vom KT einen anderen Paragrafen. Daher frage ich jetzt speziell nach ihrem Namen ab und setze dafür dann den Paragrafen
if (pRO.CustomerLastName.ToLower() == "völpert" && pRO.CustomerFirstName.ToLower() == "maren")
{
lblLeistung.Text = "Nach § 41 i.V.m. § 35 SGB VIII";
}
else if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
if (pRO.RecipientOrganisation == "Stadt Herne")
lblLeistung.Text = "Nach § 113 SGB IX in Verbindung mit § 78 SGB IX";

View File

@@ -32,6 +32,7 @@ namespace LebenshilfeCoburg.Invoicing
{
name = sd.Name.ToLower().Trim();
}
if (name == "auw pers. budget")
{
return new LhCoburgPBInvoiceCreation();
@@ -40,6 +41,10 @@ namespace LebenshilfeCoburg.Invoicing
{
return new LhCoburgAusbildungsassistenzInvoiceCreation();
}
if (name == "ind. p/b fk" || name == "nw fk" || name == "nw hk" || name == "gem fk" || name == "gem hk" || name == "ind. begl. hk" || name == "hw")
{
return new LhCoburgWohnheimInvoiceCreation();
}
}
}
}

View File

@@ -0,0 +1,175 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Forms.VisualStyles;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.Invoicing;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using BS.Shared.Services;
namespace LebenshilfeCoburg.Invoicing
{
public class LhCoburgWohnheimInvoiceCreation : InvoiceCreation
{
private DateTime? accountingPeriodStart = null;
private DateTime? accountingPeriodEnd = null;
public override void SetInvoiceId(ServiceInvoice invoice)
{
invoice.InvoiceBase.InvoiceId = "Wohnheim";
invoice.InvoiceBase.InvoiceTypeText = "Wohnheim";
}
public override void SetInvoiceBaseData(int invoiceCounter, ServiceInvoice invoice, CostBearer costBearer, DateTimeSpan invoicePeriod,
IList<CompactSupportConceptDC> supportConceptList)
{
if (invoicePeriod != null)
{
accountingPeriodStart = invoicePeriod.StartDate;
accountingPeriodEnd = invoicePeriod.EndDate;
}
base.SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
}
public override void SetInvoiceItems(ServiceInvoice invoice,
ServiceInvoicePeriod serviceInvoicePeriod,
SupportConceptApprovalPeriodDC supportConceptApprovalPeriod,
CostBearer2SupportConcept cb2sc,
DateTimeSpan invoicePeriod,
List<ServiceRecordDC> serviceRecords)
{
CreateFixedAmounts(serviceInvoicePeriod, supportConceptApprovalPeriod, cb2sc);
}
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List<ServiceRecordDC> serviceRecords)
{
if (supportConcept.IsApproved)
{
var invoice = new ServiceInvoice();
var supportConceptList = new List<CompactSupportConceptDC> { supportConcept };
SetSenderInformation(invoice);
SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
SetSingleInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConcept);
SetRecipientInformation(invoice, costBearer);
serviceRecords = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(DAOFactory.SearchDAO.FindServiceRecordsInSpan(invoicePeriod, null))
.Where(s => s.ServiceDescription.CategoryName == "Arbeitszeitstunden" || s.ServiceDescription.CategoryName == "Nachtdienst" || s.ServiceDescription.CategoryName == "individuelle Begleitung Hilfskraft").ToList();
SetServiceInvoicePeriods(invoice, invoice.InvoiceBase.CostBearer2SupportConcept, invoicePeriod,
serviceRecords);
SetServiceInvoicePeriodAmounts(invoice);
// Spitzabrechnung
if (invoicePeriod == null)
{
SetAmountAdvancePayments(invoice);
SetAmountEquityContribution(invoice);
}
return invoice;
}
return null;
}
public override void SetServiceInvoicePeriods(ServiceInvoice invoice, CostBearer2SupportConcept costBearer2SupportConcept, DateTimeSpan invoicePeriod, List<ServiceRecordDC> serviceRecords)
{
var invoiceAccountingPeriodSpan = new DateTimeSpan
{
StartDateTime = invoice.InvoiceBase.AccountingPeriodStart.Value,
EndDateTime = invoice.InvoiceBase.AccountingPeriodEnd.Value
};
//foreach (SupportConceptApprovalPeriod iPeriod in costBearer2SupportConcept.ApprovalPeriodList)
//{
// SupportConceptApprovalPeriodDC approvalPeriodDC = MapperFactory.SupportConceptApprovalPeriodDC_SupportConceptApprovalPeriod.MapToNewDC(iPeriod);
//if (approvalPeriodDC.Span.EndDateTime < invoiceAccountingPeriodSpan.StartDateTime || approvalPeriodDC.Span.StartDateTime > invoiceAccountingPeriodSpan.EndDate)
//{
// continue;
//}
//ServiceInvoicePeriod serviceInvoicePeriod = CreateServiceInvoicePeriod(approvalPeriodDC, invoiceAccountingPeriodSpan);
//serviceInvoicePeriod.SupportConceptApprovalPeriod = iPeriod;
//serviceInvoicePeriod.Customer = costBearer2SupportConcept.SupportConcept.Customer;
//CostBearer costBearer = costBearer2SupportConcept.CostBearer;
//List<CostRatePeriodDC> costRates = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(costBearer.CostRatePeriods);
//CostRatePeriodDC serviceUnit = costRates.GetCostRatePeriodForDate(CostRatePeriodType.MinutesPerServiceUnit, DateTime.Now);
//serviceInvoicePeriod.ServiceUnitName = serviceUnit.UnitName;
//Calculations calc = PluginLoader.FindClass<Calculations>(_SpecificID) ?? Calculations.GetInstance(_SpecificID);
//decimal amountPerUnit;
//decimal unitCount;
//serviceInvoicePeriod.ApprovedFixedAmount = calc.GetApprovedFixedAmountForPeriod(approvalPeriodDC, serviceInvoicePeriod.Start.Value, serviceInvoicePeriod.End.Value, out amountPerUnit, out unitCount);
//if (!serviceInvoicePeriod.ApprovedFixedAmount.HasValue)
//{
// serviceInvoicePeriod.ApprovedHours = calc.GetApprovedHoursForPeriod(approvalPeriodDC,
// costRates,
// serviceInvoicePeriod.Start.Value,
// serviceInvoicePeriod.End.Value);
// if (serviceInvoicePeriod.ApprovedHours.HasValue)
// serviceInvoicePeriod.ApprovedBE = serviceUnit.GetHoursInBE(serviceInvoicePeriod.ApprovedHours.Value);
// serviceInvoicePeriod.ApprovedAmountDefaultHourlyRate = calc.GetApprovedAmountDefaultHourlyRateForPeriod(approvalPeriodDC,
// costRates,
// serviceInvoicePeriod.Start,
// serviceInvoicePeriod.End);
//}
//SetInvoiceItems(invoice, serviceInvoicePeriod, approvalPeriodDC, costBearer2SupportConcept, invoicePeriod, serviceRecords);
//CheckMaxApprovedAmount(invoice, serviceInvoicePeriod, approvalPeriodDC, costBearer2SupportConcept, invoicePeriod, serviceRecords);
//if (serviceInvoicePeriod.InvoiceItemList.Count > 0)
// invoice.ServiceInvoicePeriodList.Add(serviceInvoicePeriod);
}
}
public override void CreateFixedAmounts(ServiceInvoicePeriod serviceInvoicePeriod, SupportConceptApprovalPeriodDC supportConceptApprovalPeriod, CostBearer2SupportConcept cb2sc)
{
var calc = PluginLoader.FindClass<Calculations>(_SpecificID) ?? Calculations.GetInstance(_SpecificID);
//var data = calc.GetFixedBillingData(supportConceptApprovalPeriod, serviceInvoicePeriod.Start, serviceInvoicePeriod.End);
//foreach (var billingData in data)
//{
// 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
// });
//}
}
}
}

View File

@@ -79,6 +79,7 @@
<Compile Include="AusbildungsassistenzRechnung.Designer.cs">
<DependentUpon>AusbildungsassistenzRechnung.cs</DependentUpon>
</Compile>
<Compile Include="Invoicing\LhCoburgWohnheimInvoiceCreation.cs" />
<Compile Include="LHCoburgReportCreator.cs" />
<Compile Include="PersoenlichesBudgetRechnung.cs">
<SubType>Component</SubType>