Files
BeWoPlaner/ReportImp/Kette2/InvoiceCustomerReport.cs
2021-05-24 21:40:02 +02:00

84 lines
3.1 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Text;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace BeWo.KetteReports
{
public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public InvoiceCustomerReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
if (!String.IsNullOrEmpty(pRO.SenderPhone))
{
pRO.SenderPhone = pRO.SenderPhone.Replace("Tel.:", "").Trim();
}
if (!String.IsNullOrEmpty(pRO.SenderFax))
{
pRO.SenderFax = pRO.SenderFax.Replace("Fax:", "").Trim();
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
sb.AppendLine(pRO.RecipientOrganisation);
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientSalutationAddressField))
{
sb.AppendLine(pRO.RecipientSalutationAddressField);
}
if (!String.IsNullOrEmpty(pRO.RecipientFirstName) || !String.IsNullOrEmpty(pRO.RecipientLastName))
{
sb.AppendLine(String.Format("{0} {1}", pRO.RecipientFirstName, pRO.RecipientLastName).Trim());
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCode) || !String.IsNullOrEmpty(pRO.RecipientTown))
{
sb.AppendLine(String.Format("{0} {1}", pRO.RecipientPostCode, pRO.RecipientTown).Trim());
}
lblAdresse.Text = sb.ToString();
lblNotice.Text = String.Format("Bitte überweisen Sie den geforderten Betrag bis zum {0:dd.MM.yyyy} auf die unten aufgeführte Bankverbindung.", pRO.InvoiceDateTime.AddDays(21));
lblNotice.Text +=
"\nSollten Sie dem Lastschriftverfahren zugestimmt haben, wird der Rechnungsbetrag in den nächsten Tagen von ihrem Konto eingezogen.\nUm Ihre Überweisung besser zuordnen zu können bitten wir sie um die Angabe des Leistungsmonats, der GP-Nr. und der Rechnungsnummer.";
lblDebitor.Text = "";
if (!String.IsNullOrEmpty(pRO.CustomerReferenceNumber) && pRO.CustomerReferenceNumber.Trim().Length > 0)
{
lblDebitor.Text = pRO.CustomerReferenceNumber;
}
if (!String.IsNullOrEmpty(pRO.RecipientDebitorNumber) && pRO.RecipientDebitorNumber.Trim().Length > 0)
{
if (lblDebitor.Text.Trim().Length > 0)
lblDebitor.Text += ", ";
lblDebitor.Text += "Debitor: " + pRO.RecipientDebitorNumber;
}
this.bindingSource1.DataSource = pRO;
}
}
}