SHKService/Invoicing/CollectiveInvoiceCreation.cs - Abfangen von keine Min in Bew

This commit is contained in:
2024-08-26 16:48:54 +02:00
parent db1dbeca5d
commit 503f378181

View File

@@ -90,44 +90,48 @@ namespace SHKService.Invoicing
SupportConceptApprovalPeriodOid = supportConceptApprovalPeriod.SupportConceptApprovalPeriodOid,
AccountingInterval = AccountingIntervalType.Daily,
UnitCount = (decimal)(end - start).TotalDays + 1,
Notice = String.Format("{0:n0}", supportConceptApprovalPeriod.ApprovedBEPerInterval.Value)
Notice = "keine Minuten"
};
if (supportConceptApprovalPeriod.ServiceCategory.Name == "Fahrzeit")
if (supportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue)
{
if (cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * AMOUNT_PER_KMKA;
ii.ItemDescription = "Fahrzeiten KA";
}
else
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * AMOUNT_PER_KMQA;
ii.ItemDescription = "Fahrzeiten QA";
}
}
else
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * (decimal)Math.Round((double)data[0].AmountTotal / 60, 4, MidpointRounding.AwayFromZero);
if (!cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
var LG = (decimal)GetLeistungsgruppe(supportConceptApprovalPeriod.ApprovedBEPerInterval);
if (data.Count > 0 && data[0].AmountTotal != null)
ii.Notice = String.Format("{0:n0}", supportConceptApprovalPeriod.ApprovedBEPerInterval.Value);
if (supportConceptApprovalPeriod.ServiceCategory.Name == "Fahrzeit")
{
ii.AmountPerUnit = (decimal)Math.Round((double)data[0].AmountTotal * Math.Round((double)LG / 60, 2, MidpointRounding.AwayFromZero), 2, MidpointRounding.AwayFromZero);
//ii.AmountPerUnit = LG * (decimal)Math.Round((double)data[0].AmountTotal / 60, 4, MidpointRounding.AwayFromZero);
if (cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * AMOUNT_PER_KMKA;
ii.ItemDescription = "Fahrzeiten KA";
}
else
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * AMOUNT_PER_KMQA;
ii.ItemDescription = "Fahrzeiten QA";
}
}
else
{
ii.AmountPerUnit = supportConceptApprovalPeriod.ApprovedBEPerInterval * (decimal)Math.Round((double)data[0].AmountTotal / 60, 4, MidpointRounding.AwayFromZero);
if (!cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
var LG = (decimal)GetLeistungsgruppe(supportConceptApprovalPeriod.ApprovedBEPerInterval);
if (data.Count > 0 && data[0].AmountTotal != null)
{
ii.AmountPerUnit = (decimal)Math.Round((double)data[0].AmountTotal * Math.Round((double)LG / 60, 2, MidpointRounding.AwayFromZero), 2, MidpointRounding.AwayFromZero);
//ii.AmountPerUnit = LG * (decimal)Math.Round((double)data[0].AmountTotal / 60, 4, MidpointRounding.AwayFromZero);
}
ii.ItemDescription = "Qualifizierte Assistenz";
ii.Notice = LG.ToString();
}
if (cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
ii.ItemDescription = "Kompensatorische Assistenz";
}
}
ii.ItemDescription = "Qualifizierte Assistenz";
ii.Notice = LG.ToString();
}
if (cb2sc.SupportConcept.Customer.Person.LastNameFirstName.ToLower().Contains("(ka"))
{
ii.ItemDescription = "Kompensatorische Assistenz";
}
}
ii.AmountPerUnit = Math.Round((decimal)ii.AmountPerUnit, 2, MidpointRounding.AwayFromZero);
ii.AmountTotal = ii.UnitCount * ii.AmountPerUnit;
ii.GrossAmountTotal = ii.AmountTotal;
ii.AmountPerUnit = Math.Round((decimal)ii.AmountPerUnit, 2, MidpointRounding.AwayFromZero);
ii.AmountTotal = ii.UnitCount * ii.AmountPerUnit;
ii.GrossAmountTotal = ii.AmountTotal;
}
serviceInvoicePeriod.InvoiceItemList.Add(ii);
}
}