77 lines
2.6 KiB
C#
77 lines
2.6 KiB
C#
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
using BS.Shared.Core;
|
|
using BeWo.Report;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System;
|
|
|
|
namespace FeidPartnerReports
|
|
{
|
|
[IDSpecificClass(Identifier = "SammelrechnungBthg")]
|
|
public partial class Invoice : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public Invoice()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
var sb = new StringBuilder();
|
|
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
|
|
{
|
|
sb.AppendLine(pRO.RecipientOrganisation);
|
|
}
|
|
if (!String.IsNullOrEmpty(pRO.RecipientAddressLine1))
|
|
{
|
|
sb.AppendLine(pRO.RecipientAddressLine1);
|
|
}
|
|
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
|
|
{
|
|
sb.AppendLine(pRO.RecipientDivision);
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson) && pRO.RecipientContactPerson != pRO.RecipientOrganisation)
|
|
{
|
|
sb.AppendLine(pRO.RecipientContactPerson);
|
|
}
|
|
if (!String.IsNullOrEmpty(pRO.RecipientPoBox))
|
|
{
|
|
sb.AppendLine(pRO.RecipientPoBox);
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.RecipientStreet) && String.IsNullOrEmpty(pRO.RecipientPoBox))
|
|
{
|
|
sb.AppendLine(pRO.RecipientStreet);
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
|
|
{
|
|
sb.AppendLine("");
|
|
sb.AppendLine(pRO.RecipientPostCodeAndTown);
|
|
}
|
|
|
|
lblAdresse.Text = sb.ToString();
|
|
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
pRO.InvoiceBase.DueDate = pRO.InvoiceDateTime.Value.AddDays(14);
|
|
if (start.Month == end.Month && start.Year == end.Year)
|
|
{
|
|
lblAbrechnungstext.Text = String.Format("Abrechnung Kontingent\nAbrechnung Betreutes Wohnen, " +
|
|
"Monatsrechnung gemäß beigefügter Aufstellung,\nMonat {0:MMMM yyyy}", pRO.AccountingPeriodEnd);
|
|
}
|
|
else
|
|
{
|
|
lblAbrechnungstext.Text = String.Format("Abrechnung Kontingent\nAbrechnung Betreutes Wohnen, " +
|
|
"Monatsrechnung gemäß beigefügter Aufstellung,\nZeitraum {0:MMMM yyyy} - {1:MMMM yyyy}", start, end);
|
|
}
|
|
|
|
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |