Files
BeWoPlaner/ReportImp/MuellestumpeReports/ServicesOverviewReport.cs

75 lines
2.6 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace BeWo.MuellestumpeReports
{
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Stundenzettel()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
if (String.IsNullOrEmpty(pRO.ApprovedStartDate) && String.IsNullOrEmpty(pRO.ApprovedEndDate))
{
pRO.ApprovedStartDate = pRO.RequestedStartDate;
pRO.ApprovedEndDate = pRO.RequestedEndDate;
}
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
double flMinutes = 0;
double fkMinutes = 0;
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
{
if (s.IsBillable || s.ServiceDescription.ToLower().Contains("fehlkontakt") || s.ServiceCategory.ToLower().Contains("fehlkontakt"))
{
if (s.ServiceDescription.ToLower().Contains("fehlkontakt") || s.ServiceCategory.ToLower().Contains("fehlkontakt") || (s.ProzentAbrechenbar < 100))
{
s.Notice4 = String.Format("{0}", s.Minutes);
fkMinutes += s.Minutes;
}
else
{
s.Notice3 = String.Format("{0}", s.Minutes);
flMinutes += s.Minutes;
}
servicesBillable.Add(s);
}
}
lblSumWithFactor.Text = String.Format("{0:0.##} x 1,2 = {1:0.##} Std.", flMinutes / 60, flMinutes / 60 * 1.2);
pRO.Services = servicesBillable;
}
if (String.IsNullOrEmpty(pRO.AbsenceTimes))
{
lblHatAbwesenheiten.Text = "X";
lblAbsencetimes.Visible = false;
}
else
{
pRO.AbsenceTimes = "Krankenhausaufenthalte/stat. Rehamaßnahmen:\n" + pRO.AbsenceTimes;
lblHatAbwesenheiten.Visible = false;
lblKeineAbwesenheiten.Visible = false;
}
this.bindingSource1.DataSource = pRO;
}
}
}