45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
using BS.Shared.Core;
|
|
|
|
namespace AidshilfeFulda
|
|
{
|
|
[IDSpecificClass(Identifier = "Sammelrechnung")]
|
|
public partial class Sammelrechnung : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public Sammelrechnung()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
decimal totalPerMonth = 0;
|
|
|
|
pRO.ServiceInvoicePeriods.Sort((a, b) => a.Customer.LastNameFirstName.CompareTo(b.Customer.LastNameFirstName));
|
|
DateTime abrechnungsMonatEnde = pRO.AccountingPeriodEnd;
|
|
|
|
if (pRO.ServiceInvoicePeriods != null)
|
|
{
|
|
foreach (var sip in pRO.ServiceInvoicePeriods)
|
|
{
|
|
if (sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue)
|
|
{
|
|
var month = sip.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value/12m;
|
|
totalPerMonth += month;
|
|
}
|
|
if (sip.CostBearer2SupportConcept != null)
|
|
{
|
|
sip.SupportConceptApprovalPeriod.Notice = String.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}",
|
|
sip.CostBearer2SupportConcept.StartDate, sip.CostBearer2SupportConcept.EndDate);
|
|
}
|
|
}
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |