78 lines
2.0 KiB
C#
78 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared.DataContracts;
|
|
using BS.Shared.Extensions;
|
|
|
|
namespace HilfeDaheimHandInHand
|
|
{
|
|
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.TerminationDate == null)
|
|
{
|
|
lblStammdaten.Text = lblStammdaten.Text.Remove(lblStammdaten.Text.Length - 34, 34);
|
|
}
|
|
if (pRO.Claim > 0)
|
|
lblRestforderungGutschrift.Text = "Restforderung";
|
|
else
|
|
lblRestforderungGutschrift.Text = "Gutschrift aus Überzahlung";
|
|
|
|
if (pRO.AbsenceReason1 == null)
|
|
pRO.AbsenceReason1 = "-";
|
|
if (pRO.AbsenceReason2 == null)
|
|
pRO.AbsenceReason2 = "-";
|
|
if (pRO.AbsenceReason3 == null)
|
|
pRO.AbsenceReason3 = "-";
|
|
if (pRO.AbsenceReason4 == null)
|
|
pRO.AbsenceReason4 = "-";
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
//private String GetCustomerId(SettlementRO pRO)
|
|
// {
|
|
// var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
|
|
// return cb2sc.CostBearer.ID;
|
|
// }
|
|
|
|
}
|
|
}
|