EndartFabrik/Invoicing/CustomInvoiceCreation - Bezeichung Leistung u Faktor auch auf Verwaltungspreisen
This commit is contained in:
@@ -63,6 +63,8 @@
|
||||
<Compile Include="InvoiceCustomerReport.Designer.cs">
|
||||
<DependentUpon>InvoiceCustomerReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="Invoicing\SettlementInvoiceCreation.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
|
||||
39
ReportImp/EndartFabrik/Invoicing/CustomInvoiceCreation.cs
Normal file
39
ReportImp/EndartFabrik/Invoicing/CustomInvoiceCreation.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Services;
|
||||
|
||||
namespace EndartFabrik.Invoicing
|
||||
{
|
||||
public class CustomInvoiceCreation : InvoiceCreation
|
||||
{
|
||||
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, BS.Shared.Services.Calculations calc)
|
||||
{
|
||||
var ii = base.CreateInvoiceItem(iServiceRecord, scap, calc);
|
||||
ii.ItemDescription = "Fachleistung";
|
||||
|
||||
if (!ii.RateFactor.HasValue)
|
||||
{
|
||||
var rateFactor = iServiceRecord.CostBearer.CostRatePeriods.GetCostRatePeriodForDate(CostRatePeriodType.RateFactor, iServiceRecord.Start.Value);
|
||||
if (rateFactor != null && rateFactor.CostRateValue.HasValue
|
||||
&& !(iServiceRecord.ServiceDescription.Name.ToLower().Contains("fehlkontakt") || (iServiceRecord.ServiceDescription.ProzentAbrechnung.HasValue && iServiceRecord.ServiceDescription.ProzentAbrechnung.Value < 100)))
|
||||
{
|
||||
ii.RateFactor = rateFactor.CostRateValue;
|
||||
//ii.UnitCount = ii.UnitCount.Value * ((100 + ii.RateFactor.Value) / 100);
|
||||
//ii.GrossAmountTotal = ii.UnitCount * (ii.AmountPerUnit ?? 0);
|
||||
}
|
||||
}
|
||||
return ii;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
ReportImp/EndartFabrik/Invoicing/CustomInvoiceFactory.cs
Normal file
17
ReportImp/EndartFabrik/Invoicing/CustomInvoiceFactory.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
|
||||
namespace EndartFabrik.Invoicing
|
||||
{
|
||||
public class CustomInvoiceFactory : InvoiceFactory
|
||||
{
|
||||
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
|
||||
{
|
||||
return new CustomInvoiceCreation();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user