85 lines
2.5 KiB
C#
85 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Service.ServiceImplementations;
|
|
using BS.Shared.DataContracts;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace ABWElsebrock
|
|
{
|
|
public partial class Stundenzettel : 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 sd in pRO.Services)
|
|
{
|
|
if (sd.IsBillable || sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt"))
|
|
{
|
|
ServicesOverviewRO.CreateSignatureString(sd);
|
|
sd.Notice5 = "E";
|
|
if (sd.IsGroup)
|
|
{
|
|
sd.Notice5 = "G";
|
|
}
|
|
if (sd.ServiceDescription.ToLower().Contains("fehlkontakt") || sd.ServiceCategory.ToLower().Contains("fehlkontakt") || (sd.ProzentAbrechenbar < 100))
|
|
{
|
|
sd.Notice5 = "F";
|
|
}
|
|
servicesBillable.Add(sd);
|
|
}
|
|
}
|
|
}
|
|
|
|
int flStunden = (int)(pRO.TotalFLMoFehlkontakte / 60);
|
|
int flMinuten = (int)(pRO.TotalFLMoFehlkontakte % 60);
|
|
cellSummeFachleistungen.Text = String.Format("{0:00}:{1:00}", flStunden, flMinuten);
|
|
|
|
int fkStunden = (int)(pRO.TotalFLMFehlkontakte / 60);
|
|
int fkMinuten = (int)(pRO.TotalFLMFehlkontakte % 60);
|
|
cellSummeFehlkontakte.Text = String.Format("{0:00}:{1:00}", fkStunden, fkMinuten);
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private SupportConceptPeriodStatisticsDC GetStatistics(ServicesOverviewRO ro)
|
|
{
|
|
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)
|
|
{
|
|
var service = new OperationsServiceImp();
|
|
|
|
foreach (var cb2sc in ro.CostBearer2SupportConceptList)
|
|
{
|
|
long cb2scOid = cb2sc.Oid.Value;
|
|
|
|
|
|
var stats = service.CreateSupportConceptStatistics(cb2scOid, ro.EndDate);
|
|
|
|
if (stats.PeriodStatistics != null && stats.PeriodStatistics.Count > 0)
|
|
{
|
|
foreach (var ps in stats.PeriodStatistics)
|
|
{
|
|
if (ps.SupportConceptApprovalPeriod != null && ps.SupportConceptApprovalPeriod.ServiceCategory != null &&
|
|
ps.SupportConceptApprovalPeriod.ServiceCategory.Name.StartsWith("FLS"))
|
|
{
|
|
return ps;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|