60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
|
|
using System;
|
||
|
|
using DevExpress.XtraReports.UI;
|
||
|
|
using BeWo.Report.ReportObjects;
|
||
|
|
using BeWo.Report;
|
||
|
|
using BS.Shared.Extensions;
|
||
|
|
|
||
|
|
namespace VisionReports
|
||
|
|
{
|
||
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
||
|
|
{
|
||
|
|
public Spitzabrechnung()
|
||
|
|
{
|
||
|
|
InitializeComponent();
|
||
|
|
}
|
||
|
|
|
||
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
||
|
|
{
|
||
|
|
if (String.IsNullOrEmpty(pRO.Notice))
|
||
|
|
{
|
||
|
|
lblNotice.Visible = false;
|
||
|
|
}
|
||
|
|
|
||
|
|
decimal rateFactor = 1;
|
||
|
|
|
||
|
|
foreach (var ii in pRO.InvoiceItems)
|
||
|
|
{
|
||
|
|
if (ii.RateFactor.HasValue)
|
||
|
|
{
|
||
|
|
rateFactor = (100 + ii.RateFactor.Value) / 100;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
||
|
|
{
|
||
|
|
Zwischensumme.Visible = true;
|
||
|
|
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
|
||
|
|
ii.ItemDescription = "Fehlkontakte";
|
||
|
|
}
|
||
|
|
else if (ii.ItemDescription.IsNullOrEmpty())
|
||
|
|
{
|
||
|
|
ii.ItemDescription = "Fachleistungsstunden";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
pRO.RateFactor = (double)rateFactor;
|
||
|
|
|
||
|
|
if (pRO.Salutation1.IsNullOrEmpty() && pRO.Salutation2.IsNullOrEmpty())
|
||
|
|
{
|
||
|
|
lblAnrede.Text = "Guten Tag,";
|
||
|
|
}
|
||
|
|
|
||
|
|
// IBAN ist rechts im Wasserzeichen
|
||
|
|
if (!String.IsNullOrEmpty(pRO.FinalSentence))
|
||
|
|
{
|
||
|
|
pRO.FinalSentence = pRO.FinalSentence.Replace("unten", "rechts");
|
||
|
|
}
|
||
|
|
|
||
|
|
this.bindingSource1.DataSource = pRO;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|