MH: HiBA InvoiceCreation
This commit is contained in:
@@ -72,55 +72,55 @@ namespace Hiba
|
||||
public override IList<InvoiceItem> CreateInvoiceItems(List<ServiceRecordDC> serviceRecordsInPeriod, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap, Calculations calc)
|
||||
{
|
||||
var list = new List<InvoiceItem>();
|
||||
//foreach (ServiceRecordDC iServiceRecord in serviceRecordsInPeriod)
|
||||
//{
|
||||
// if (iServiceRecord.ServiceDescription.Category.IsBillable)
|
||||
// {
|
||||
// if (!iServiceRecord.AlreadyAccounted)
|
||||
// {
|
||||
// InvoiceItem invoiceItem = CreateInvoiceItem(iServiceRecord, scap, calc);
|
||||
// if (invoiceItem != null)
|
||||
// {
|
||||
// list.Add(invoiceItem);
|
||||
foreach (ServiceRecordDC iServiceRecord in serviceRecordsInPeriod)
|
||||
{
|
||||
if (iServiceRecord.ServiceDescription.Category.IsBillable)
|
||||
{
|
||||
if (!iServiceRecord.AlreadyAccounted)
|
||||
{
|
||||
InvoiceItem invoiceItem = CreateInvoiceItem(iServiceRecord, scap, calc);
|
||||
if (invoiceItem != null)
|
||||
{
|
||||
list.Add(invoiceItem);
|
||||
|
||||
// if (iServiceRecord.Start.HasValue && iServiceRecord.Start.Value.Date >= new DateTime(2023, 10, 01) && // vor Auslieferung auf 01.01.2024 ändern
|
||||
// iServiceRecord.DistanceInMeter.HasValue && iServiceRecord.DistanceInMeter.Value > 0)
|
||||
// {
|
||||
// var amountPerUnit = invoiceItem.AmountPerUnit / 100 * 25;
|
||||
// var unitcount = 0m;
|
||||
// if (iServiceRecord.GroupPersonCount != null && iServiceRecord.GroupPersonCount.HasValue)
|
||||
// {
|
||||
// decimal count = iServiceRecord.GroupPersonCount.Value;
|
||||
// unitcount += 1 / count;
|
||||
// }
|
||||
// else
|
||||
// unitcount += 1;
|
||||
//if (iServiceRecord.Start.HasValue && iServiceRecord.Start.Value.Date >= new DateTime(2024, 01, 01) &&
|
||||
// iServiceRecord.DistanceInMeter.HasValue && iServiceRecord.DistanceInMeter.Value > 0)
|
||||
//{
|
||||
// var amountPerUnit = invoiceItem.AmountPerUnit / 100 * 25;
|
||||
// var unitcount = 0m;
|
||||
// if (iServiceRecord.GroupPersonCount != null && iServiceRecord.GroupPersonCount.HasValue)
|
||||
// {
|
||||
// decimal count = iServiceRecord.GroupPersonCount.Value;
|
||||
// unitcount += 1 / count;
|
||||
// }
|
||||
// else
|
||||
// unitcount += 1;
|
||||
|
||||
// iServiceRecord.DistanceInMeter = 0;
|
||||
// iServiceRecord.DistanceInMeter = 0;
|
||||
|
||||
// InvoiceItem wegepauschaleInvoiceItem = new InvoiceItem()
|
||||
// {
|
||||
// AccountingInterval = BS.Shared.AccountingIntervalType.FlatRate,
|
||||
// AmountPerUnit = amountPerUnit,
|
||||
// AmountTotal = amountPerUnit * unitcount,
|
||||
// GrossAmountTotal = amountPerUnit * unitcount,
|
||||
// ItemDescription = "Wegepauschale",
|
||||
// ItemPeriodStart = invoiceItem.ItemPeriodStart,
|
||||
// ItemPeriodEnd = invoiceItem.ItemPeriodEnd,
|
||||
// RateFactor = null,
|
||||
// SupportConceptApprovalPeriodOid = invoiceItem.SupportConceptApprovalPeriodOid,
|
||||
// UnitCount = unitcount,
|
||||
// UnitDescription = "Pauschal pro Fahrt"
|
||||
// };
|
||||
// list.Add(wegepauschaleInvoiceItem);
|
||||
// }
|
||||
// }
|
||||
// iServiceRecord.AlreadyAccounted = true;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
// InvoiceItem wegepauschaleInvoiceItem = new InvoiceItem()
|
||||
// {
|
||||
// AccountingInterval = BS.Shared.AccountingIntervalType.FlatRate,
|
||||
// AmountPerUnit = amountPerUnit,
|
||||
// AmountTotal = amountPerUnit * unitcount,
|
||||
// GrossAmountTotal = amountPerUnit * unitcount,
|
||||
// ItemDescription = "Wegepauschale",
|
||||
// ItemPeriodStart = invoiceItem.ItemPeriodStart,
|
||||
// ItemPeriodEnd = invoiceItem.ItemPeriodEnd,
|
||||
// RateFactor = null,
|
||||
// SupportConceptApprovalPeriodOid = invoiceItem.SupportConceptApprovalPeriodOid,
|
||||
// UnitCount = unitcount,
|
||||
// UnitDescription = "Pauschal pro Fahrt"
|
||||
// };
|
||||
// list.Add(wegepauschaleInvoiceItem);
|
||||
//}
|
||||
}
|
||||
iServiceRecord.AlreadyAccounted = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//list = CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc).ToList();
|
||||
list = CreateSummaryInvoiceItems(list, invoicePeriod, scap, calc).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user