Files

95 lines
4.4 KiB
C#
Raw Permalink Normal View History

using System;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared;
2021-11-09 13:18:55 +01:00
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<62>ngig vom KT einen anderen Paragrafen.
// AB, 09.10.2025: die ganze Logik ist nach Frau Neuhausen <20>berholt, die hinterlegen jetzt die Betreuungsart.
// Habs mal zur Sicherheit dringelassen. Wird aber sp<73>ter <20>berschrieben, falls Betreuungsart gesetzt ist
if (pRO.CustomerLastName.ToLower() == "v<>lpert" && pRO.CustomerFirstName.ToLower() == "maren")
{
lblLeistung.Text = "Nach <20> 41 i.V.m. <20> 35 SGB VIII";
}
else if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
2021-11-09 13:18:55 +01:00
{
if (pRO.RecipientOrganisation == "Stadt Herne")
lblLeistung.Text = "Nach <20> 113 SGB IX in Verbindung mit <20> 78 SGB IX";
else if (pRO.RecipientOrganisation.Contains("FUD"))
2021-12-28 16:46:30 +01:00
{
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("(FUD)", "");
2021-11-09 13:18:55 +01:00
lblLeistung.Text = "Nach <20> 27 SGB VIII Familienunterst<73>tzender Dienst";
2021-12-28 16:46:30 +01:00
}
2021-11-09 13:18:55 +01:00
else
2021-12-28 16:46:30 +01:00
{
pRO.RecipientOrganisation = pRO.RecipientOrganisation.Replace("(SPFH)", "");
2021-11-09 13:18:55 +01:00
lblLeistung.Text = "Nach <20> 31 SGB VIII Sozialp<6C>dagogische Familienhilfe";
2021-12-28 16:46:30 +01:00
}
2021-11-09 13:18:55 +01:00
}
if (pRO.ServiceInvoicePeriods != null)
{
var sip = pRO.ServiceInvoicePeriods[0];
2021-11-09 13:18:55 +01:00
String alleSorgeDingens = "";
var customer = DAOFactory.GenericDAO.LoadByID<Customer>(sip.Customer.CustomerOid);
foreach (var c2p in customer.Customer2PersonList)
{
2021-11-09 13:18:55 +01:00
foreach (var v2o in c2p.ValueList)
{
if (v2o.Entry.Type == BS.Shared.ValueListEntryType.RoleInFamily || v2o.Entry.Type == BS.Shared.ValueListEntryType.EnvironmentPersonType)
2021-11-09 13:18:55 +01:00
{
2021-12-28 16:46:30 +01:00
if (v2o.Entry.Value.Contains("Sorgeberechtigt") || v2o.Entry.Value.Contains("Vormund") || v2o.Entry.Value.Contains("Gesetzlicher Vertreter"))
2021-11-09 13:18:55 +01:00
{
if (alleSorgeDingens != "")
alleSorgeDingens += ", " + c2p.Person.FirstNameLastName;
else
alleSorgeDingens += c2p.Person.FirstNameLastName;
2021-11-09 13:18:55 +01:00
}
}
}
}
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;
}
2021-11-09 13:18:55 +01:00
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);
}
}
}