CaritasverbandOstvest/Invoicing/CustomInvoiceCreation - auch für nicht bew. HPs
This commit is contained in:
@@ -72,6 +72,8 @@
|
||||
<Compile Include="InvoiceCustomerReport.Designer.cs">
|
||||
<DependentUpon>InvoiceCustomerReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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 CaritasOstvest.Invoicing
|
||||
{
|
||||
public class CustomInvoiceCreation : InvoiceCreation
|
||||
{
|
||||
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List<ServiceRecordDC> serviceRecords)
|
||||
{
|
||||
if (!supportConcept.IsDeleted && !supportConcept.IsArchived) // Standard, außer dass auch nicht bewilligte abgerechnet werden
|
||||
{
|
||||
var invoice = new ServiceInvoice();
|
||||
var supportConceptList = new List<CompactSupportConceptDC> { supportConcept };
|
||||
|
||||
SetSenderInformation(invoice);
|
||||
SetInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConceptList);
|
||||
SetSingleInvoiceBaseData(invoiceCounter, invoice, costBearer, invoicePeriod, supportConcept);
|
||||
SetRecipientInformation(invoice, costBearer);
|
||||
SetServiceInvoicePeriods(invoice, invoice.InvoiceBase.CostBearer2SupportConcept, invoicePeriod,
|
||||
serviceRecords);
|
||||
|
||||
SetServiceInvoicePeriodAmounts(invoice);
|
||||
|
||||
// Spitzabrechnung
|
||||
if (invoicePeriod == null)
|
||||
{
|
||||
SetAmountAdvancePayments(invoice);
|
||||
SetAmountEquityContribution(invoice);
|
||||
}
|
||||
|
||||
return invoice;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 CaritasOstvest.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