95 lines
4.4 KiB
C#
95 lines
4.4 KiB
C#
using System;
|
|
using System.Linq;
|
|
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BeWo.Report;
|
|
using BeWo.Report.ReportObjects;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
namespace ChristopherusHausFamilienhilfe
|
|
{
|
|
public partial class ServiceInvoiceReport : XtraReport, IBeWoReport<ServiceInvoiceRO>
|
|
{
|
|
public ServiceInvoiceReport()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public void SetReportDataSource(ServiceInvoiceRO pRO)
|
|
{
|
|
DateTime start = pRO.AccountingPeriodStart;
|
|
DateTime end = pRO.AccountingPeriodEnd;
|
|
lblRechnungsnummer.Text = pRO.InvoiceNumber;
|
|
|
|
// Klientin Maren Völpert wird noch bis Juli 23 betreut und bekommt unabhängig vom KT einen anderen Paragrafen.
|
|
// AB, 09.10.2025: die ganze Logik ist nach Frau Neuhausen überholt, die hinterlegen jetzt die Betreuungsart.
|
|
// Habs mal zur Sicherheit dringelassen. Wird aber später überschrieben, falls Betreuungsart gesetzt ist
|
|
if (pRO.CustomerLastName.ToLower() == "völpert" && pRO.CustomerFirstName.ToLower() == "maren")
|
|
{
|
|
lblLeistung.Text = "Nach § 41 i.V.m. § 35 SGB VIII";
|
|
}
|
|
else if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
|
|
{
|
|
if (pRO.RecipientOrganisation == "Stadt Herne")
|
|
lblLeistung.Text = "Nach § 113 SGB IX in Verbindung mit § 78 SGB IX";
|
|
|
|
else if (pRO.RecipientOrganisation.Contains("FUD"))
|
|
{
|
|
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("(FUD)", "");
|
|
lblLeistung.Text = "Nach § 27 SGB VIII Familienunterstützender Dienst";
|
|
}
|
|
else
|
|
{
|
|
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("(SPFH)", "");
|
|
lblLeistung.Text = "Nach § 31 SGB VIII Sozialpädagogische Familienhilfe";
|
|
}
|
|
}
|
|
|
|
if (pRO.ServiceInvoicePeriods != null)
|
|
{
|
|
var sip = pRO.ServiceInvoicePeriods[0];
|
|
String alleSorgeDingens = "";
|
|
|
|
var customer = DAOFactory.GenericDAO.LoadByID<Customer>(sip.Customer.CustomerOid);
|
|
foreach (var c2p in customer.Customer2PersonList)
|
|
{
|
|
foreach (var v2o in c2p.ValueList)
|
|
{
|
|
if (v2o.Entry.Type == BS.Shared.ValueListEntryType.RoleInFamily || v2o.Entry.Type == BS.Shared.ValueListEntryType.EnvironmentPersonType)
|
|
{
|
|
if (v2o.Entry.Value.Contains("Sorgeberechtigt") || v2o.Entry.Value.Contains("Vormund") || v2o.Entry.Value.Contains("Gesetzlicher Vertreter"))
|
|
{
|
|
if (alleSorgeDingens != "")
|
|
alleSorgeDingens += ", " + c2p.Person.FirstNameLastName;
|
|
else
|
|
alleSorgeDingens += c2p.Person.FirstNameLastName;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var betreuungsarten = customer.ValueList.Where(v2o => v2o.Entry.Type == ValueListEntryType.CustomerCareType).ToList();
|
|
if (betreuungsarten != null && betreuungsarten.Count > 0)
|
|
{
|
|
var ba = betreuungsarten.FirstOrDefault();
|
|
lblLeistung.Text = ba.Entry.Value;
|
|
}
|
|
|
|
lblSorgeBerechtigter.Text = alleSorgeDingens;
|
|
lblGebDatum.Text = String.Format("{0:dd/MM/yyyy}", sip.Customer.DateOfBirth);
|
|
lblHilfeBeginn.Text = String.Format("{0:dd/MM/yyyy}", sip.Customer.AssistanceBegin);
|
|
lblHPG.Text = String.Format("{0:dd/MM/yyyy}", sip.CostBearer2SupportConcept.SupportConcept.ConferenceDate);
|
|
lblBewZeitraum.Text = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}", pRO.InvoiceBase.SupportConceptCostBearerRelDc.StartDate, pRO.InvoiceBase.SupportConceptCostBearerRelDc.EndDate);
|
|
}
|
|
this.bindingSource1.DataSource = pRO;
|
|
}
|
|
|
|
// Die Rechnungsnummer muss für den FiBu-Export gleich dem PDF-Namen sein!
|
|
private void ChangeName(object sender, EventArgs e)
|
|
{
|
|
PrintingSystem.Document.Name = String.Format("Rechnung SPFH{0}", lblRechnungsnummer.Text);
|
|
}
|
|
}
|
|
} |