Files
BeWoPlaner/ReportImp/skmRheydt/ServiceInvoiceReport.cs

87 lines
3.0 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using DevExpress.XtraReports.UI;
namespace SkmRheydt
{
public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
{
public ServiceInvoiceReport()
{
this.InitializeComponent();
}
public void SetReportDataSource(ServiceInvoiceRO pRO)
{
// ab Februar 2026 skm moenchengladbach, vorher skm rheydt
if (pRO.InvoiceBase != null && pRO.InvoiceBase.InvoiceDate < new DateTime(2026, 02, 01))
{
richTextHeaderMg.Visible = false;
richTextFooterMg.Visible = false;
richTextHeaderRy.Visible = true;
richTextFooterRy.Visible = true;
}
if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail))
{
pRO.SenderContactPersonMail = pRO.SenderContactPersonMail.Replace("E-Mail:", "").Trim();
}
if (!String.IsNullOrEmpty(pRO.SenderContactPersonPhone))
{
pRO.SenderContactPersonPhone = pRO.SenderContactPersonPhone.Replace("Tel.:", "").Trim();
}
bool is67 = false;
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
if (pRO.RecipientOrganisation.Contains("(BeWo §67)"))
{
is67 = true;
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("(BeWo §67)", "");
}
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
{
sb.AppendLine(pRO.RecipientContactPerson);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.AppendLine(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
DateTime start = pRO.AccountingPeriodStart;
DateTime end = pRO.AccountingPeriodEnd;
if (start.Month == end.Month && start.Year == end.Year)
{
pRO.AccountingPeriod = String.Format("{0:MMMM yyyy}", start);
}
else
{
pRO.AccountingPeriod = String.Format("{0:MMMM yyyy} - {1:MMMM yyyy}", start, end);
}
cellBetreff.Text = String.Format("Abrechnung Betreuungsleistungen für {0}", pRO.CustomerName);
if (is67)
{
cellBetreff.Text = String.Format("Abrechnung Betreuungsleistungen BeWo §67 für {0}", pRO.CustomerName);
}
this.bindingSource1.DataSource = pRO;
}
}
}