168 lines
8.7 KiB
C#
168 lines
8.7 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using DevExpress.XtraReports.UI;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
|
|
namespace BeWo.BUGeVReports
|
|
{
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
|
{
|
|
int idx = 0;
|
|
|
|
foreach (var ii in pRO.InvoiceItems)
|
|
{
|
|
ii.DetailDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}", ii.PeriodStartDate, ii.PeriodEndDate);
|
|
ii.DetailDescription += String.Format(": {0:0.##} FLS {1}x {2:c}", ii.UnitCount, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", ii.AmountPerUnit);
|
|
|
|
decimal rf = 1;
|
|
|
|
if (ii.RateFactor.HasValue)
|
|
{
|
|
rf = (100 + ii.RateFactor.Value) / 100;
|
|
}
|
|
if (idx == 0)
|
|
{
|
|
cellStart1.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate);
|
|
cellEnd1.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate);
|
|
cellHourlyRate1.Text = String.Format("{0:0.00}", ii.AmountPerUnit);
|
|
cellFLS1.Text = String.Format("{0:0.00}", ii.UnitCount * rf);
|
|
}
|
|
else if (idx == 1)
|
|
{
|
|
cellStart2.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate);
|
|
cellEnd2.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate);
|
|
cellHourlyRate2.Text = String.Format("{0:0.00}", ii.AmountPerUnit);
|
|
cellFLS2.Text = String.Format("{0:0.00}", ii.UnitCount * rf);
|
|
}
|
|
else if (idx == 2)
|
|
{
|
|
cellStart3.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate);
|
|
cellEnd3.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate);
|
|
cellHourlyRate3.Text = String.Format("{0:0.00}", ii.AmountPerUnit);
|
|
cellFLS3.Text = String.Format("{0:0.00}", ii.UnitCount * rf);
|
|
}
|
|
else if (idx == 3)
|
|
{
|
|
cellStart4.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate);
|
|
cellEnd4.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate);
|
|
cellHourlyRate4.Text = String.Format("{0:0.00}", ii.AmountPerUnit);
|
|
cellFLS4.Text = String.Format("{0:0.00}", ii.UnitCount * rf);
|
|
}
|
|
else if (idx == 4)
|
|
{
|
|
cellStart5.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate);
|
|
cellEnd5.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate);
|
|
cellHourlyRate5.Text = String.Format("{0:0.00}", ii.AmountPerUnit);
|
|
cellFLS5.Text = String.Format("{0:0.00}", ii.UnitCount * rf);
|
|
}
|
|
idx++;
|
|
|
|
}
|
|
|
|
// if (pRO.DifferentHourlyRateCount == 3)
|
|
// {
|
|
// //Erbrachte Leistungen (FLS) - bis [HourlyRateOldEndDateString] à [HourlyRateOldString] €
|
|
|
|
// pRO.Abrechnungstext1 = String.Format("{0} bis {1}",
|
|
// pRO.AccountingStartDateString, pRO.HourlyRate3EndDateString);
|
|
|
|
// pRO.Abrechnungstext1 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatz3, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRate3);
|
|
|
|
// //[AccountingStartDateString] - [HourlyRate3EndDateString] sind [RecordedFLSWithHourlyRate3String] Std. x [HourlyRate3String] € =";
|
|
|
|
// pRO.Betrag1 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor * pRO.HourlyRate3);
|
|
|
|
|
|
// pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
|
|
// pRO.HourlyRateOldStartDateString, pRO.HourlyRateOldEndDateString);
|
|
// pRO.Abrechnungstext2 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
|
|
|
|
// pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
|
|
|
|
|
|
// pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
// pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
|
|
// pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
// pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
|
|
|
|
|
|
//cellStart1.Text = pRO.AccountingStartDateString;
|
|
//cellEnd1.Text = pRO.HourlyRate3EndDateString;
|
|
//cellHourlyRate1.Text = pRO.HourlyRate3String;
|
|
//cellFLS1.Text = pRO.RecordedFLSWithHourlyRate3String;
|
|
|
|
//cellStart2.Text = pRO.HourlyRateOldStartDateString;
|
|
//cellEnd2.Text = pRO.HourlyRateOldEndDateString;
|
|
//cellHourlyRate2.Text = pRO.HourlyRateOldString;
|
|
//cellFLS2.Text = pRO.RecordedFLSWithOldHourlyRateString;
|
|
|
|
//cellStart3.Text = pRO.HourlyRateNewStartDateString;
|
|
//cellEnd3.Text = pRO.AccountingEndDateString;
|
|
//cellHourlyRate3.Text = pRO.HourlyRateNewString;
|
|
//cellFLS3.Text = pRO.RecordedFLSWithNewHourlyRateString;
|
|
// }
|
|
// else if (pRO.DifferentHourlyRateCount == 2)
|
|
// {
|
|
|
|
// pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
|
|
// pRO.AccountingStartDateString, pRO.HourlyRateOldEndDateString);
|
|
// pRO.Abrechnungstext2 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
|
|
|
|
// pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
|
|
|
|
|
|
// pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
// pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
|
|
// pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
// pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
|
|
|
|
//cellStart1.Text = pRO.AccountingStartDateString;
|
|
//cellEnd1.Text = pRO.HourlyRateOldEndDateString;
|
|
//cellHourlyRate1.Text = pRO.HourlyRateOldString;
|
|
//cellFLS1.Text = pRO.RecordedFLSWithOldHourlyRateString;
|
|
|
|
//cellStart2.Text = pRO.HourlyRateNewStartDateString;
|
|
//cellEnd2.Text = pRO.AccountingEndDateString;
|
|
//cellHourlyRate2.Text = pRO.HourlyRateNewString;
|
|
//cellFLS2.Text = pRO.RecordedFLSWithNewHourlyRateString;
|
|
// }
|
|
// else
|
|
// {
|
|
//cellStart1.Text = pRO.AccountingStartDateString;
|
|
//cellEnd1.Text = pRO.AccountingEndDateString;
|
|
//cellHourlyRate1.Text = pRO.HourlyRateNewString;
|
|
//cellFLS1.Text = pRO.RecordedFLSWithNewHourlyRateString;
|
|
|
|
// pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
// pRO.AccountingStartDateString, pRO.AccountingEndDateString);
|
|
// pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
|
|
// pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
// pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
// }
|
|
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|