Merge Konflikt beseitigt
This commit is contained in:
@@ -895,20 +895,21 @@ namespace BeWo.Service.Invoicing
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void CalculateInvoiceItemAmounts(Settlement2DC si)
|
||||
{
|
||||
decimal flsBudgetGesamt = si.ApprovedFLS ?? 0;
|
||||
public virtual void CalculateInvoiceItemAmounts(Settlement2DC si)
|
||||
{
|
||||
decimal flsBudgetGesamt = si.ApprovedFLS ?? 0;
|
||||
decimal flsAufgebraucht = 0;
|
||||
|
||||
foreach (var ii in si.InvoiceItems)
|
||||
{
|
||||
if (ii.UnitCount.HasValue)
|
||||
{
|
||||
// dieser Abschnitt prüft und kappt ggf. Stunden bei Überschreitung Budget - unter Berücksichtigung ProzentBudget in Leistung(skategorien)
|
||||
var unitCountBudget = Math.Round(ii.UnitCountBudget ?? ii.UnitCount ?? 0, 2, MidpointRounding.AwayFromZero);
|
||||
ii.UnitCount = Math.Round(ii.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
|
||||
if (ii.UnitCount.Value > 0)
|
||||
foreach (var ii in si.InvoiceItems)
|
||||
{
|
||||
if (ii.UnitCount.HasValue)
|
||||
{
|
||||
if (ii.UnitCount > 0)
|
||||
{
|
||||
// dieser Abschnitt prüft und kappt ggf. Stunden bei Überschreitung Budget - unter Berücksichtigung ProzentBudget in Leistung(skategorien)
|
||||
var unitCountBudget = Math.Round(ii.UnitCountBudget ?? ii.UnitCount ?? 0, 2, MidpointRounding.AwayFromZero);
|
||||
ii.UnitCount = Math.Round(ii.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
var relation = unitCountBudget / ii.UnitCount.Value;
|
||||
var gewichteteStunden = ii.UnitCount * relation;
|
||||
if (gewichteteStunden > flsBudgetGesamt - flsAufgebraucht)
|
||||
@@ -918,30 +919,30 @@ namespace BeWo.Service.Invoicing
|
||||
}
|
||||
flsAufgebraucht += ii.UnitCount.Value * relation;
|
||||
}
|
||||
|
||||
if (ii.AmountPerUnit.HasValue)
|
||||
{
|
||||
{
|
||||
if (!String.IsNullOrEmpty(ii.ItemDescription) && ii.ItemDescription == "Fehlkontakte" && ii.ProzentAbrechenbar.HasValue)
|
||||
{
|
||||
ii.AmountPerUnit = ii.AmountPerUnit * ii.ProzentAbrechenbar / 100;
|
||||
}
|
||||
ii.AmountTotal = ii.UnitCount.Value * 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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;
|
||||
|
||||
public virtual void CalculateSettlementInvoiceApprovedAmounts(Settlement2DC si, SupportConceptCostBearerRelDC relDC,
|
||||
}
|
||||
if (ii.MaxApprovedUnitCount < ii.UnitCount)
|
||||
{
|
||||
ii.MaxApprovedUnitCount = ii.UnitCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void CalculateSettlementInvoiceApprovedAmounts(Settlement2DC si, SupportConceptCostBearerRelDC relDC,
|
||||
Calculations calc)
|
||||
{
|
||||
decimal flsWeek = calc.GetApprovedHoursPerWeekAverage(relDC, true) ?? 0m;
|
||||
|
||||
Reference in New Issue
Block a user