Files
BeWoPlaner/ReportImp/IntegraHeinsbergReports/SettlementReport.cs
2016-06-27 01:45:38 +02:00

159 lines
8.2 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.IntegraHeinsbergReports.Alt
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
{
public Spitzabrechnung()
{
InitializeComponent();
}
public void SetReportDataSource(SettlementRO pRO)
{
if (String.IsNullOrEmpty(pRO.AbsenceTimes))
lblAbwesenheiten.Text = "keine";
else
{
lblAbwesenheiten.Text = String.Empty;
if (pRO.AbsenceStartDate1.HasValue)
{
if (lblAbwesenheiten.Text.Length > 0)
lblAbwesenheiten.Text += ", ";
lblAbwesenheiten.Text += String.Format("{0:dd.MM.yyyy}", pRO.AbsenceStartDate1);
}
if (pRO.AbsenceEndDate1.HasValue)
{
lblAbwesenheiten.Text += String.Format(" bis {0:dd.MM.yyyy}", pRO.AbsenceEndDate1);
}
if (pRO.AbsenceStartDate2.HasValue)
{
if (lblAbwesenheiten.Text.Length > 0)
lblAbwesenheiten.Text += ", ";
lblAbwesenheiten.Text += String.Format("{0:dd.MM.yyyy}", pRO.AbsenceStartDate2);
}
if (pRO.AbsenceEndDate2.HasValue)
{
lblAbwesenheiten.Text += String.Format(" bis {0:dd.MM.yyyy}", pRO.AbsenceEndDate2);
}
if (pRO.AbsenceStartDate3.HasValue)
{
if (lblAbwesenheiten.Text.Length > 0)
lblAbwesenheiten.Text += ", ";
lblAbwesenheiten.Text += String.Format("{0:dd.MM.yyyy}", pRO.AbsenceStartDate3);
}
if (pRO.AbsenceEndDate3.HasValue)
{
lblAbwesenheiten.Text += String.Format(" bis {0:dd.MM.yyyy}", pRO.AbsenceEndDate3);
}
if (pRO.AbsenceStartDate4.HasValue)
{
if (lblAbwesenheiten.Text.Length > 0)
lblAbwesenheiten.Text += ", ";
lblAbwesenheiten.Text += String.Format("{0:dd.MM.yyyy}", pRO.AbsenceStartDate4);
}
if (pRO.AbsenceEndDate4.HasValue)
{
lblAbwesenheiten.Text += String.Format(" bis {0:dd.MM.yyyy}", pRO.AbsenceEndDate4);
}
}
cellAbrechnung11Text.Text = null;
cellAbrechnung12Text.Text = null;
cellAbrechnung21Text.Text = null;
cellAbrechnung22Text.Text = null;
cellAbrechnung31Text.Text = null;
cellAbrechnung32Text.Text = null;
cellBetrag11.Text = null;
cellBetrag12.Text = null;
cellBetrag21.Text = null;
cellBetrag22.Text = null;
cellBetrag31.Text = null;
cellBetrag32.Text = null;
if (!String.IsNullOrEmpty(pRO.ApprovedFLS))
{
pRO.ApprovedFLS = pRO.ApprovedFLS.Replace(" FLS", "");
}
if (!String.IsNullOrEmpty(pRO.Claim))
{
pRO.Claim = pRO.Claim.Replace("€", "Euro");
}
if (!String.IsNullOrEmpty(pRO.AmountRecordedFLSString))
{
pRO.AmountRecordedFLSString = pRO.AmountRecordedFLSString.Replace("€", "Euro");
}
if (!String.IsNullOrEmpty(pRO.AmountAdvancedPayments))
{
pRO.AmountAdvancedPayments = pRO.AmountAdvancedPayments.Replace("€", "Euro");
}
if (pRO.DifferentHourlyRateCount == 3)
{
cellAbrechnung11Text.Text = String.Format("direkt geleistete Gesamtstundenzahl im Betreuungszeitraum bis {0}", pRO.HourlyRate3EndDateString);
cellAbrechnung12Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor, pRO.HourlyRate3);
cellBetrag11.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatz3);
cellBetrag12.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor * pRO.HourlyRate3);
cellAbrechnung21Text.Text = String.Format("von {0} bis {1}", pRO.HourlyRateOldStartDateString, pRO.HourlyRateOldEndDateString);
cellAbrechnung22Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor, pRO.HourlyRateOld);
cellBetrag21.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatzAlt);
cellBetrag22.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
cellAbrechnung31Text.Text = String.Format("von {0} bis {1}", pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
cellAbrechnung32Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor, pRO.HourlyRateNew);
cellBetrag31.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatzAktuell);
cellBetrag32.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
else if (pRO.DifferentHourlyRateCount == 2)
{
cellAbrechnung11Text.Text = String.Format("direkt geleistete Gesamtstundenzahl im Betreuungszeitraum bis {0}", pRO.HourlyRateOldEndDateString);
cellAbrechnung12Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor, pRO.HourlyRateOld);
cellBetrag11.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatzAlt);
cellBetrag12.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
cellAbrechnung21Text.Text = String.Format("von {0} bis {1}", pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
cellAbrechnung22Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor, pRO.HourlyRateNew);
cellBetrag21.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatzAktuell);
cellBetrag22.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
else
{
cellAbrechnung11Text.Text = String.Format("direkt geleistete Gesamtstundenzahl im Betreuungszeitraum bis {0}", pRO.AccountingEndDateString);
cellAbrechnung12Text.Text = String.Format("x Faktor {0} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c}):",
pRO.RateFactorText2, pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor, pRO.HourlyRateNew);
cellBetrag11.Text = String.Format("{0:0.##} Stunden", pRO.GeleisteteFLSMitStundensatzAktuell);
cellBetrag12.Text = String.Format("{0:#,##0.00} Euro", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
this.bindingSource1.DataSource = pRO;
}
}
}