66 lines
2.1 KiB
C#
66 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.RegularExpressions;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWoWalzPaiva
|
|
{
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
|
{
|
|
bool hasRatefactor = false;
|
|
|
|
if (String.IsNullOrEmpty(pRO.Notice))
|
|
{
|
|
lblNotice.Visible = false;
|
|
}
|
|
|
|
if (!String.IsNullOrWhiteSpace(pRO.RateFactorText2))
|
|
{
|
|
hasRatefactor = true;
|
|
if (pRO.RateFactorText2 == "1,2")
|
|
{
|
|
pRO.RateFactorText2 = "1,20";
|
|
}
|
|
}
|
|
|
|
if (pRO.InvoiceItems != null)
|
|
{
|
|
foreach (var ii in pRO.InvoiceItems)
|
|
{
|
|
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";
|
|
}
|
|
else
|
|
{
|
|
ii.DetailDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS {3}x {4:c}",
|
|
ii.PeriodStartDate, ii.PeriodEndDate,
|
|
ii.UnitCount, !hasRatefactor ? "" : "x " + pRO.RateFactorText2 + " ",
|
|
ii.AmountPerUnit);
|
|
}
|
|
}
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
}
|
|
}
|