MH: Schubkraft bzw ABCBetreuungenReports Pauschalen Update
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user