Files
BeWoPlaner/ReportImp/VerbandEvKirchengemeindenDorsten/SettlementReportBeWo672.cs

96 lines
2.6 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 VerbandEvKirchengemeindenDorsten
{
public partial class Spitzabrechnung2BeWo67 : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
public Spitzabrechnung2BeWo67()
{
InitializeComponent();
}
public void SetReportDataSource(Settlement2RO pRO)
{
if (!String.IsNullOrWhiteSpace(pRO.RecipientOrganisation))
{
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("§67", "").Trim();
}
decimal totalFLSGeleistet = 0;
decimal totalEURGesamt = 0;
List<Settlement2RO.SettlementInvoiceItemRO> items = new List<Settlement2RO.SettlementInvoiceItemRO>();
Settlement2RO.SettlementInvoiceItemRO fahrZeiten = null;
Settlement2RO.SettlementInvoiceItemRO 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;
}
else
{
lblFahrtzeitenBetrag.Text = String.Format("{0:c}", 0);
}
if (fehlkontakte != null)
{
lblAusfallzeitenBetrag.Text = String.Format("{0:c}", fehlkontakte.GrossAmountTotal);
totalEURGesamt += fehlkontakte.GrossAmountTotal ?? 0;
}
else
{
lblAusfallzeitenBetrag.Text = String.Format("{0:c}", 0);
}
lblGesamtbetrag.Text = String.Format("{0:c}", totalEURGesamt);
if (pRO.TerminationDate.HasValue)
{
chkBetreuungBeendet.Text = String.Format("Die Betreuung wurde am {0:dd.MM.yyyy} beendet.", pRO.TerminationDate);
chkBetreuungBeendet.Checked = true;
}
else
{
chkBetreuungDauertAn.Checked = true;
}
this.bindingSource1.DataSource = pRO;
}
}
}