PetraWagnerMatthes/CustomReportCreator Anhang Leistungsnachweis an Rg
This commit is contained in:
@@ -11,6 +11,7 @@ using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using DevExpress.XtraReports.Design;
|
||||
using DevExpress.XtraReports.UI;
|
||||
@@ -178,5 +179,94 @@ namespace PetraWagnerMatthes
|
||||
|
||||
return report as XtraReport;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(dcIds))
|
||||
{
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
return CreateInvoiceReport(dcList);
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
private XtraReport CreateInvoiceReport(List<ServiceInvoiceDC> invoices)
|
||||
{
|
||||
XtraReport allReports = null;
|
||||
|
||||
foreach (var iDC in invoices)
|
||||
{
|
||||
XtraReport invoiceReport = null;
|
||||
|
||||
if (iDC.ServiceInvoicePeriods.Count > 0 && iDC.ServiceInvoicePeriods[0].SupportConceptApprovalPeriod.ServiceCategory != null)
|
||||
//&& iDC.InvoiceBase.InvoiceId == "RechnungSoziotherapie")
|
||||
{
|
||||
XtraReport masterReport = new XtraReport();
|
||||
masterReport.CreateDocument();
|
||||
|
||||
var seite1 = new ServiceInvoiceReport();
|
||||
var ro = ServiceInvoiceRO.Create(iDC);
|
||||
|
||||
seite1.SetReportDataSource(ro);
|
||||
seite1.CreateDocument();
|
||||
|
||||
int month = iDC.InvoiceBase.AccountingPeriodStart.Value.Month;
|
||||
int year = iDC.InvoiceBase.AccountingPeriodStart.Value.Year;
|
||||
long cOid = iDC.InvoiceBase.SupportConceptCostBearerRelDc.SupportConcept.Customer.CustomerOid;
|
||||
long oOid = iDC.InvoiceBase.RecipientOrganisationOid ?? 0;
|
||||
long scOid = iDC.ServiceInvoicePeriods[0].SupportConceptApprovalPeriod.ServiceCategory.ServiceCategoryOid.Value;
|
||||
|
||||
var qb = CreateServiceOverviewSingleCustomerReport(cOid, month, year, oOid, 0, scOid, 1, DateTime.DaysInMonth(year, month));
|
||||
qb.CreateDocument();
|
||||
|
||||
masterReport.Pages.AddRange(seite1.Pages);
|
||||
// nur wenn Wasserzeichen in Rg
|
||||
//foreach (DevExpress.XtraPrinting.Page item in masterReport.Pages)
|
||||
//{
|
||||
// item.AssignWatermark(seite1.Watermark);
|
||||
//}
|
||||
masterReport.Pages.AddRange(qb.Pages);
|
||||
invoiceReport = masterReport;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
IBeWoReport<ServiceInvoiceRO> singleReport = FindReportImp<ServiceInvoiceRO>(iDC.InvoiceBase.InvoiceId);
|
||||
var ro = ServiceInvoiceRO.Create(iDC);
|
||||
singleReport.SetReportDataSource(ro);
|
||||
((XtraReport)singleReport).CreateDocument();
|
||||
invoiceReport = singleReport as XtraReport;
|
||||
}
|
||||
|
||||
if (allReports == null)
|
||||
{
|
||||
allReports = invoiceReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
((XtraReport)allReports).Pages.AddRange(invoiceReport.Pages);
|
||||
}
|
||||
}
|
||||
|
||||
return allReports as XtraReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user