76 lines
2.9 KiB
C#
76 lines
2.9 KiB
C#
using System;
|
|
using System.Text.RegularExpressions;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace BeWo.BeWoAuxilio
|
|
{
|
|
[IDSpecificClass(Identifier = "LVRDUE")]
|
|
public partial class SpitzabrechnungDue : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public SpitzabrechnungDue()
|
|
{
|
|
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)
|
|
{
|
|
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;
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|