2019-08-09 16:40:41 +02:00
|
|
|
|
|
2019-08-15 11:06:50 +02:00
|
|
|
|
|
2020-10-01 13:58:10 +02:00
|
|
|
|
|
2019-08-09 16:40:41 +02:00
|
|
|
|
using System;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
using System.Security;
|
2019-08-29 15:43:23 +02:00
|
|
|
|
using System.Threading;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
using System.Web;
|
|
|
|
|
|
using BeWo.Report.DefaultReports;
|
|
|
|
|
|
using BS.Shared;
|
|
|
|
|
|
using BeWo.Data;
|
|
|
|
|
|
using BeWo.Data.Access;
|
|
|
|
|
|
using BeWo.Data.Entities;
|
|
|
|
|
|
using BeWo.Report;
|
|
|
|
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
|
|
using BeWo.Service.DCEntityMapper;
|
2017-05-18 21:47:09 +02:00
|
|
|
|
using BeWo.Service.ServiceImplementations;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
using BS.Shared.Core;
|
|
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BeWo.Report
|
|
|
|
|
|
{
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public class DefaultReportCreator : AbstractReportCreator
|
|
|
|
|
|
{
|
|
|
|
|
|
public IBeWoReport<T> FindReportImp<T>()
|
|
|
|
|
|
{
|
|
|
|
|
|
return FindReportImp<T>(null, null);
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public IBeWoReport<T> FindReportImp<T>(string specificReportId)
|
|
|
|
|
|
{
|
|
|
|
|
|
return this.FindReportImp<T>(specificReportId, null);
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public IBeWoReport<T> FindReportImp<T>(string specificReportId, string typename)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<T> result = null;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
Type[] lAllReportTypes = null;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (Tenant != null && File.Exists(ReportPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
lAllReportTypes = Assembly.LoadFrom(ReportPath).GetTypes();
|
|
|
|
|
|
result = FindReportImp<T>(lAllReportTypes, specificReportId, typename, true);
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (result == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
lAllReportTypes = typeof(IBeWoReport<T>).Assembly.GetTypes();
|
|
|
|
|
|
result = FindReportImp<T>(lAllReportTypes, specificReportId, typename, false);
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public IBeWoReport<T> FindReportImp<T>(Type[] lAllReportTypes, string specificReportId, string typename, bool doNotUseReportsWithIdentifier)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<T> result = null;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (!string.IsNullOrEmpty(specificReportId) && !string.IsNullOrEmpty(typename))
|
|
|
|
|
|
{
|
|
|
|
|
|
var cbSpecific = lAllReportTypes
|
|
|
|
|
|
.Where(i => typeof(IBeWoReport<T>).IsAssignableFrom(i))
|
|
|
|
|
|
.FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
|
|
|
|
|
|
.ToList()
|
|
|
|
|
|
.Exists(i =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var attr = (IDSpecificClassAttribute)i;
|
|
|
|
|
|
if (attr.Identifiers != null)
|
|
|
|
|
|
return attr.Identifiers.Contains(specificReportId);
|
|
|
|
|
|
if (!String.IsNullOrEmpty(attr.Identifier))
|
|
|
|
|
|
return attr.Identifier.Equals(specificReportId);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
) && t.FullName == typename);
|
|
|
|
|
|
if (cbSpecific != null)
|
|
|
|
|
|
result = Activator.CreateInstance(cbSpecific) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (!string.IsNullOrEmpty(typename))
|
|
|
|
|
|
{
|
|
|
|
|
|
var cbSpecific = lAllReportTypes.FirstOrDefault(t => t.FullName == typename);
|
|
|
|
|
|
if (cbSpecific != null)
|
|
|
|
|
|
result = Activator.CreateInstance(cbSpecific) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (!string.IsNullOrEmpty(specificReportId))
|
|
|
|
|
|
{
|
|
|
|
|
|
var cbSpecific = lAllReportTypes
|
|
|
|
|
|
.Where(i => typeof(IBeWoReport<T>).IsAssignableFrom(i))
|
|
|
|
|
|
.FirstOrDefault(t => t.GetCustomAttributes(typeof(IDSpecificClassAttribute), true)
|
|
|
|
|
|
.ToList()
|
|
|
|
|
|
.Exists(i =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var attr = (IDSpecificClassAttribute)i;
|
|
|
|
|
|
if (attr.Identifiers != null)
|
|
|
|
|
|
return attr.Identifiers.Contains(specificReportId);
|
|
|
|
|
|
if (!String.IsNullOrEmpty(attr.Identifier))
|
|
|
|
|
|
return attr.Identifier.Equals(specificReportId);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
));
|
|
|
|
|
|
if (cbSpecific != null)
|
|
|
|
|
|
result = Activator.CreateInstance(cbSpecific) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (result == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var iType in lAllReportTypes)
|
|
|
|
|
|
if (typeof(IBeWoReport<T>).IsAssignableFrom(iType))
|
|
|
|
|
|
if (iType.Name == specificReportId)
|
|
|
|
|
|
result = Activator.CreateInstance(iType) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (result == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var list = lAllReportTypes.Where(t => typeof(IBeWoReport<T>).IsAssignableFrom(t)).ToList();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (list.Count == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
var type = list[0];
|
|
|
|
|
|
if (doNotUseReportsWithIdentifier)
|
|
|
|
|
|
{
|
|
|
|
|
|
var attrs = type.GetCustomAttributes(typeof(IDSpecificClassAttribute), true);
|
|
|
|
|
|
if (attrs.Length == 0)
|
|
|
|
|
|
return Activator.CreateInstance(type) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
result = Activator.CreateInstance(type) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
}
|
|
|
|
|
|
else if (list.Count > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var type in list)
|
|
|
|
|
|
{
|
|
|
|
|
|
var attrs = type.GetCustomAttributes(typeof(IDSpecificClassAttribute), true);
|
|
|
|
|
|
if (attrs.Length == 0)
|
|
|
|
|
|
return Activator.CreateInstance(type) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!doNotUseReportsWithIdentifier)
|
|
|
|
|
|
{
|
|
|
|
|
|
result = Activator.CreateInstance(list[0]) as IBeWoReport<T>;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return result;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateCustomerDataReport(long customerOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
var lCustomerDataReport = FindReportImp<CustomerDataRO>();
|
|
|
|
|
|
lCustomerDataReport.SetReportDataSource(CustomerDataRO.Create(MapperFactory.CustomerDC_Customer.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid))));
|
|
|
|
|
|
return lCustomerDataReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateCustomerInvoiceReport(long invoiceOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
IBeWoReport<InvoiceCustomerRO> lInvoiceCustomerReport = FindReportImp<InvoiceCustomerRO>();
|
|
|
|
|
|
lInvoiceCustomerReport.SetReportDataSource(InvoiceCustomerRO.Create(MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(DAOFactory.GenericDAO.LoadByID<InvoiceBase>(invoiceOid))));
|
|
|
|
|
|
return lInvoiceCustomerReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateAssessmentSheetReport(long customerOid, int month, int year)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<AssessmentSheetRO> report = FindReportImp<AssessmentSheetRO>();
|
|
|
|
|
|
report.SetReportDataSource(AssessmentSheetRO.Create(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid), new DateTime(year, month, 1)));
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
public override XtraReport CreateFlsReport(String flsReportId, String subType)
|
|
|
|
|
|
{
|
|
|
|
|
|
string flsReportPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, flsReportId + ".xml");
|
|
|
|
|
|
var lFLSAnalysisDataReportDC = Utils.XMLDeserialize<FLSAnalysisDataReportDC>(flsReportPath);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
IBeWoReport<FLSReportRO> lFLSReportObject = null;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (!String.IsNullOrEmpty(subType))
|
|
|
|
|
|
lFLSReportObject = this.FindReportImp<FLSReportRO>(subType);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (lFLSReportObject == null)
|
|
|
|
|
|
lFLSReportObject = this.FindReportImp<FLSReportRO>(lFLSAnalysisDataReportDC.ShowGroups
|
|
|
|
|
|
? "FLSAuswertung"
|
|
|
|
|
|
: "Leistungsdokumentation");
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
lFLSReportObject.SetReportDataSource(FLSReportRO.Create(lFLSAnalysisDataReportDC));
|
|
|
|
|
|
return lFLSReportObject as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
public override XtraReport CreateQueryReport(long queryOid, String queryReportId)
|
|
|
|
|
|
{
|
|
|
|
|
|
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
|
|
|
|
|
|
|
|
|
|
|
if (query == null)
|
|
|
|
|
|
return new XtraReport();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
var path = BS.Shared.Core.Utils.CreateSavePath(TempPath, queryReportId + ".xml");
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
var table = Utils.XMLDeserialize<DataTable>(path);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
var queryReport = FindReportImp<QueryRO>(null, query.ReportTypeName);
|
|
|
|
|
|
queryReport.SetReportDataSource(QueryRO.Create(query, table));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return queryReport as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateServiceInvoiceReport(String dcIds, long? invoiceBaseOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (String.IsNullOrEmpty(dcIds) && invoiceBaseOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid.Value);
|
|
|
|
|
|
dcIds = String.Format("{0}", serviceInvoice.Oid);
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (!string.IsNullOrEmpty(dcIds))
|
|
|
|
|
|
{
|
|
|
|
|
|
var serviceInvoiceOid2CostbearerId = new Dictionary<long, string>();
|
|
|
|
|
|
var dcList = new List<ServiceInvoiceDC>();
|
|
|
|
|
|
|
|
|
|
|
|
var dcidStrs = dcIds.Split(';');
|
|
|
|
|
|
foreach (var oidStr in dcidStrs)
|
|
|
|
|
|
{
|
|
|
|
|
|
var oid = long.Parse(oidStr);
|
|
|
|
|
|
var invoice = DAOFactory.GenericDAO.LoadByID<ServiceInvoice>(oid);
|
|
|
|
|
|
var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice);
|
|
|
|
|
|
dcList.Add(dc);
|
|
|
|
|
|
|
|
|
|
|
|
if (serviceInvoiceOid2CostbearerId.ContainsKey(oid))
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (!String.IsNullOrEmpty(invoice.InvoiceBase.InvoiceId))
|
|
|
|
|
|
serviceInvoiceOid2CostbearerId.Add(oid, invoice.InvoiceBase.InvoiceId);
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var period in invoice.ServiceInvoicePeriodList)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (period.SupportConceptApprovalPeriod != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId,
|
|
|
|
|
|
period.SupportConceptApprovalPeriod.CostBearer2SupportConcept);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (var item in period.InvoiceItemList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (item.SupportConceptApprovalPeriodOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
var approvalPeriod =
|
|
|
|
|
|
DAOFactory.GenericDAO.LoadByID<SupportConceptApprovalPeriod>(item.SupportConceptApprovalPeriodOid.Value);
|
|
|
|
|
|
if (approvalPeriod.CostBearer2SupportConcept != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
AddCostBearerIdToDict(oid, serviceInvoiceOid2CostbearerId, approvalPeriod.CostBearer2SupportConcept);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
//ignore
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IBeWoReport<ServiceInvoiceRO> allReports = null;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var iDC in dcList)
|
|
|
|
|
|
{
|
|
|
|
|
|
String reportId = null;
|
|
|
|
|
|
if (serviceInvoiceOid2CostbearerId.ContainsKey(iDC.ServiceInvoiceOid.Value))
|
|
|
|
|
|
reportId = serviceInvoiceOid2CostbearerId[iDC.ServiceInvoiceOid.Value];
|
|
|
|
|
|
|
|
|
|
|
|
IBeWoReport<ServiceInvoiceRO> singleReport = FindReportImp<ServiceInvoiceRO>(reportId);
|
|
|
|
|
|
|
|
|
|
|
|
singleReport.SetReportDataSource(ServiceInvoiceRO.Create(iDC));
|
|
|
|
|
|
((XtraReport)singleReport).CreateDocument();
|
|
|
|
|
|
if (allReports == null)
|
|
|
|
|
|
allReports = singleReport;
|
|
|
|
|
|
else
|
|
|
|
|
|
((XtraReport)allReports).Pages.AddRange(((XtraReport)singleReport).Pages);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return allReports as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2017-02-01 13:53:59 +01:00
|
|
|
|
public virtual void AddCostBearerIdToDict(long serviceInvoiceOid, Dictionary<long, string> serviceInvoiceOid2CostbearerId, CostBearer2SupportConcept c2s)
|
2020-09-30 10:00:31 +02:00
|
|
|
|
{
|
|
|
|
|
|
if (c2s != null && c2s.CostBearer != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var id = c2s.CostBearer.ID;
|
|
|
|
|
|
if (String.IsNullOrEmpty(id) && c2s.CostBearer.IsSingleInvoicePerCustomer)
|
|
|
|
|
|
id = "Sammelrechnung";
|
|
|
|
|
|
if (!serviceInvoiceOid2CostbearerId.ContainsKey(serviceInvoiceOid))
|
|
|
|
|
|
serviceInvoiceOid2CostbearerId.Add(serviceInvoiceOid, id);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
var os = new OperationsServiceImp();
|
|
|
|
|
|
var m = os.GetMandator2(false);
|
|
|
|
|
|
if (m.AllowSbd)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CreateSbdLeistungsnachweisForAllCustomers(month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (lROs.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
String reportId = null;
|
|
|
|
|
|
if (orgaOid > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
|
|
|
|
|
if (organisation != null)
|
|
|
|
|
|
reportId = organisation.Name;
|
|
|
|
|
|
}
|
2017-05-18 21:47:09 +02:00
|
|
|
|
|
|
|
|
|
|
var lServiceOverviewAllCustomersReport = this.FindReportImp<ServicesOverviewRO>(reportId);
|
2020-09-30 10:00:31 +02:00
|
|
|
|
lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
|
|
|
|
|
|
(lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
|
|
|
|
|
|
var Report = lServiceOverviewAllCustomersReport as XtraReport;
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
for (int i = 1; i < lROs.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var lNext = FindReportImp<ServicesOverviewRO>(reportId);
|
|
|
|
|
|
lNext.SetReportDataSource(lROs[i]);
|
|
|
|
|
|
(lNext as XtraReport).CreateDocument();
|
|
|
|
|
|
Report.Pages.AddRange((lNext as XtraReport).Pages);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return lServiceOverviewAllCustomersReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
var os = new OperationsServiceImp();
|
|
|
|
|
|
var m = os.GetMandator2(false);
|
|
|
|
|
|
if (m.AllowSbd)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CreateSbdLeistungsnachweisForSingleCustomerReport(customerOid, month, year, orgaOid, empOid, serviceCategoryOid ?? 0, startDay, endDay);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
|
|
|
|
|
String reportId = null;
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (orgaOid > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
|
|
|
|
|
if (organisation != null)
|
|
|
|
|
|
reportId = organisation.Name;
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2017-05-18 21:47:09 +02:00
|
|
|
|
var lServiceOverviewSingleCustomerReport = this.FindReportImp<ServicesOverviewRO>(reportId);
|
2020-09-30 10:00:31 +02:00
|
|
|
|
lServiceOverviewSingleCustomerReport.SetReportDataSource(ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lServiceOverviewSingleCustomerReport as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
public override XtraReport CreateServiceOverviewReportNew(int month, int year, QBFilterEnum filterType, long? customerOid, long? teamOid, long? empOid, long? orgaOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch (filterType)
|
|
|
|
|
|
{
|
|
|
|
|
|
case QBFilterEnum.AlleKlienten:
|
|
|
|
|
|
return CreateServiceOverviewAllCustomersReport(month, year, orgaOid ?? 0, empOid ?? 0, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QBFilterEnum.NurKlientenMeinesTeams:
|
|
|
|
|
|
var list1 = GetKlientenOidsMeinesTeams(null);
|
|
|
|
|
|
return CreateServiceOverviewReportForCustomers(list1, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QBFilterEnum.MeineKlienten:
|
|
|
|
|
|
var list2 = GetMeineKlientenOids();
|
|
|
|
|
|
return CreateServiceOverviewReportForCustomers(list2, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QBFilterEnum.KlientenAuswahl:
|
|
|
|
|
|
return CreateServiceOverviewSingleCustomerReport(customerOid ?? 0, month, year, orgaOid ?? 0, empOid ?? 0, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QBFilterEnum.TeamAuswahl:
|
|
|
|
|
|
var list3 = GetKlientenOidsMeinesTeams(teamOid);
|
|
|
|
|
|
return CreateServiceOverviewReportForCustomers(list3, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
private IList<long> GetMeineKlientenOids()
|
|
|
|
|
|
{
|
|
|
|
|
|
IList<long> customerOids = new List<long>();
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
ApplicationUser loggedInUser = null;
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
loggedInUser = SessionFacade.LoggedInUser;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (loggedInUser != null && loggedInUser.Employee != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var v2o in e2c.ValueList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
2020-09-15 13:14:43 +02:00
|
|
|
|
{
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
|
|
|
|
|
{
|
|
|
|
|
|
customerOids.Add(e2c.Customer.Oid.Value);
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
return customerOids;
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
public virtual IList<long> GetKlientenOidsMeinesTeams(long? teamOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
IList<long> customerOids = new List<long>();
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
ApplicationUser loggedInUser = null;
|
|
|
|
|
|
|
|
|
|
|
|
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
loggedInUser = SessionFacade.LoggedInUser;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (loggedInUser != null && loggedInUser.Employee != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var teams = new List<Team>();
|
|
|
|
|
|
|
|
|
|
|
|
if (teamOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
teams.Add(DAOFactory.GenericDAO.LoadByID<Team>(teamOid.Value));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
teams.AddRange(DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value));
|
|
|
|
|
|
teams.AddRange(DAOFactory.SearchDAO.FindTeamsOfEmployee(loggedInUser.Employee.Oid.Value));
|
|
|
|
|
|
}
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
foreach (var team in teams)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var employee in team.MemberList)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var e2c in employee.Employee2CustomerList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (e2c.Customer.IsActive == ActivationTypeId.Active)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (var v2o in e2c.ValueList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType && v2o.Entry.SystemEntryID.HasValue && v2o.Entry.SystemEntryID.Value == SystemEntryID.EmployeeRoleMainAttendant)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!customerOids.Contains(e2c.Customer.Oid.Value))
|
|
|
|
|
|
{
|
|
|
|
|
|
customerOids.Add(e2c.Customer.Oid.Value);
|
|
|
|
|
|
}
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
return customerOids;
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
public virtual XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
var roList = new List<ServicesOverviewRO>();
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
foreach (var coid in customerOids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (ro != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
roList.Add(ro);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
var sortedList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (sortedList.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
String reportId = null;
|
|
|
|
|
|
if (orgaOid.HasValue && orgaOid > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
|
|
|
|
|
if (organisation != null)
|
|
|
|
|
|
reportId = organisation.Name;
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId);
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (rootReport.Pages.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
rootReport.CreateDocument();
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i < sortedList.Count; i++)
|
2020-10-13 14:35:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
|
|
|
|
|
if (lNext.Pages.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
lNext.CreateDocument();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rootReport.Pages.AddRange(lNext.Pages);
|
2020-09-15 13:14:43 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
return rootReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, String reportId)
|
|
|
|
|
|
{
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
var serviceOverviewReport = this.FindReportImp<ServicesOverviewRO>(reportId);
|
|
|
|
|
|
serviceOverviewReport.SetReportDataSource(ro);
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
return serviceOverviewReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
public virtual XtraReport AddSubServicesOverviewReportToReport(XtraReport masterReport, IBeWoReport<ServicesOverviewRO> newReport, ServicesOverviewRO ro)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ro.Services.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
newReport.SetReportDataSource(ro);
|
|
|
|
|
|
((XtraReport)newReport).CreateDocument();
|
|
|
|
|
|
if (masterReport == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
masterReport = newReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (masterReport.Pages.Count == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
masterReport.CreateDocument();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
masterReport.Pages.AddRange(((XtraReport)newReport).Pages);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return masterReport;
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateSbdLeistungsnachweisForAllCustomers(int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
|
2020-10-13 14:35:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2018-11-22 14:05:45 +01:00
|
|
|
|
//var lROs = SbdStundenaufstellungRO.Create(month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay);
|
|
|
|
|
|
|
|
|
|
|
|
//if (lROs.Count > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var lServiceOverviewAllCustomersReport = this.FindReportImp<SbdStundenaufstellungRO>();
|
|
|
|
|
|
// lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
|
|
|
|
|
|
// (lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
|
|
|
|
|
|
// var Report = lServiceOverviewAllCustomersReport as XtraReport;
|
|
|
|
|
|
|
|
|
|
|
|
// for (int i = 1; i < lROs.Count; i++)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// var lNext = FindReportImp<SbdStundenaufstellungRO>();
|
|
|
|
|
|
// lNext.SetReportDataSource(lROs[i]);
|
|
|
|
|
|
// (lNext as XtraReport).CreateDocument();
|
|
|
|
|
|
// Report.Pages.AddRange((lNext as XtraReport).Pages);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// return lServiceOverviewAllCustomersReport as XtraReport;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateSbdLeistungsnachweisForSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long serviceCategoryOid, int startDay, int endDay)
|
|
|
|
|
|
{
|
|
|
|
|
|
return CreateReportForStundenaufstellungROs(SbdStundenaufstellungRO.Create(customerOid, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
//var report = this.FindReportImp<SbdStundenaufstellungRO>();
|
|
|
|
|
|
//report.SetReportDataSource(SbdStundenaufstellungRO.Create(customerOid, month, year, orgaOid, empOid, serviceCategoryOid, startDay, endDay));
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
//return report as XtraReport;
|
|
|
|
|
|
}
|
2018-11-22 14:05:45 +01:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
private XtraReport CreateReportForStundenaufstellungROs(IList<SbdStundenaufstellungRO> ros)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (ros.Count > 0)
|
|
|
|
|
|
{
|
2018-11-22 14:05:45 +01:00
|
|
|
|
var lServiceOverviewAllCustomersReport = this.FindReportImp<SbdStundenaufstellungRO>();
|
2020-09-30 10:00:31 +02:00
|
|
|
|
lServiceOverviewAllCustomersReport.SetReportDataSource(ros[0]);
|
|
|
|
|
|
(lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
|
|
|
|
|
|
var Report = lServiceOverviewAllCustomersReport as XtraReport;
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
for (int i = 1; i < ros.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var lNext = FindReportImp<SbdStundenaufstellungRO>();
|
|
|
|
|
|
lNext.SetReportDataSource(ros[i]);
|
|
|
|
|
|
(lNext as XtraReport).CreateDocument();
|
|
|
|
|
|
Report.Pages.AddRange((lNext as XtraReport).Pages);
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lServiceOverviewAllCustomersReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateServiceRecordListReport(long employeeOid, long customerOid, long supportConceptOid, long costbearer2SupportConceptOid, bool isLimitedToAdditionalServices, DateTimeSpan limitingTimeSpan)
|
2020-09-30 10:00:31 +02:00
|
|
|
|
{
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
IBeWoReport<ServiceRecordListRO> lServiceRecordListReport = FindReportImp<ServiceRecordListRO>();
|
|
|
|
|
|
lServiceRecordListReport.SetReportDataSource(ServiceRecordListRO.Create(employeeOid, customerOid, supportConceptOid, costbearer2SupportConceptOid, isLimitedToAdditionalServices, limitingTimeSpan));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lServiceRecordListReport as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateSettlementReport(String dcId, long? invoiceBaseOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
Settlement2DC lSettlementDC;
|
|
|
|
|
|
|
|
|
|
|
|
long result;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.SearchDAO.GetSettlementInvoiceByInvoiceBaseOid(invoiceBaseOid.Value));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (Int64.TryParse(dcId, out result))
|
|
|
|
|
|
{
|
|
|
|
|
|
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result)); // = Utils.XMLDeserialize<SettlementDC>(lPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
|
|
|
|
|
|
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
String reportId = null;
|
|
|
|
|
|
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
|
|
|
|
|
reportId = c2s.CostBearer.ID;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
if (lSettlementDC.DifferentHourlyRateCount > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<SettlementRO> lSettlementReport = FindReportImp<SettlementRO>(reportId);
|
|
|
|
|
|
lSettlementReport.SetReportDataSource(SettlementRO.Create(lSettlementDC));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lSettlementReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<Settlement2RO> lSettlementReport = FindReportImp<Settlement2RO>(reportId);
|
|
|
|
|
|
lSettlementReport.SetReportDataSource(Settlement2RO.Create(lSettlementDC));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lSettlementReport as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateSupportConceptReport(IList<long> c2sOids, long? employeeOid, long? teamOid, int? expiredMonths, bool archivedSupportConcepts,
|
2017-03-24 10:30:18 +01:00
|
|
|
|
DateTime? appointedDate)
|
2020-09-30 10:00:31 +02:00
|
|
|
|
{
|
|
|
|
|
|
var lSupportConceptReport = FindReportImp<SupportConceptListRO>();
|
|
|
|
|
|
lSupportConceptReport.SetReportDataSource(SupportConceptListRO.Create(c2sOids, employeeOid, teamOid, expiredMonths, archivedSupportConcepts, appointedDate));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return lSupportConceptReport as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateAdditionalServiceBookingReport(long addServiceRegionOid, Monat month, int year)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<AdditionalServiceBookingRO>();
|
|
|
|
|
|
var x =
|
|
|
|
|
|
AdditionalServiceBookingRO.Create(
|
|
|
|
|
|
DAOFactory.GenericDAO.LoadByID<AdditionalServiceRegion>(addServiceRegionOid), month, year);
|
|
|
|
|
|
report.SetReportDataSource(x);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateEmployeeHourReport(long? employeeOid, IList<long> teamOids, DateTime startDate, DateTime endDate, int ansicht)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<MitarbeiterstundenkontoRO> report;
|
2017-03-14 20:27:20 +01:00
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
if (ansicht == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterarbeitszeitkonto");
|
2017-03-14 20:27:20 +01:00
|
|
|
|
}
|
2020-09-18 15:59:03 +02:00
|
|
|
|
else if (ansicht == 2)
|
2020-10-13 14:35:06 +02:00
|
|
|
|
{
|
|
|
|
|
|
var reportjahr = FindReportImp<MitarbeiterstundenkontoMonateRO>("MitarbeiterarbeitszeitkontoJahr");
|
|
|
|
|
|
var jahrStart = new DateTime(startDate.Year, 1, 1);
|
|
|
|
|
|
var ds = new MitarbeiterstundenkontoMonateRO(employeeOid, teamOids, jahrStart, endDate, null);
|
|
|
|
|
|
|
|
|
|
|
|
reportjahr.SetReportDataSource(ds);
|
|
|
|
|
|
|
|
|
|
|
|
return reportjahr as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (teamOids != null && teamOids.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
report = FindReportImp<MitarbeiterstundenkontoRO>("Teamstundenkonto");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
report = FindReportImp<MitarbeiterstundenkontoRO>("Mitarbeiterstundenkonto");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var x =
|
|
|
|
|
|
MitarbeiterstundenkontoRO.Create(employeeOid, teamOids, startDate, endDate, null);
|
|
|
|
|
|
report.SetReportDataSource(x);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateAuslastungReport(long? employeeOid, IList<long> teamOids, DateTime startDate, DateTime endDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
IBeWoReport<MitarbeiterauslastungRO> report;
|
2017-03-16 13:36:54 +01:00
|
|
|
|
if (teamOids != null && teamOids.Count > 0)
|
|
|
|
|
|
report = FindReportImp<MitarbeiterauslastungRO>("Teamauslastung");
|
2020-09-30 10:00:31 +02:00
|
|
|
|
else
|
|
|
|
|
|
report = FindReportImp<MitarbeiterauslastungRO>("Mitarbeiterauslastung");
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
var x = MitarbeiterauslastungRO.Create(employeeOid, teamOids, startDate, endDate);
|
|
|
|
|
|
report.SetReportDataSource(x);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateMediVerordListenReport(long? mvlOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<MedVerListRO>();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
report.SetReportDataSource(MedVerListRO.Create(mvlOid));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateMediVerordListenMZfReport(long? mvlOid, bool mitZusatzfeldern)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<MedVerListRO>();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
report.SetReportDataSource(MedVerListRO.Create(mvlOid, mitZusatzfeldern));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateKalenderReport(long? employeeOid, AppointmentViewType viewType, DateTime rangeStartDate, DateTime rangeEndDate, List<DateTime> datesList, List<UserRightType> userRights)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = new DailyAppointmentReportKalender();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
//switch (viewType)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// case AppointmentViewType.Week:
|
|
|
|
|
|
// var r = new WeeklyAppointmentReport();
|
|
|
|
|
|
// r.SetReportDataSource(KalenderRO.Create(employeeOid, viewType, rangeStartDate, rangeEndDate, datesList));
|
|
|
|
|
|
// return r;
|
|
|
|
|
|
//}
|
|
|
|
|
|
//throw new NotImplementedException("Wird umgebaut");
|
|
|
|
|
|
//report.SetReportDataSource(KalenderRO.Create(employeeOid, viewType, rangeStartDate, rangeEndDate, datesList, userRights));
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
return report;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateFinanceReport(DateTime? start, DateTime? end)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<FinanceRO>();
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
report.SetReportDataSource(FinanceRO.Create(start, end));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateJahresberichtReport(int year, long? cbOid, long? teamOid, long? betreuungsartOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<JahresReportRO>();
|
|
|
|
|
|
|
|
|
|
|
|
report.SetReportDataSource(JahresReportRO.Create(year, cbOid, teamOid, betreuungsartOid));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2018-10-08 11:57:16 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateEmployeeDataReport(long oid)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<EmployeeDataRO>();
|
|
|
|
|
|
report.SetReportDataSource(EmployeeDataRO.Create(MapperFactory.EmployeeDC_Employee.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Employee>(oid))));
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2019-08-09 16:40:41 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateNotizenReport(long kategorieOid, DateTime start, DateTime end)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<NotizenRO>();
|
|
|
|
|
|
report.SetReportDataSource(NotizenRO.Create(start, end, MapperFactory.NotizenKategorieDC_NotizenKategorie.MapToNewDC(DAOFactory.GenericDAO.LoadByID<NotizenKategorie>(kategorieOid))));
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-15 11:06:50 +02:00
|
|
|
|
public override XtraReport CreateCustomReport(long employeeOid, String reportName)
|
|
|
|
|
|
{
|
2019-08-29 15:43:23 +02:00
|
|
|
|
if (String.IsNullOrEmpty(reportName))
|
|
|
|
|
|
{
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-15 11:06:50 +02:00
|
|
|
|
var report = FindReportImp<QueryRO>(null, reportName);
|
|
|
|
|
|
if (report == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new XtraReport();
|
|
|
|
|
|
}
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2019-09-02 15:48:37 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateSBDCharacteristicsReport(long customerOid)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<SBDCharacteristicsRO>();
|
|
|
|
|
|
report.SetReportDataSource(SBDCharacteristicsRO.Create(MapperFactory.CustomerDC_Customer.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid))));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2020-07-07 16:09:48 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateKilometerauswertung(long customerOid, DateTime rangeDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<KilometerauswertungsRO>();
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
report.SetReportDataSource(KilometerauswertungsRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Customer>(customerOid)), rangeDate));
|
2020-07-07 16:09:48 +02:00
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateKilometerauswertungForAllCustomers(List<long> customerOids, DateTime rangeDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<KilometerauswertungsListRO>();
|
|
|
|
|
|
|
2020-10-13 14:35:06 +02:00
|
|
|
|
report.SetReportDataSource(KilometerauswertungsListRO.Create(MapperFactory.CompactCustomerDC_CustomerCompact.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Customer>(customerOids)), rangeDate));
|
2020-07-07 16:09:48 +02:00
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2020-09-30 19:23:42 +02:00
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateEmployeeKilometerauswertung(long employeeOid, DateTime range)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<EmployeeKilometerauswertungsRO>();
|
|
|
|
|
|
|
|
|
|
|
|
report.SetReportDataSource(EmployeeKilometerauswertungsRO.Create(MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(DAOFactory.GenericDAO.LoadByID<Employee>(employeeOid)), range));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateKilometerauswertungForAllEmployees(List<long> employeeOids, DateTime rangeDate)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<EmployeeKilometerauswertungsListRO>();
|
|
|
|
|
|
|
|
|
|
|
|
report.SetReportDataSource(EmployeeKilometerauswertungsListRO.Create(MapperFactory.CompactEmployeeDC_Employee.MapToNewDCs(DAOFactory.GenericDAO.LoadByIDs<Employee>(employeeOids)), rangeDate));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2020-10-01 13:58:10 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
public override XtraReport CreateAbsenceReport(DateTime dt, List<long> abs, List<long> empTypes)
|
|
|
|
|
|
{
|
|
|
|
|
|
var report = FindReportImp<AbsenceRO>();
|
2020-10-13 14:35:06 +02:00
|
|
|
|
var service = new OperationsServiceImp();
|
2020-10-13 15:22:48 +02:00
|
|
|
|
var filter = new AbsenceOverviewFilterDC() { AbsenceReasons = abs, EmploymentType = empTypes, Year = dt.Year, Month = dt.Month };
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
|
|
|
|
|
report.SetReportDataSource(AbsenceRO.Create(service.GetAbsenceOverview(filter), filter));
|
2020-09-30 10:00:31 +02:00
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateRosterReport(long wOid, DateTime dt)
|
|
|
|
|
|
{
|
|
|
|
|
|
var service = new OperationsServiceImp();
|
|
|
|
|
|
var service2 = new CustomerServiceImp();
|
|
|
|
|
|
var report = FindReportImp<RosterRO>();
|
2020-10-13 14:35:06 +02:00
|
|
|
|
|
2020-09-30 10:00:31 +02:00
|
|
|
|
report.SetReportDataSource(RosterRO.Create(service.GetDienstEintraege(wOid, dt.Year, dt.Month), service.GetAllDienste(), service2.GetAllActiveWohnheimeCompact().First(x => x.WohnheimOid == wOid), dt.Year, dt.Month));
|
|
|
|
|
|
|
|
|
|
|
|
return report as XtraReport;
|
|
|
|
|
|
}
|
2020-09-15 13:14:43 +02:00
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|