Files
BeWoPlaner/ReportImp/CaritasAhlen/SettlementReportBeWo67.cs
2018-10-08 12:09:48 +02:00

78 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using BeWo.Service.Invoicing;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
namespace IbpEingliederungshilfe
{
[IDSpecificClass(Identifier = "LWLBeWo67")]
public partial class SpitzabrechnungBeWo67 : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
{
public SpitzabrechnungBeWo67()
{
InitializeComponent();
}
public void SetReportDataSource(SettlementRO pRO)
{
decimal totalFLSBewilligt = 0;
decimal totalFLSGeleistet = 0;
decimal totalEURGesamt = 0;
foreach (var ap in pRO.CostbearerApprovalPeriods)
{
totalFLSBewilligt += ap.ApprovedTotal;
}
IList<InvoiceItemDC> items = new List<InvoiceItemDC>();
InvoiceItemDC fahrZeiten = null;
InvoiceItemDC fehlkontakte = null;
foreach (var ii in pRO.InvoiceItems)
{
if (ii.ItemDescription == "Fahrt- und Wegezeiten")
{
fahrZeiten = ii;
}
else if (ii.ItemDescription == "Ausfallzeiten Fehlkontakte")
{
fehlkontakte = ii;
}
else
{
items.Add(ii);
totalFLSGeleistet += ii.UnitCount ?? 0;
totalEURGesamt += ii.GrossAmountTotal ?? 0;
}
}
pRO.InvoiceItems = items;
//lblFLSGesamtBewilligt.Text = String.Format("{0:0.00}", totalFLSBewilligt);
lblFLSErbracht.Text = String.Format("{0:0.00}", totalFLSGeleistet);
lblEURGesamt.Text = String.Format("{0:c}", totalEURGesamt);
if (fahrZeiten != null)
{
lblFahrtzeitenBetrag.Text = String.Format("{0:c}", fahrZeiten.GrossAmountTotal);
totalEURGesamt += fahrZeiten.GrossAmountTotal ?? 0;
}
if (fehlkontakte != null)
{
lblAusfallzeitenBetrag.Text = String.Format("{0:c}", fehlkontakte.GrossAmountTotal);
totalEURGesamt += fehlkontakte.GrossAmountTotal ?? 0;
}
lblGesamtbetrag.Text = String.Format("{0:c}", totalEURGesamt);
this.bindingSource1.DataSource = pRO;
}
}
}