MH: Schubkraft bzw ABCBetreuungenReports Pauschalen Update

This commit is contained in:
2025-02-05 10:23:32 +01:00
parent 6aebe7e6e3
commit 7554248c46
3 changed files with 36 additions and 5 deletions

View File

@@ -116,14 +116,16 @@ namespace ABCBetreuungenReports.Invoicing
private InvoiceItem CreateKontaktpauschalenItem(decimal? unitCount, DateTime? itemPeriodStart, DateTime? itemPeriodEnd)
{
decimal pauschale = PauschalenHelper.GetPreis("Kontaktpauschale", itemPeriodStart.Value);
var ii = new InvoiceItem()
{
UnitCount = unitCount,
ItemDescription = "Anfahrtspauschale",
UnitDescription = "Pauschale pro direktem Kontakt",
AmountPerUnit = PauschalenHelper._FAHRTKOSTENPAUSCHALE,
AmountTotal = PauschalenHelper._FAHRTKOSTENPAUSCHALE * unitCount,
GrossAmountTotal = PauschalenHelper._FAHRTKOSTENPAUSCHALE * unitCount,
AmountPerUnit = pauschale,
AmountTotal = pauschale * unitCount,
GrossAmountTotal = pauschale * unitCount,
ItemPeriodStart = itemPeriodStart,
ItemPeriodEnd = itemPeriodEnd,
RateFactor = 0

View File

@@ -116,7 +116,8 @@ namespace ABCBetreuungenReports.Invoicing
if (unitCount > 0)
{
decimal pauschale = PauschalenHelper._FAHRTKOSTENPAUSCHALE;
//decimal pauschale = PauschalenHelper._FAHRTKOSTENPAUSCHALE;
decimal pauschale = PauschalenHelper.GetPreis("Kontaktpauschale", accountingPeriod.PeriodStart);
invoiceItem = new InvoiceItemDC()
{

View File

@@ -1,7 +1,35 @@
namespace ABCBetreuungenReports.Invoicing
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared;
using BS.Shared.Extensions;
using System;
using System.Linq;
namespace ABCBetreuungenReports.Invoicing
{
public class PauschalenHelper
{
public const decimal _FAHRTKOSTENPAUSCHALE = 16.87m;
public static decimal GetPreis(String preisBezeichnung, DateTime datum)
{
var preise = DAOFactory.GenericDAO.GetAllActive<Preis>();
var preis = preise.Where(p => p.Name.Contains(preisBezeichnung)).FirstOrDefault();
if (preis != null)
{
var crlist = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(preis.CostRatePeriods);
var cr = crlist.GetCostRatePeriodForDate(CostRatePeriodType.AmountOfMoney, datum);
if (cr != null && cr.CostRateValue.HasValue)
{
return cr.CostRateValue.Value;
}
}
return 0;
}
}
}