91 lines
3.6 KiB
C#
91 lines
3.6 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
|
|
{
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO 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);
|
|
}
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.ApprovedFLS))
|
|
{
|
|
pRO.ApprovedFLS = pRO.ApprovedFLS.Replace(" FLS", "");
|
|
}
|
|
|
|
for (var i = 0; i < pRO.InvoiceItems.Count; i++)
|
|
{
|
|
var item = pRO.InvoiceItems[i];
|
|
|
|
item.DetailDescription = string.Format("{0} bis {1:dd.MM.yyyy}", i == 0 ? "direkt geleistete Gesamtstundenzahl im Betreuungszeitraum" : string.Format("von {0:dd.MM.yyyy}", item.PeriodStartDate), item.PeriodEndDate);
|
|
decimal rf = 1;
|
|
if (item.RateFactor.HasValue)
|
|
{
|
|
rf = (100 + item.RateFactor.Value)/100;
|
|
}
|
|
|
|
item.ItemDescription = string.Format("x Faktor {0:0.00} = {1:0.##} FLS mal Preis der Fachleistungsstunde ({2:c})", rf, item.UnitCount * rf, item.AmountPerUnit);
|
|
}
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|