105 lines
3.4 KiB
C#
105 lines
3.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace BeWo.WegweiserBetreuungsdienstReports
|
|
{
|
|
public partial class RechnungSPFH : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public RechnungSPFH()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
|
|
if (pRO.CustomerSalutation == "Herr")
|
|
{
|
|
pRO.CustomerSalutation = "Herrn";
|
|
}
|
|
//if (start.Month == end.Month && start.Year == end.Year)
|
|
//{
|
|
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Monat {0:MMMM yyyy} folgende erbrachte Tätigkeiten:", start);
|
|
//}
|
|
//else
|
|
//{
|
|
// lblAbrechnungszeitraum.Text = String.Format("hiermit berechnen wir für den Zeitraum {0:MMMM yyyy} - {1:MMMM yyyy} folgende erbrachte Tätigkeiten:", start, end);
|
|
//}
|
|
|
|
decimal approved = 0;
|
|
decimal approvedFactor = 0;
|
|
|
|
//decimal amountTotal = 0;
|
|
|
|
bool isFamilienhilfe = false;
|
|
bool isLvr2 = false;
|
|
|
|
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.Contains("LVR II"))
|
|
{
|
|
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace(" II", "");
|
|
isLvr2 = true;
|
|
}
|
|
|
|
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation) && pRO.RecipientOrganisation.Contains("Jugendhilfe"))
|
|
{
|
|
isFamilienhilfe = true;
|
|
}
|
|
else if (!String.IsNullOrEmpty(pRO.RecipientDivision) && pRO.RecipientDivision.Contains("Jugendhilfe"))
|
|
{
|
|
isFamilienhilfe = true;
|
|
}
|
|
|
|
|
|
if (pRO.ServiceInvoicePeriods.Count > 0)
|
|
{
|
|
var sip = pRO.ServiceInvoicePeriods[0];
|
|
for (int i = 1; i < pRO.ServiceInvoicePeriods.Count; i++)
|
|
{
|
|
sip.ServiceInvoiceItems.AddRange(pRO.ServiceInvoicePeriods[i].ServiceInvoiceItems);
|
|
}
|
|
|
|
pRO.ServiceInvoicePeriods = new List<ServiceInvoicePeriodRO>();
|
|
pRO.ServiceInvoicePeriods.Add(sip);
|
|
}
|
|
|
|
foreach (var sip in pRO.ServiceInvoicePeriods)
|
|
{
|
|
approved += sip.ApprovedHours ?? 0;
|
|
|
|
foreach (var ii in sip.ServiceInvoiceItems)
|
|
{
|
|
|
|
if (String.IsNullOrEmpty(ii.RateFactor) || ii.RateFactor == "1" || ii.RateFactor == "0,00 %")
|
|
{
|
|
ii.ServiceDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} Std. {3}x {4:c}", ii.AccountingPeriodStart, ii.AccountingPeriodEnd,
|
|
ii.UnitCount, "", ii.AmountPerUnit);
|
|
}
|
|
else
|
|
{
|
|
ii.ServiceDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS {3}x {4:c}",
|
|
ii.AccountingPeriodStart, ii.AccountingPeriodEnd,
|
|
ii.UnitCount, "", ii.AmountPerUnit);
|
|
}
|
|
//amountTotal += ii.NetAmount ?? 0;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
cellRechnungsbetrag.Text = pRO.NetClaim;
|
|
|
|
if (String.IsNullOrEmpty(pRO.Notice))
|
|
{
|
|
//lblNotice.Visible = false;
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
}
|
|
} |