Hph Bersenbrück ATZ Erstelle zwei Belege, wenn sich der KT mitten im Monat ändert

This commit is contained in:
2026-01-30 19:27:29 +01:00
parent 5859869644
commit dd6086cdb9
2 changed files with 88 additions and 6 deletions

View File

@@ -119,12 +119,19 @@ namespace BeWo.HphBersenbrueckAtz
var rootReport = CreateServicesOverviewReportForRo(lROs[0], null); var rootReport = CreateServicesOverviewReportForRo(lROs[0], null);
rootReport.CreateDocument(); if (rootReport.Pages.Count == 0)
{
rootReport.CreateDocument();
}
for (int i = 1; i < lROs.Count; i++) for (int i = 1; i < lROs.Count; i++)
{ {
var lNext = CreateServicesOverviewReportForRo(lROs[i], null); var lNext = CreateServicesOverviewReportForRo(lROs[i], null);
lNext.CreateDocument(); if (lNext.Pages.Count == 0)
{
lNext.CreateDocument();
}
rootReport.Pages.AddRange(lNext.Pages); rootReport.Pages.AddRange(lNext.Pages);
} }
@@ -206,7 +213,7 @@ namespace BeWo.HphBersenbrueckAtz
reportId = organisation.Name; reportId = organisation.Name;
} }
var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId); var rootReport = CreateServicesOverviewReportForRo(sortedList[0], reportId);
if (rootReport.Pages.Count == 0) if (rootReport.Pages.Count == 0)
{ {
rootReport.CreateDocument(); rootReport.CreateDocument();
@@ -215,7 +222,7 @@ namespace BeWo.HphBersenbrueckAtz
for (int i = 1; i < sortedList.Count; i++) for (int i = 1; i < sortedList.Count; i++)
{ {
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId); var lNext = CreateServicesOverviewReportForRo(sortedList[i], reportId);
if (lNext.Pages.Count == 0) if (lNext.Pages.Count == 0)
{ {
lNext.CreateDocument(); lNext.CreateDocument();
@@ -231,14 +238,87 @@ namespace BeWo.HphBersenbrueckAtz
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, String reportId) private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, String reportId)
{
var kt2Ro = new Dictionary<string, ServicesOverviewRO>();
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 1)
{
//Erstelle einen Beleg pro Kostenträger
foreach (var s in ro.Services)
{
if (s.IsBillable)
{
if (String.IsNullOrEmpty(s.CostBearer))
{
s.CostBearer = "-";
}
if (!kt2Ro.ContainsKey(s.CostBearer))
{
kt2Ro.Add(s.CostBearer, ServicesOverviewRO.CopyFromRO(ro));
}
var newRo = kt2Ro[s.CostBearer];
newRo.Services.Add(s);
}
}
}
else
{
kt2Ro.Add("", ro);
}
XtraReport rootReport = null;
foreach (var rov in kt2Ro.Values)
{
CheckKostentraeger(rov);
var report = CreateServicesOverviewReportForRo2(rov, reportId);
if (report.Pages.Count == 0)
{
report.CreateDocument();
}
if (rootReport == null)
{
rootReport = report;
}
else
{
rootReport.Pages.AddRange(report.Pages);
}
}
return rootReport;
}
private void CheckKostentraeger(ServicesOverviewRO rov)
{
if (rov.CostBearer2SupportConceptList != null && rov.CostBearer2SupportConceptList.Count > 1)
{
if (rov.Services.Count > 0)
{
var datum = rov.Services[0].StartDate;
foreach (var c2s in rov.CostBearer2SupportConceptList)
{
if (c2s.StartDate <= datum.Date && c2s.EndDate >= datum.Date)
{
rov.ApprovedStartDate = String.Format("{0:dd.MM.yyyy}", c2s.StartDate);
rov.ApprovedEndDate = String.Format("{0:dd.MM.yyyy}", c2s.EndDate);
rov.Costbearer = c2s.CostBearer.Organisation.Name;
}
}
}
}
}
private XtraReport CreateServicesOverviewReportForRo2(ServicesOverviewRO ro, String reportId)
{ {
NachweisTherapieeinheiten report = new NachweisTherapieeinheiten(); NachweisTherapieeinheiten report = new NachweisTherapieeinheiten();
report.SetReportDataSource(ro); report.SetReportDataSource(ro);
return report; return report;
} }
} }
} }

View File

@@ -21,6 +21,7 @@ namespace BeWo.HphBersenbrueckAtz
public void SetReportDataSource(ServicesOverviewRO pRO) public void SetReportDataSource(ServicesOverviewRO pRO)
{ {
//SetVarFieldValues(pRO); //SetVarFieldValues(pRO);
double gesamt = 0; double gesamt = 0;
bool isFls = false; bool isFls = false;
@@ -104,6 +105,7 @@ namespace BeWo.HphBersenbrueckAtz
this.bindingSource1.DataSource = pRO; this.bindingSource1.DataSource = pRO;
} }
private void SetzeStandort(ServicesOverviewRO ro) private void SetzeStandort(ServicesOverviewRO ro)
{ {
if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0) if (ro.CostBearer2SupportConceptList != null && ro.CostBearer2SupportConceptList.Count > 0)