LWLDigga - Finetuning - für Übergabe Umstellungsdatum aus Custom.dlls
This commit is contained in:
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -28,15 +29,15 @@ namespace BeWo.Report.ReportObjects
|
||||
{
|
||||
// die gesamte Berechnung ist für Anhang zum Budgetnachweis und für die Berechnung der Rechnung identisch, daher in Extraklasse LWLDiggaBerechnnung gelagert
|
||||
CostBearer2SupportConcept cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(si.CostBearer2SupportConceptOid.Value);
|
||||
this.BewilligtStart = si.AccountingPeriodStart.Value;
|
||||
this.BewilligtEnde = si.AccountingPeriodEnd.Value;
|
||||
LWLDiggaBerechnung = new LWLDiggaBerechnung();
|
||||
BewilligtStart = si.AccountingPeriodStart.Value;
|
||||
BewilligtEnde = si.AccountingPeriodEnd.Value;
|
||||
LWLDiggaBerechnung = PluginLoader.FindClass<LWLDiggaBerechnung>() ?? new LWLDiggaBerechnung();
|
||||
LWLDiggaBerechnung.CreateLWLDiggaBerechnung(si, cb2sc, BewilligtStart, BewilligtEnde);
|
||||
|
||||
Customer customer = cb2sc.SupportConcept.Customer;
|
||||
this.SettlementDC = si;
|
||||
this.Costbearer2SupportConceptDC = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(cb2sc);
|
||||
this.CustomerDC = MapperFactory.CustomerDC_Customer.MapToNewDC(customer);
|
||||
SettlementDC = si;
|
||||
Costbearer2SupportConceptDC = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(cb2sc);
|
||||
CustomerDC = MapperFactory.CustomerDC_Customer.MapToNewDC(customer);
|
||||
MonatsZeilen = LWLDiggaBerechnung.MonatsZeilen;
|
||||
Entgeltzeitraeume = LWLDiggaBerechnung.Entgeltzeitraeume;
|
||||
}
|
||||
|
||||
@@ -13,8 +13,9 @@ using BS.Shared.Services;
|
||||
|
||||
namespace BeWo.Service.Invoicing
|
||||
{
|
||||
public class LWLDiggaBerechnung : AbstractIDSpecificDefaultClass<LWLDiggaBerechnung>
|
||||
{
|
||||
public class LWLDiggaBerechnung : AbstractIDSpecificDefaultClass<LWLDiggaBerechnung>
|
||||
{
|
||||
public DateTime? Umstellungsdatum { get; set; }
|
||||
public DateTime BewilligtStart { get; set; }
|
||||
public DateTime BewilligtEnde { get; set; }
|
||||
public List<EntgeltzeitraumDigga> Entgeltzeitraeume { get; set; }
|
||||
@@ -30,8 +31,18 @@ namespace BeWo.Service.Invoicing
|
||||
public decimal SummeGesamtStunden { get; set; }
|
||||
public decimal SummeGesamtStundenMitFK { get; set; }
|
||||
|
||||
public virtual void InitBerechnung()
|
||||
{
|
||||
// Nur für abgeleitete Klassen, wenn benötigt, z.B. zum Setzen des Umstellungsdatums
|
||||
// letzter Tag mit alter Rundung (Variante 1) in Zeitervassung
|
||||
// Umstellungsdatum = new DateTime(2025, 08, 31);
|
||||
}
|
||||
|
||||
|
||||
public virtual void CreateLWLDiggaBerechnung(Settlement2DC si, CostBearer2SupportConcept cb2sc, DateTime? BewilligtStart, DateTime? BewilligtEnde)
|
||||
{
|
||||
InitBerechnung();
|
||||
|
||||
var serviceRecords = GetBillableServiceRecords(cb2sc);
|
||||
this.BewilligtStart = si.AccountingPeriodStart.Value;
|
||||
this.BewilligtEnde = si.AccountingPeriodEnd.Value;
|
||||
@@ -79,13 +90,10 @@ namespace BeWo.Service.Invoicing
|
||||
|
||||
private void CalculateMonatsMinutenWerteMitRundung(List<BudgetnachweisDiggaMonatsZeile> MonatsZeilen)
|
||||
{
|
||||
var lwlSIC = PluginLoader.FindClass<SettlementInvoiceCreation>("LWLDigga") ?? SettlementInvoiceCreation.GetInstance("LWLDigga");
|
||||
DateTime ? uDate = lwlSIC.Umstellungsdatum();
|
||||
//bool neueRundung = lwlSIC.EndRundung();
|
||||
|
||||
|
||||
foreach (var mz in MonatsZeilen)
|
||||
{
|
||||
if (!uDate.HasValue || uDate.HasValue && mz.Monat > uDate)
|
||||
if (!Umstellungsdatum.HasValue || Umstellungsdatum.HasValue && mz.Monat > Umstellungsdatum)
|
||||
{
|
||||
mz.SummeMinutenGerundet = Math.Ceiling((mz.SummeFLMinuten + mz.SummeFLMinuten * 0.2m) / 10) * 10;
|
||||
mz.SummeFLStunden = Math.Round(mz.SummeMinutenGerundet / 60, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
@@ -16,14 +16,6 @@ namespace BeWo.Service.Invoicing
|
||||
[IDSpecificClass(Identifier = "LWLDigga")]
|
||||
public class LWLDiggaSettlementInvoiceCreation : SettlementInvoiceCreation
|
||||
{
|
||||
// AB, 20.1.0.2025: wird in jedem Kundenprojekt einzeln überschrieben
|
||||
//public override DateTime? Umstellungsdatum()
|
||||
//{
|
||||
// // letzter Tag mit alter Rundung (Variante 1) in Zeitervassung
|
||||
// return new DateTime(2025, 08, 31);
|
||||
//}
|
||||
|
||||
|
||||
public override bool CanCreateInvoiceTheOldWay(Settlement2DC si, CostBearer2SupportConcept c2s)
|
||||
{
|
||||
return false;
|
||||
@@ -32,7 +24,7 @@ namespace BeWo.Service.Invoicing
|
||||
public override void CreateInvoiceDetails(Settlement2DC si, CostBearer2SupportConcept cb2sc, DateTime? BewilligtStart, DateTime? BewilligtEnde)
|
||||
{
|
||||
// die gesamte Berechnung ist für Anhang zum Budgetnachweis und für die Berechnung der Rechnung identisch, daher in Extraklasse LWLDiggaBerechnnung gelagert
|
||||
LWLDiggaBerechnung lwlCore = new LWLDiggaBerechnung();
|
||||
LWLDiggaBerechnung lwlCore = PluginLoader.FindClass<LWLDiggaBerechnung>() ?? new LWLDiggaBerechnung();
|
||||
lwlCore.CreateLWLDiggaBerechnung(si, cb2sc, BewilligtStart, BewilligtEnde);
|
||||
var calc = PluginLoader.FindClass<Calculations>(_SpecificID) ?? Calculations.GetInstance(_SpecificID);
|
||||
var relDC = cb2sc.MapToNewDC();
|
||||
@@ -75,10 +67,6 @@ namespace BeWo.Service.Invoicing
|
||||
ii.UnitCount = e.SummeFLStunden;
|
||||
ii.AmountTotal = Math.Round(ii.UnitCount.Value * ii.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
|
||||
ii.GrossAmountTotal = ii.AmountTotal;
|
||||
//ii.MaxApprovedAmount = accountingPeriod.MaxApprovedAmount;
|
||||
//ii.MaxApprovedUnitCount = accountingPeriod.MaxApprovedUnitCount;
|
||||
//ii.ApprovedPerUnit = accountingPeriod.ApprovedPerUnit;
|
||||
//ii.ApprovalUnit = accountingPeriod.ApprovalUnit;
|
||||
list.Add(ii);
|
||||
}
|
||||
if (e.SummeFehlkontakteStunden > 0)
|
||||
@@ -93,10 +81,6 @@ namespace BeWo.Service.Invoicing
|
||||
iiF.UnitCount = e.SummeFehlkontakteStunden;
|
||||
iiF.AmountTotal = Math.Round(iiF.UnitCount.Value * iiF.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
|
||||
iiF.GrossAmountTotal = iiF.AmountTotal;
|
||||
//ii.MaxApprovedAmount = accountingPeriod.MaxApprovedAmount;
|
||||
//ii.MaxApprovedUnitCount = accountingPeriod.MaxApprovedUnitCount;
|
||||
//ii.ApprovedPerUnit = accountingPeriod.ApprovedPerUnit;
|
||||
//ii.ApprovalUnit = accountingPeriod.ApprovalUnit;
|
||||
list.Add(iiF);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user