Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo

This commit is contained in:
2025-03-24 16:13:48 +01:00
7 changed files with 62 additions and 11 deletions

View File

@@ -53,6 +53,8 @@ namespace ChristianWilke.Invoicing
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc)
{
var ii = base.CreateInvoiceItem(iServiceRecord, scap, calc);
ii.ItemDescription = iServiceRecord.ServiceDescription.CategoryName;
if (ii.ItemDescription != null && ii.ItemDescription.Contains("- ohne Wegzeiten Pauschale"))
{
ii.ItemDescription = ii.ItemDescription.Replace("- ohne Wegzeiten Pauschale", "");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -16,5 +16,51 @@ namespace Mittelpunkt.Invoicing
{
return false;
}
}
public override void CalculateInvoiceItemAmounts(Settlement2DC si)
{
decimal flsBudgetGesamt = si.ApprovedFLS ?? 0;
decimal flsAufgebraucht = 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)
{
gewichteteStunden = flsBudgetGesamt - flsAufgebraucht;
ii.UnitCount = gewichteteStunden / relation;
}
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;
}
}
}
}
}
}

View File

@@ -48,7 +48,7 @@ namespace MobileEV
kategorieZuStunden.Add(service.ServiceCategory, 0m);
kategorieZuServices[service.ServiceCategory].Add(service);
kategorieZuStunden[service.ServiceCategory] += Convert.ToDecimal(service.Minutes / 60);
kategorieZuStunden[service.ServiceCategory] += Convert.ToDecimal(Math.Round(service.Minutes / 60, 2));
summeGesamt += Math.Round(Convert.ToDecimal(service.Minutes / 60), 2, MidpointRounding.AwayFromZero);
}
@@ -64,6 +64,7 @@ namespace MobileEV
}
var minuten = 0d;
var stunden = 0d;
var counter = 1;
foreach (var item in services)
@@ -76,6 +77,7 @@ namespace MobileEV
eintrag.Notice5 = counter.ToString();
counter++;
minuten += eintrag.Minutes;
stunden += Math.Round(eintrag.Minutes / 60, 2);
if (i == item.Value.Count - 1)
{
@@ -85,9 +87,10 @@ namespace MobileEV
ServiceCategory = eintrag.ServiceCategory,
ServiceDescription = eintrag.ServiceDescription,
StartDateString = "",
Minutes = minuten
Minutes = stunden * 60
});
minuten = 0;
stunden = 0;
counter = 1;
}
}