72 lines
2.1 KiB
C#
72 lines
2.1 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 System.Text.RegularExpressions;
|
|
using BS.Shared.Extensions;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Service.DCEntityMapper;
|
|
using System.Linq;
|
|
|
|
namespace BeWo.Report.DefaultReports
|
|
{
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
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;
|
|
}
|
|
|
|
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
|
|
{
|
|
Zwischensumme.Visible = true;
|
|
//if (!ii.ItemDescription.IsNullOrEmpty())
|
|
//{
|
|
//ii.AbrechnungsText = Regex.Replace(ii.DetailDescription, ii.ItemDescription, "Fehlkontakte");
|
|
//}
|
|
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
|
|
ii.ItemDescription = "Fehlkontakte";
|
|
}
|
|
else if (ii.ItemDescription.IsNullOrEmpty())
|
|
{
|
|
ii.ItemDescription = "Fachleistungsstunden";
|
|
}
|
|
}
|
|
pRO.RateFactor = (double)rateFactor;
|
|
|
|
if (pRO.Salutation1.IsNullOrEmpty() && pRO.Salutation2.IsNullOrEmpty())
|
|
{
|
|
lblAnrede.Text = "Guten Tag,";
|
|
}
|
|
|
|
if (pRO.SenderContactPersonFax != null)
|
|
pRO.SenderContactPersonFax = pRO.SenderContactPersonFax.Replace("Fax", "Mobil");
|
|
if (pRO.SenderContactPersonPhone != null)
|
|
pRO.SenderContactPersonPhone = pRO.SenderContactPersonPhone.Replace("Tel.", "Telefon");
|
|
|
|
if (!pRO.SenderContactPerson.IsNullOrEmpty() && pRO.SenderContactPerson.Contains("Peters"))
|
|
pRO.SenderContactPersonDivision = "(Leitung Ambulant Betreutes Wohnen Porta e.V.)";
|
|
else
|
|
pRO.SenderContactPersonDivision = "(Verwaltung)";
|
|
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
}
|