57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
using BS.Shared.Core;
|
|
|
|
namespace KlinikumWerraMeissner
|
|
{
|
|
[IDSpecificClass(Identifier = "Sammelrechnung")]
|
|
public partial class Sammelrechnung : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public Sammelrechnung()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
if (pRO.AccountingPeriodStart != null && pRO.AccountingPeriodEnd != null)
|
|
{
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
|
|
if (start.Year != end.Year || start.Month != end.Month)
|
|
{
|
|
lblZeitraum.Text = "Abrechnungszeitraum:";
|
|
lblZeitraumAngabe.Text = String.Format("{0:dd.MM.yyyy} - {1:dd.MM.yyyy}", start, end);
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
} |