46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
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 KetteReports.Invoicing
|
|
{
|
|
public class SelbstzahlerInvoiceCreation : InvoiceCreation
|
|
{
|
|
public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer)
|
|
{
|
|
base.SetRecipientInformation(serviceInvoice, costBearer);
|
|
|
|
String name = costBearer.Organisation.Name;
|
|
|
|
if (costBearer.Organisation.InvoiceAddress != null)
|
|
{
|
|
if (!String.IsNullOrWhiteSpace(costBearer.Organisation.InvoiceAddress.AddressLine1))
|
|
{
|
|
name = costBearer.Organisation.InvoiceAddress.AddressLine1;
|
|
}
|
|
|
|
}
|
|
else if (costBearer.Organisation.Address != null)
|
|
{
|
|
if (!String.IsNullOrWhiteSpace(costBearer.Organisation.Address.AddressLine1))
|
|
{
|
|
name = costBearer.Organisation.Address.AddressLine1;
|
|
}
|
|
}
|
|
|
|
serviceInvoice.InvoiceBase.RecipientOrganisation = name;
|
|
}
|
|
}
|
|
}
|