Files
BeWoPlaner/ReportImp/AidsHilfeGiessen/CollectiveBillingReport.cs
2016-06-27 01:45:38 +02:00

46 lines
1.5 KiB
C#

using System;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using DevExpress.XtraReports.UI;
using BS.Shared.Core;
namespace BeWo.AidsHilfeGiessen
{
[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, pRO.AccountingPeriodEnd);
}
}
}
cellTotalPerMonth.Text = String.Format("{0:0.00}", totalPerMonth);
this.bindingSource1.DataSource = pRO;
}
}
}