diff --git a/ReportImp/ChristopherusHaus/CustomReportCreator.cs b/ReportImp/ChristopherusHaus/CustomReportCreator.cs index 3cdb6d762..724c0d902 100644 --- a/ReportImp/ChristopherusHaus/CustomReportCreator.cs +++ b/ReportImp/ChristopherusHaus/CustomReportCreator.cs @@ -45,6 +45,7 @@ namespace ChristopherusHaus DateTime.TryParse(queryRo.Rows[0].Field2.ToString(), out end); } long? customerOid = null; + string zad = ""; if (queryRo.Rows[0].Field3.ToString() == "0") { var masterReport = new LwlPruefliste(); @@ -52,7 +53,8 @@ namespace ChristopherusHaus var customerListOrd = customerList.OrderBy(c => c.Person.LastNameFirstName).ToList(); foreach (var c in customerListOrd) { - var ro = LwlPrueflisteRO.Create(start, end, "9011053", c.Oid); + zad = GetCustomerTeam(c); + var ro = LwlPrueflisteRO.Create(start, end, zad, c.Oid, "LWL (alt)"); if (ro.ServiceRecords != null && ro.ServiceRecords.Count > 0) { try @@ -77,7 +79,9 @@ namespace ChristopherusHaus { customerOid = oidOut; } - var ro = LwlPrueflisteRO.Create(start, end, "9011053", customerOid); + var c = DAOFactory.GenericDAO.LoadByID(customerOid.Value); + zad = GetCustomerTeam(c); + var ro = LwlPrueflisteRO.Create(start, end, zad, c.Oid, "LWL (alt)"); liste.SetReportDataSource(ro); return liste; } @@ -85,6 +89,25 @@ namespace ChristopherusHaus return liste; } + private string GetCustomerTeam(Customer c) + { + string zad = ""; + var team = c.Team2CustomerList.FirstOrDefault(); + if (team.Team.Name.ToLower().Contains("bochum")) + { + zad = "60-9011096.1"; + } + else if (team.Team.Name.ToLower().Contains("dortmund") || team.Team.Name.ToLower().Contains("königsmühle")) + { + zad = "60-9011063.1"; + } + else if (team.Team.Name.ToLower().Contains("witten")) + { + zad = "60-9011071.1"; + } + return zad; + } + public override XtraReport CreateSettlementReport(string dcId, long? invoiceBaseOid) { long result;