Files
BeWoPlaner/ReportImp/BeWoTrio/SettlementReport2.cs
2023-03-24 13:07:59 +01:00

70 lines
1.9 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Text;
namespace BeWo.Report.DefaultReports
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
public Spitzabrechnung()
{
InitializeComponent();
}
public void SetReportDataSource(Settlement2RO pRO)
{
if (pRO.Claim < 0)
{
pRO.FinalSentence = "Wir bitten Sie den Betrag mit den nächsten Abschlagszahlungen zu verrechnen.";
}
if (String.IsNullOrEmpty(pRO.Notice))
{
lblNotice.Visible = false;
}
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
{
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();
decimal rateFactor = 1;
foreach (var ii in pRO.InvoiceItems)
{
if (ii.RateFactor.HasValue)
{
rateFactor = (100 + ii.RateFactor.Value) / 100;
}
}
pRO.RateFactor = (double)rateFactor;
this.bindingSource1.DataSource = pRO;
}
}
}