EndartFabrik/Invoicing/CustomInvoiceCreation - Bezeichung Leistung u Faktor auch auf Verwaltungspreisen

This commit is contained in:
2025-12-17 11:05:52 +01:00
parent cb967c812b
commit d1f93bb2d2
3 changed files with 58 additions and 0 deletions

View File

@@ -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">

View 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;
}
}
}

View 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();
}
}
}