58 lines
2.4 KiB
C#
58 lines
2.4 KiB
C#
using System;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using System.Collections.Generic;
|
|
|
|
namespace BeWo.ASBBergischGladbachReports
|
|
{
|
|
public partial class Stundenzettel : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
{
|
|
public Stundenzettel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
{
|
|
if (pRO.Services != null)
|
|
{
|
|
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
|
|
|
foreach (var s in pRO.Services)
|
|
{
|
|
if (s.IsBillable || s.ServiceDescription.ToLower().Contains("fehlkontakt") || s.ServiceCategory.ToLower().Contains("fehlkontakt"))
|
|
{
|
|
s.Notice = String.Format("{0:0.##}", s.Minutes);
|
|
s.Notice5 = "E";
|
|
if (s.IsGroup)
|
|
{
|
|
s.TimeRangeString += " Gruppe";
|
|
s.Notice = String.Format("{0} Teiln. = {1:0.##} Minuten", s.CustomerCount, s.Minutes);
|
|
s.Notice5 = "GR";
|
|
}
|
|
if (s.ServiceDescription.ToLower().Contains("fehlkontakt") || s.ServiceCategory.ToLower().Contains("fehlkontakt"))
|
|
{
|
|
s.Notice5 = "F";
|
|
}
|
|
servicesBillable.Add(s);
|
|
}
|
|
}
|
|
|
|
pRO.Services = servicesBillable;
|
|
|
|
lblOhneFK.Text = string.Format("{0} = {1:0.00} Stunden", pRO.TotalFLMoFehlkontakte, pRO.TotalFLSoFehlkontakte);
|
|
lblOhneFKMitFaktor.Text = string.Format("{0:0.00} h x 1,2 = {1:0.00} h", pRO.TotalFLSoFehlkontakte, pRO.TotalFLSoFehlkontakte * 1.2);
|
|
if (pRO.TotalFLMFehlkontakte != 0 && pRO.TotalFLSFehlkontakte != 0)
|
|
lblFehlkontakte.Text = string.Format("{0} = {1:0.00} Stunden", pRO.TotalFLMFehlkontakte, pRO.TotalFLSFehlkontakte);
|
|
else
|
|
{
|
|
lblFehlkontakteInfo.Visible = false;
|
|
lblFehlkontakte.Visible = false;
|
|
}
|
|
}
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|