MH: AssL aus Spitzabrechnungen entfernt für Aidshilfe Duisburg
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Invoicing;
|
||||
@@ -70,5 +71,67 @@ namespace AidsHilfeDuisburg.Invoicing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override List<InvoiceItemDC> CreateInvoiceItemsForAccountingPeriods(Settlement2DC si, List<AccountingPeriod> accountingPeriods,
|
||||
List<CostRatePeriodDC> costRatePeriods, Calculations calc)
|
||||
{
|
||||
Dictionary<long, SupportConceptApprovalPeriodDC> oid2Scap = new Dictionary<long, SupportConceptApprovalPeriodDC>();
|
||||
List<InvoiceItemDC> invoiceItems = new List<InvoiceItemDC>();
|
||||
var cb2sc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(DAOFactory.GenericDAO.GetByID<CostBearer2SupportConcept>(si.CostBearer2SupportConceptOid.Value));
|
||||
foreach (var ap in accountingPeriods)
|
||||
{
|
||||
if (ap.ServiceCategory.Name.Contains("Assistenz"))
|
||||
continue;
|
||||
|
||||
InvoiceItemDC ii = CreateInvoiceItemForAccountingPeriod(ap);
|
||||
invoiceItems.Add(ii);
|
||||
|
||||
var scap = ap.SupportConceptApprovalPeriod;
|
||||
SupportConceptApprovalPeriodDC scapHelper = null;
|
||||
|
||||
if (scap != null)
|
||||
{
|
||||
if (oid2Scap.ContainsKey(scap.SupportConceptApprovalPeriodOid.Value))
|
||||
scapHelper = oid2Scap[scap.SupportConceptApprovalPeriodOid.Value];
|
||||
else
|
||||
{
|
||||
scapHelper = new SupportConceptApprovalPeriodDC();
|
||||
scapHelper.ApprovedBETotal = scap.ApprovedBETotal;
|
||||
if (!scapHelper.ApprovedBETotal.HasValue)
|
||||
scapHelper.ApprovedBETotal = calc.GetApprovedBETotal(scap, costRatePeriods);
|
||||
|
||||
oid2Scap[scap.SupportConceptApprovalPeriodOid.Value] = scapHelper;
|
||||
}
|
||||
}
|
||||
|
||||
if (!si.ApprovedFLS.HasValue)
|
||||
{
|
||||
if (scapHelper.ApprovedBETotal.HasValue && ii.UnitCount.HasValue)
|
||||
{
|
||||
if (scapHelper.ApprovedBETotal >= ii.UnitCount.Value)
|
||||
{
|
||||
scapHelper.ApprovedBETotal -= ii.UnitCount.Value;
|
||||
ii.MaxApprovedUnitCount = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
ii.MaxApprovedUnitCount = scapHelper.ApprovedBETotal;
|
||||
}
|
||||
}
|
||||
|
||||
CalculateInvoiceItemAmounts(ii);
|
||||
}
|
||||
|
||||
if (ii.UnitCount.HasValue)
|
||||
{
|
||||
si.RecordedBillableFLSBrutto = (si.RecordedBillableFLSBrutto ?? 0) + ii.UnitCount;
|
||||
si.RecordedBillableFLSNetto = si.RecordedBillableFLSBrutto ?? 0;
|
||||
}
|
||||
|
||||
var list = CreateAdditionalInvoiceItems(ap);
|
||||
invoiceItems.AddRange(list);
|
||||
}
|
||||
return invoiceItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user