2016-06-27 01:45:38 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using BeWo.Data.Access;
|
|
|
|
|
|
using BeWo.Data.Entities;
|
|
|
|
|
|
using BeWo.Report;
|
|
|
|
|
|
using BeWo.Report.ReportObjects;
|
2017-06-11 15:50:31 +02:00
|
|
|
|
using DevExpress.XtraReports.Design;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace VSDHammReports
|
|
|
|
|
|
{
|
|
|
|
|
|
public class VsdHammReportCreator : DefaultReportCreator
|
|
|
|
|
|
{
|
|
|
|
|
|
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay);
|
|
|
|
|
|
|
|
|
|
|
|
if (lROs.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
var rootReport = CreateServicesOverviewReportForRo(lROs[0], serviceCategoryOid);
|
|
|
|
|
|
rootReport.CreateDocument();
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i < lROs.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var lNext = CreateServicesOverviewReportForRo(lROs[i], serviceCategoryOid);
|
|
|
|
|
|
lNext.CreateDocument();
|
|
|
|
|
|
rootReport.Pages.AddRange(lNext.Pages);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rootReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
|
|
|
|
|
|
|
|
|
|
|
return CreateServicesOverviewReportForRo(ro, serviceCategoryOid);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-11 14:43:49 +02:00
|
|
|
|
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, long? serviceCategoryOid)
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<ServicesOverviewRO> report = null;
|
|
|
|
|
|
|
2017-06-11 15:50:31 +02:00
|
|
|
|
String kt = "";
|
|
|
|
|
|
if (!String.IsNullOrWhiteSpace(ro.Costbearer))
|
|
|
|
|
|
{
|
|
|
|
|
|
kt = ro.Costbearer.Trim();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (kt == "Jugendamt Dortmund" || kt == "Jugendamt Kreis Soest")
|
|
|
|
|
|
{
|
|
|
|
|
|
report = new VSDHammReports.QuittierungsbelegJA();
|
|
|
|
|
|
}
|
2017-10-11 14:43:49 +02:00
|
|
|
|
else if (kt.Contains("Jugendamt") || kt.Contains("jugendamt") || kt == "Jugendamt der Stadt Hamm" || kt == "Jugendamt der Stadt Aachen"
|
2017-06-11 15:50:31 +02:00
|
|
|
|
|| kt == "Stadt Hamm Jugendamt Clearing" || kt == "Stadt Hamm Jugendamt Wohnprojekt" || kt == "Jugendamt Ahlen Wohnprojekt")
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2017-10-11 14:43:49 +02:00
|
|
|
|
if (ro.StartDate < new DateTime(2016, 7, 1))
|
2017-06-11 15:50:31 +02:00
|
|
|
|
{
|
|
|
|
|
|
report = new VSDHammReports.QuittierungsbelegJA();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
report = new VSDHammReports.LeistungsnachweisJA();
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (report == null)
|
|
|
|
|
|
report = new VSDHammReports.Stundenzettel();
|
|
|
|
|
|
report.SetReportDataSource(ro);
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|