2022-11-17 08:46:57 +01: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;
|
|
|
|
|
|
using DevExpress.XtraReports.Design;
|
|
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DiePerspektive
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
|
|
|
|
{
|
2023-03-28 00:02:15 +02:00
|
|
|
|
public override XtraReport CreateQueryReport(long queryOid, string queryReportId)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (queryOid == 400)
|
|
|
|
|
|
{
|
|
|
|
|
|
return base.CreateQueryReport(queryOid, queryReportId);
|
|
|
|
|
|
}
|
|
|
|
|
|
return base.CreateQueryReport(queryOid, queryReportId);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override XtraReport CreateSettlementReport(string dcId, long? invoiceBaseOid)
|
2022-11-17 08:46:57 +01:00
|
|
|
|
{
|
|
|
|
|
|
long oid = 0;
|
|
|
|
|
|
long? ibOid = null;
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
ibOid = invoiceBaseOid.Value;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Int64.TryParse(dcId, out oid);
|
|
|
|
|
|
var si = DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(oid);
|
|
|
|
|
|
ibOid = si.InvoiceBase.Oid;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ibOid.HasValue && ibOid.Value > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(ibOid.Value);
|
|
|
|
|
|
string cbName = ib.CostBearer2SupportConcept.CostBearer.Organisation.Name;
|
|
|
|
|
|
if (cbName.Contains("Landschaftsverband Westfalen-Lippe") || cbName.StartsWith("LWL"))
|
|
|
|
|
|
return base.CreateSettlementReport(null, ibOid, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
return base.CreateSettlementReport(dcId, invoiceBaseOid, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|