66 lines
2.7 KiB
C#
66 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.Invoicing;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.Services;
|
|
|
|
namespace BellaDonna.Invoicing
|
|
{
|
|
|
|
public class DefaultInvoiceCreation : InvoiceCreation
|
|
{
|
|
public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer)
|
|
{
|
|
|
|
base.SetRecipientInformation(serviceInvoice, costBearer);
|
|
|
|
/*if (costBearer.Organisation.Name.Contains("Jugendamt"))
|
|
{
|
|
if (serviceInvoice.InvoiceBase.CostBearer2SupportConcept != null &&
|
|
serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CostBearerContactPerson != null)
|
|
{
|
|
var address = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CostBearerContactPerson
|
|
.InvoiceAddress;
|
|
if (address == null)
|
|
{
|
|
address = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CostBearerContactPerson
|
|
.Address;
|
|
}
|
|
|
|
if (address != null)
|
|
{
|
|
serviceInvoice.InvoiceBase.RecipientAddress = address.CopyToNew();
|
|
|
|
serviceInvoice.InvoiceBase.RecipientPersonFirstName = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CostBearerContactPerson.FirstName;
|
|
serviceInvoice.InvoiceBase.RecipientPersonLastName = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CostBearerContactPerson.LastName;
|
|
}
|
|
}
|
|
}
|
|
else */if (!costBearer.Organisation.Name.Contains("Jugendamt") && serviceInvoice.InvoiceBase.CostBearer2SupportConcept != null)
|
|
{
|
|
var cust = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.SupportConcept.Customer;
|
|
|
|
if (cust.Person.InvoiceAddress != null)
|
|
{
|
|
serviceInvoice.InvoiceBase.RecipientAddress = cust.Person.InvoiceAddress.CopyToNew();
|
|
|
|
serviceInvoice.InvoiceBase.RecipientPersonFirstName = cust.Person.FirstName;
|
|
serviceInvoice.InvoiceBase.RecipientPersonLastName = cust.Person.LastName;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public override IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap,
|
|
Calculations calc)
|
|
{
|
|
return base.CreateSummaryInvoiceItems(itemList, invoicePeriod, scap, calc, false, true);
|
|
}
|
|
}
|
|
}
|