Files
BeWoPlaner/ReportImp/AutismusLeben/InvoiceCustomerReport.cs
2022-10-14 14:43:25 +02:00

65 lines
2.3 KiB
C#

using System;
using System.Text;
using BeWo.Report;
using BeWo.Report.ReportObjects;
namespace AutismusLeben
{
public partial class InvoiceCustomerReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<InvoiceCustomerRO>
{
public InvoiceCustomerReport()
{
InitializeComponent();
}
public void SetReportDataSource(InvoiceCustomerRO pRO)
{
if (pRO.CustomerFirstName == null && pRO.CustomerLastName == null)
{
lblCustomerInformation.Visible = false;
lblAktenzeichen.Visible = false;
}
//StringBuilder sb = new StringBuilder();
//if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && !String.IsNullOrEmpty(pRO.RecipientOrganisation.Trim()))
//{
// sb.AppendLine(pRO.RecipientOrganisation);
//}
//if (!String.IsNullOrEmpty(pRO.RecipientDivision) && !String.IsNullOrEmpty(pRO.RecipientDivision.Trim()))
//{
// sb.AppendLine(pRO.RecipientDivision);
//}
//if ((!String.IsNullOrEmpty(pRO.RecipientFirstName) && !String.IsNullOrEmpty(pRO.RecipientFirstName.Trim()))
// || (!String.IsNullOrEmpty(pRO.RecipientLastName) && !String.IsNullOrEmpty(pRO.RecipientLastName.Trim())))
//{
// sb.AppendLine(String.Format("{0} {1}", pRO.RecipientFirstName, pRO.RecipientLastName).Trim());
//}
//if (!String.IsNullOrEmpty(pRO.RecipientStreet) && !String.IsNullOrEmpty(pRO.RecipientStreet.Trim()))
//{
// sb.AppendLine(pRO.RecipientStreet);
//}
//if (!String.IsNullOrEmpty(pRO.RecipientPostCode) && !String.IsNullOrEmpty(pRO.RecipientPostCode.Trim()))
//{
// sb.Append(pRO.RecipientPostCode);
// sb.Append(" ");
//}
//if (!String.IsNullOrEmpty(pRO.RecipientTown) && !String.IsNullOrEmpty(pRO.RecipientTown.Trim()))
//{
// sb.Append(pRO.RecipientTown);
//}
//lblAddress.Text = sb.ToString();
if (pRO.InvoiceNumber.Length > 2)
pRO.InvoiceNumber = String.Format("3{0:MM}{0:yy}0{1}", pRO.AccountingPeriodEnd , pRO.InvoiceNumber);
else
pRO.InvoiceNumber = String.Format("3{0:MM}{0:yy}00{1}", pRO.AccountingPeriodEnd, pRO.InvoiceNumber);
lblSchlusssatz.Text = string.Format("Zahlbar bis {0:dd.MM.yyyy} ohne Abzug.\nUmsatzsteuerfrei gemäß §4 Nr. 18 UStG.", pRO.InvoiceDateTime.AddDays(14));
this.bindingSource1.DataSource = pRO;
}
}
}