MH: HPH Änderungen
This commit is contained in:
@@ -165,6 +165,78 @@ namespace BeWo.HphBersenbrueckAtz
|
||||
|
||||
}
|
||||
|
||||
public override XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
|
||||
{
|
||||
DateTime startDate = new DateTime(year, month, 1);
|
||||
|
||||
if (startDay == 1 && endDay == DateTime.DaysInMonth(year, month))
|
||||
{
|
||||
var endDate = startDate.AddMonths(3).AddDays(-1);
|
||||
|
||||
month = startDate.Month;
|
||||
year = startDate.Year;
|
||||
startDay = startDate.Day;
|
||||
|
||||
endDay = (int)endDate.Subtract(startDate).TotalDays;
|
||||
|
||||
endDay += startDay;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
|
||||
foreach (var coid in customerOids)
|
||||
{
|
||||
var ro = ServicesOverviewRO.Create(coid, month, year, true, orgaOid ?? 0, empOid ?? 0, startDay, endDay, serviceCategoryOid);
|
||||
|
||||
if (ro != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
}
|
||||
}
|
||||
|
||||
var sortedList = roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
|
||||
|
||||
if (sortedList.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid.HasValue && orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid.Value);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
|
||||
var rootReport = CreateReportForServicesOverviewRo(sortedList[0], reportId);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
|
||||
|
||||
for (int i = 1; i < sortedList.Count; i++)
|
||||
{
|
||||
var lNext = CreateReportForServicesOverviewRo(sortedList[i], reportId);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
lNext.CreateDocument();
|
||||
}
|
||||
|
||||
rootReport.Pages.AddRange(lNext.Pages);
|
||||
}
|
||||
|
||||
return rootReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
|
||||
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, String reportId)
|
||||
{
|
||||
NachweisTherapieeinheiten report = new NachweisTherapieeinheiten();
|
||||
|
||||
Reference in New Issue
Block a user