MH: Autismus Köln Bonn Spitzabrechnung Rundung
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceNumberGenerator.cs" />
|
||||
<Compile Include="Invoicing\CustomSettlementInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\DefaultInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\SelbstzahlerInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\FactorInvoiceCreation.cs" />
|
||||
|
||||
@@ -37,5 +37,9 @@ namespace AutismusKoelnBonn.Invoicing
|
||||
|
||||
return new InvoiceCreation();
|
||||
}
|
||||
}
|
||||
public override SettlementInvoiceCreation CreateSettlementInvoiceCreator(string costbearerId, string tenant, CostBearer2SupportConcept lCb2Sc)
|
||||
{
|
||||
return new CustomSettlementInvoiceCreation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using BeWo.Service.Invoicing;
|
||||
using BS.Shared.DataContracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AutismusKoelnBonn.Invoicing
|
||||
{
|
||||
public class CustomSettlementInvoiceCreation : SettlementInvoiceCreation
|
||||
{
|
||||
// Änderung: Rundung von AmountTotal
|
||||
public override void CalculateInvoiceItemAmounts(Settlement2DC si)
|
||||
{
|
||||
decimal maxApprovedFls = si.ApprovedFLS ?? 0;
|
||||
|
||||
foreach (var ii in si.InvoiceItems)
|
||||
{
|
||||
if (ii.UnitCount.HasValue)
|
||||
{
|
||||
var unitCountBudget = Math.Round(ii.UnitCountBudget ?? ii.UnitCount ?? 0, 2, MidpointRounding.AwayFromZero);
|
||||
if (maxApprovedFls < unitCountBudget)
|
||||
unitCountBudget = maxApprovedFls;
|
||||
|
||||
maxApprovedFls -= unitCountBudget;
|
||||
|
||||
if (unitCountBudget < ii.UnitCount)
|
||||
{
|
||||
ii.UnitCount = unitCountBudget;
|
||||
}
|
||||
if (ii.AmountPerUnit.HasValue)
|
||||
{
|
||||
// ÄNDERUNG NACHFOLGENDE ZEILE
|
||||
ii.AmountTotal = Math.Round(ii.UnitCount.Value, 2, MidpointRounding.AwayFromZero) * ii.AmountPerUnit.Value;
|
||||
if (ii.RateFactor.HasValue && ii.RateFactor.Value != 0)
|
||||
ii.GrossAmountTotal = Math.Round(ii.AmountTotal.Value * ((100m + ii.RateFactor.Value) / 100m), 2,
|
||||
MidpointRounding.AwayFromZero);
|
||||
else
|
||||
ii.GrossAmountTotal = ii.AmountTotal;
|
||||
|
||||
}
|
||||
if (ii.MaxApprovedUnitCount < ii.UnitCount)
|
||||
{
|
||||
ii.MaxApprovedUnitCount = ii.UnitCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user