Files
BeWoPlaner/ReportImp/PerspektivenEV/CollectiveBillingReport.cs

79 lines
2.5 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 PerspektivenEV
{
[IDSpecificClass(Identifier = "Sammelrechnung")]
public partial class Sammelrechnung : XtraReport, IBeWoReport<ServiceInvoiceRO>
{
public Sammelrechnung()
{
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();
lblHourlyRate.Text = pRO.ServiceInvoicePeriods[0].ServiceInvoiceItems[0].HourlyRate.ToString();
foreach (var sip in pRO.ServiceInvoicePeriods)
{
sip.ApprovedBE = sip.ApprovedBE.Replace("(", "");
sip.ApprovedBE = sip.ApprovedBE.Replace(" FLS)", "");
}
//Sonderlösung um im Notice-Feld bei Bedarf Teilzahlungen anzeigen zu können
if (!String.IsNullOrEmpty(pRO.Notice))
{
int index = 0;
index = pRO.Notice.IndexOf("\r\n");
if (index == 0)
index = pRO.Notice.IndexOf("BEZAHLT");
if (index > 0)
pRO.Notice = pRO.Notice.Remove(index);
}
this.bindingSource1.DataSource = pRO;
}
}
}