61 lines
1.9 KiB
C#
61 lines
1.9 KiB
C#
using System;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using BS.Shared.Extensions;
|
|
using System.Text.RegularExpressions;
|
|
|
|
namespace BeWo.BeWoNeuss
|
|
{
|
|
public partial class Spitzabrechnung : XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
|
{
|
|
|
|
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;
|
|
if (!ii.ItemDescription.IsNullOrEmpty())
|
|
{
|
|
ii.DetailDescription = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
|
|
}
|
|
ii.ItemDescription = "Fehlkontakte";
|
|
}
|
|
}
|
|
pRO.RateFactor = (double)rateFactor;
|
|
|
|
pRO.FinalSentence = pRO.FinalSentence.IndexOf("Bitte überweisen Sie") == 0
|
|
? "Bitte überweisen Sie unsere Restforderung nach Prüfung der Schlussabrechnung auf das oben angegebene Konto."
|
|
: null;
|
|
|
|
foreach (var item in pRO.InvoiceItems)
|
|
{
|
|
item.AbrechnungsText = item.AbrechnungsText.Insert(26, "\t");
|
|
item.AbrechnungsText += ":";
|
|
}
|
|
|
|
if (String.IsNullOrEmpty(pRO.AbsenceTimes))
|
|
{
|
|
pRO.AbsenceTimes = "Es liegen keine Abwesenheitszeiten vor";
|
|
}
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|