45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
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 BeWo.Service.DCEntityMapper;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
using DevExpress.XtraReports.Design;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace LebenshilfeDorsten
|
|
{
|
|
public class CustomReportCreator : DefaultReportCreator
|
|
{
|
|
public override XtraReport CreateSettlementReport(string dcId, long? invoiceBaseOid)
|
|
{
|
|
long result;
|
|
Settlement2DC lSettlementDC;
|
|
string cbName;
|
|
if (invoiceBaseOid.HasValue && invoiceBaseOid.Value > 0)
|
|
{
|
|
long invoiceOid = invoiceBaseOid.Value;
|
|
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(invoiceOid);
|
|
cbName = ib.CostBearer2SupportConcept.CostBearer.Organisation.Name;
|
|
}
|
|
|
|
else
|
|
{
|
|
Int64.TryParse(dcId, out result);
|
|
lSettlementDC = MapperFactory.SettlementDC_SettlementInvoice.MapToNewDC(DAOFactory.GenericDAO.LoadByID<SettlementInvoice>(result));
|
|
cbName = lSettlementDC.RecipientOrganisation;
|
|
}
|
|
|
|
if (cbName.Contains("Landschaftsverband Westfalen-Lippe") || cbName == "LWL")
|
|
return base.CreateSettlementReport(dcId, invoiceBaseOid, true);
|
|
|
|
return base.CreateSettlementReport(dcId, invoiceBaseOid, false);
|
|
}
|
|
}
|
|
}
|