106 lines
2.9 KiB
C#
106 lines
2.9 KiB
C#
using System;
|
|
using BeWo.Report.ReportObjects;
|
|
using BeWo.Report;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace VSDHammReports
|
|
{
|
|
[IDSpecificClass(Identifier = "LWLMITANHANG")]
|
|
|
|
public partial class Budgetnachweis2 : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Budgetnachweis2()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(Settlement2RO pRO)
|
|
{
|
|
if (String.IsNullOrEmpty(pRO.RecipientOrganisation) || !pRO.RecipientOrganisation.ToLower().StartsWith("lwl"))
|
|
{
|
|
lblAZ.Text = "";
|
|
lblAZLabel.Text = "";
|
|
lblZad.Text = "60-9011896.1";
|
|
}
|
|
else
|
|
{
|
|
lblZad.Text = "60-9011897.1";
|
|
}
|
|
|
|
cellBewilligteFLSText.Text = "Bewilligte FLS";
|
|
|
|
if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail))
|
|
{
|
|
pRO.SenderContactPersonMail = pRO.SenderContactPersonMail.Replace("Email: ", "").Trim();
|
|
}
|
|
if (!String.IsNullOrEmpty(pRO.SenderContactPersonPhone))
|
|
{
|
|
pRO.SenderContactPersonPhone = pRO.SenderContactPersonPhone.Replace("Tel.: ", "").Trim();
|
|
}
|
|
|
|
decimal ratefactor = 0;
|
|
|
|
if (pRO.InvoiceItems != null)
|
|
{
|
|
foreach (var ii in pRO.InvoiceItems)
|
|
{
|
|
ii.DetailDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}",
|
|
ii.PeriodStartDate, ii.PeriodEndDate);
|
|
ii.DetailDescription += String.Format(": {0:0.##} FLS x {1:c}",
|
|
ii.UnitCount, ii.AmountPerUnit);
|
|
|
|
ratefactor = ii.RateFactor ?? 1;
|
|
|
|
ii.ItemDescription = "Fachleistungsstunden";
|
|
if (ii.RateFactor == 0)
|
|
{
|
|
Zwischensumme.Visible = true;
|
|
ii.DetailDescription = ii.DetailDescription.Replace("FLS", "Std.");
|
|
ii.ItemDescription = "Fehlkontakte";
|
|
}
|
|
}
|
|
}
|
|
pRO.ApprovedFLSTotal *= (100 + ratefactor) / 100;
|
|
|
|
xrCheckBox2.Checked = true;
|
|
DateTime? terminationDate = null;
|
|
|
|
if (pRO.TerminationDate.HasValue)
|
|
{
|
|
terminationDate = pRO.TerminationDate;
|
|
xrCheckBox1.Text = String.Format(" Die Betreuung wurde am {0:dd.MM.yyyy} beendet.",
|
|
pRO.TerminationDate);
|
|
xrCheckBox2.Checked = false;
|
|
xrCheckBox1.Checked = true;
|
|
}
|
|
SetzeWohnort(pRO);
|
|
|
|
//var anhang = new BudgetnachweisAnhang();
|
|
//xrSubreport1.ReportSource = anhang;
|
|
////anhang.SetReportDataSource(pRO);
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void SetzeWohnort(Settlement2RO pRo)
|
|
{
|
|
if (pRo.InvoiceBaseOid.HasValue)
|
|
{
|
|
var ib = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(pRo.InvoiceBaseOid.Value);
|
|
if (ib.CostBearer2SupportConcept != null)
|
|
{
|
|
var c = ib.CostBearer2SupportConcept.SupportConcept.Customer;
|
|
|
|
if (c != null && c.Person.Address != null)
|
|
{
|
|
lblWohnort.Text = String.Format("{0} in {1} {2}", c.Person.Address.Street, c.Person.Address.PostalCode, c.Person.Address.Town);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|