Files
BeWoPlaner/ReportImp/BeWoAuxilio/SettlementReport2Ne.cs

75 lines
2.8 KiB
C#
Raw Permalink Normal View History

using System;
using System.Text.RegularExpressions;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.Core;
using BS.Shared.Extensions;
namespace BeWo.BeWoAuxilio
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
public Spitzabrechnung()
{
InitializeComponent();
}
public void SetReportDataSource(Settlement2RO pRO)
{
if (!String.IsNullOrWhiteSpace(pRO.RateFactorText2))
{
if (pRO.RateFactorText2 == "1,2")
{
pRO.RateFactorText2 = "1,20";
}
//decimal rf = 0;
//if (Decimal.TryParse(pRO.RateFactorText2, out rf) && rf > 0)
//{
// lblInklPauschFaktorText.Text = "Inkl. pauschaler Faktor";
// lblInklPauschBetrag.Text =
// String.Format("{0:c}", pRO.AmountBillableTotal - (pRO.AmountBillableTotal / rf));
//}
}
if (pRO.InvoiceItems != null)
{
decimal rateFactor = 1;
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
2024-03-15 09:40:24 +01:00
if (ii.ItemDescription.IsNullOrEmpty() && !ii.UnitDescription.IsNullOrEmpty() && ii.UnitDescription.Length > 0)
{
ii.ItemDescription = "FLS";
ii.DetailDescription = ii.ItemDescription + ii.DetailDescription;
}
if (ii.RateFactor.HasValue)
{
rateFactor = (100 + ii.RateFactor.Value) / 100;
}
if (pRO.FehlkontakteString != null && ii.RateFactor == 0)
{
Zwischensumme.Visible = true;
if (ii.ItemDescription != null)
{
ii.DetailDescription = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
}
ii.ItemDescription = "Fehlkontakte";
}
}
}
pRO.RateFactor = (double)rateFactor;
2024-03-08 12:14:19 +01:00
if (pRO.AmountBillableTotal - (pRO.Claim + pRO.AmountAdvancedPayments) != 0)
{
lblDifferenzrechnungText.Text = "H<>he der bereits gestellten Rechnung vor Stundensatzanpassung:";
lblDifferenzrechnung.Text = string.Format("{0:c}", pRO.AmountBillableTotal - (pRO.AmountAdvancedPayments + pRO.Claim));
}
}
this.bindingSource1.DataSource = pRO;
}
}
}