153 lines
6.6 KiB
C#
153 lines
6.6 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 BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using System.Text;
|
|
|
|
namespace AbwKlassen.Alt
|
|
{
|
|
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
|
|
{
|
|
public Spitzabrechnung()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(SettlementRO pRO)
|
|
{
|
|
if (pRO.FinalSentence.IndexOf("Bitte überweisen Sie") == 0)
|
|
pRO.FinalSentence = "Bitte überweisen Sie unsere Restforderung nach Prüfung der Schlussabrechnung auf das oben angegebene Konto.";
|
|
|
|
|
|
if (pRO.DifferentHourlyRateCount == 3)
|
|
{
|
|
//Erbrachte Leistungen (FLS) - bis [HourlyRateOldEndDateString] à [HourlyRateOldString] €
|
|
|
|
pRO.Abrechnungstext1 = String.Format("{0} bis {1}",
|
|
pRO.AccountingStartDateString, pRO.HourlyRate3EndDateString);
|
|
|
|
pRO.Abrechnungstext1 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatz3, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRate3);
|
|
|
|
//[AccountingStartDateString] - [HourlyRate3EndDateString] sind [RecordedFLSWithHourlyRate3String] Std. x [HourlyRate3String] € =";
|
|
|
|
pRO.Betrag1 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor * pRO.HourlyRate3);
|
|
|
|
|
|
pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
|
|
pRO.HourlyRateOldStartDateString, pRO.HourlyRateOldEndDateString);
|
|
pRO.Abrechnungstext2 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
|
|
|
|
pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
|
|
|
|
|
|
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
|
|
pRO.Abrechnungstext3 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
}
|
|
else if (pRO.DifferentHourlyRateCount == 2)
|
|
{
|
|
|
|
pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
|
|
pRO.AccountingStartDateString, pRO.HourlyRateOldEndDateString);
|
|
pRO.Abrechnungstext2 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
|
|
|
|
pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
|
|
|
|
|
|
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
|
|
pRO.Abrechnungstext3 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
}
|
|
else
|
|
{
|
|
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
|
|
pRO.AccountingStartDateString, pRO.AccountingEndDateString);
|
|
pRO.Abrechnungstext3 += String.Format(" {0:0.##} FLS {1}x {2:0.00}:",
|
|
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
|
|
|
|
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
|
|
}
|
|
|
|
ErstelleAbwesenheiten(pRO);
|
|
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
private void ErstelleAbwesenheiten(SettlementRO pRo)
|
|
{
|
|
pRo.AbsenceTimes = "";
|
|
|
|
if (pRo.CostBearer2SupportConceptOid < 1)
|
|
return;
|
|
|
|
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRo.CostBearer2SupportConceptOid);
|
|
var c = cb2sc.SupportConcept.Customer;
|
|
|
|
if (c.AbsenceTimes != null)
|
|
{
|
|
var sb = new StringBuilder();
|
|
|
|
foreach (var at in c.AbsenceTimes)
|
|
{
|
|
if (at.AbsenceSpan != null)
|
|
{
|
|
if (at.Start != null && at.Start <= pRo.AccountingEndDate && ((at.End != null && at.End >= pRo.AccountingStartDate) || at.End == null))
|
|
{
|
|
DateTime start = at.Start.Value.AddDays(1);
|
|
DateTime end = DateTime.MaxValue;
|
|
if (at.End.HasValue)
|
|
{
|
|
end = at.End.Value.AddDays(-1);
|
|
}
|
|
|
|
if (end.Subtract(start).TotalDays > 0)
|
|
{
|
|
if (sb.Length > 0)
|
|
{
|
|
sb.Append(", ");
|
|
}
|
|
|
|
|
|
sb.Append(string.Format("{0:dd.MM.yyyy}", start));
|
|
|
|
sb.Append(" - ");
|
|
|
|
if (end == DateTime.MaxValue)
|
|
{
|
|
sb.Append("unbekannt");
|
|
}
|
|
else
|
|
{
|
|
sb.Append(string.Format("{0:dd.MM.yyyy}", end));
|
|
}
|
|
|
|
sb.Append(" ");
|
|
sb.Append(at.AbsenceReason.Description);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (sb.Length > 0)
|
|
{
|
|
pRo.AbsenceTimes = "Abwesenheitszeiten: " + sb;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|