SKFAlsdorf/Invoicing/SettlementInvoiceCreation.cs - Avise auch ohne Rechnungspositionen
SupportOID=169088
This commit is contained in:
44
ReportImp/SKFAlsdorf/Invoicing/SettlementInvoiceCreation.cs
Normal file
44
ReportImp/SKFAlsdorf/Invoicing/SettlementInvoiceCreation.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.Invoicing;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
|
||||
namespace BeWo.SKFAlsdorf.Invoicing
|
||||
{
|
||||
public class CustomSettlementInvoiceCreation : SettlementInvoiceCreation
|
||||
{
|
||||
public override void CalculateAdvancedPayments(Settlement2DC settlementInvoice, CostBearer2SupportConcept cb2sc)
|
||||
{
|
||||
// die haben eine Spitzabrechnung nach 2 Jahren ohne eine Buchung, wollen aber die Avise ausweisen, daher if invoiceItems != null entfernt
|
||||
decimal amountTotal = 0;
|
||||
var bookingList = cb2sc.AccountingTransactions;
|
||||
|
||||
foreach (var item in bookingList)
|
||||
{
|
||||
if (item.GueltigkeitsDatum.HasValue)
|
||||
{
|
||||
foreach (var ii in settlementInvoice.InvoiceItems)
|
||||
{
|
||||
if (ii.ItemPeriodStart.HasValue && ii.ItemPeriodEnd.HasValue)
|
||||
{
|
||||
if (item.GueltigkeitsDatum.Value.InBetween(ii.ItemPeriodStart.Value, ii.ItemPeriodEnd.Value, true))
|
||||
{
|
||||
ii.ReceivedAmount += item.Amount;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
amountTotal += item.Amount;
|
||||
}
|
||||
|
||||
settlementInvoice.AmountAdvancedPayments = amountTotal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CustomMitarbeiterstundenkontoBerechnung.cs" />
|
||||
<Compile Include="Invoicing\SettlementInvoiceCreation.cs" />
|
||||
<Compile Include="Mitarbeiterstundenkonto.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
Reference in New Issue
Block a user