76 lines
1.9 KiB
C#
76 lines
1.9 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using DevExpress.XtraReports.UI;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using BS.Shared.Core;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace Biotop
|
|
{
|
|
[IDSpecificClass(Identifier = "LWLNEU")]
|
|
|
|
public partial class Budgetnachweis : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Budgetnachweis()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
|
{
|
|
decimal rateFactor = 1;
|
|
|
|
foreach (var ii in pRO.InvoiceItems)
|
|
{
|
|
if (ii.RateFactor.HasValue)
|
|
{
|
|
rateFactor = (100 + ii.RateFactor.Value) / 100;
|
|
}
|
|
|
|
ii.ItemDescription = "Fachleistungsstunden";
|
|
|
|
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
|
{
|
|
Zwischensumme.Visible = true;
|
|
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
|
|
ii.ItemDescription = "Fehlkontakte";
|
|
}
|
|
}
|
|
pRO.RateFactor = (double)rateFactor;
|
|
|
|
pRO.CustomerFirstName = "";
|
|
if (pRO.InvoiceBaseOid.HasValue)
|
|
{
|
|
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(pRO.InvoiceBaseOid.Value);
|
|
|
|
var c = ib.CostBearer2SupportConcept.SupportConcept.Customer;
|
|
|
|
if (c.Person.Address != null)
|
|
{
|
|
pRO.CustomerFirstName = String.Format("{0}, {1} {2}", c.Person.Address.Street, c.Person.Address.PostalCode, c.Person.Address.Town);
|
|
}
|
|
}
|
|
|
|
|
|
xrCheckBox2.Checked = true;
|
|
DateTime? terminationDate = null;
|
|
|
|
if (pRO.TerminationDate.HasValue)
|
|
{
|
|
terminationDate = pRO.TerminationDate;
|
|
xrCheckBox1.Text = String.Format(" Die Betreuung wurde beendet am {0:dd.MM.yyyy}.",
|
|
pRO.TerminationDate);
|
|
xrCheckBox2.Checked = false;
|
|
xrCheckBox1.Checked = true;
|
|
}
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|