Merge branch 'master' of ssh://float.beyondsoft.de/git/beyondSoft/BeWo

This commit is contained in:
Christian
2020-09-02 18:20:36 +02:00
20 changed files with 485 additions and 74 deletions

View File

@@ -94,6 +94,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Lib\Blacklight.Wpf.Controls.dll</HintPath>
</Reference>
<Reference Include="CsvHelper, Version=15.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\packages\CsvHelper.15.0.5\lib\net45\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Charts.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Pdf.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
@@ -137,6 +140,7 @@
<Reference Include="DevExpress.XtraScheduler.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraScheduler.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraScheduler.v17.1.Reporting, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -160,12 +164,21 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Printing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.ServiceModel">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Data.DataSetExtensions">
@@ -994,7 +1007,7 @@
<Compile Include="View\Navigation\Sorter\UserSorter.cs" />
<Compile Include="View\Report\Kilometerauswertung\KilometerauslastungsView.xaml.cs">
<DependentUpon>KilometerauslastungsView.xaml</DependentUpon>
</Compile>
</Compile>
<Compile Include="View\Report\Rating\RatingReportView.xaml.cs">
<DependentUpon>RatingReportView.xaml</DependentUpon>
</Compile>

View File

@@ -596,7 +596,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<UseIIS>True</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8808</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>

View File

@@ -60,7 +60,7 @@ namespace BeWoPlanerMobil.Controllers
Tenant = MobileSessionFacade.Tenant
};
OperationsService.InsertBeWoMobilBrowserInfo(brauserInfoDC);
//OperationsService.InsertBeWoMobilBrowserInfo(brauserInfoDC);
AbstractModel.TimeOfLastAction = $"{DateTime.Now:yyyy-MM-dd}T{DateTime.Now:HH:mm:ss}";

View File

@@ -424,12 +424,6 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}</Project>
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Mappings\Parameter.hbm.xml" />
</ItemGroup>
@@ -776,6 +770,12 @@
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}</Project>
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -25,6 +25,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -240,7 +241,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Data\Data.csproj">
<Project>{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}</Project>
<Project>{b0d73e3d-4ae7-4024-93a6-db1f46d7ccee}</Project>
<Name>Data</Name>
</ProjectReference>
<ProjectReference Include="..\ReportService\ReportingService.csproj">
@@ -248,15 +249,15 @@
<Name>ReportingService</Name>
</ProjectReference>
<ProjectReference Include="..\Report\Report.csproj">
<Project>{40D8B312-EA64-49E3-A31A-5E57ED4D5654}</Project>
<Project>{40d8b312-ea64-49e3-a31a-5e57ed4d5654}</Project>
<Name>Report</Name>
</ProjectReference>
<ProjectReference Include="..\Service\Service.csproj">
<Project>{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}</Project>
<Project>{094331c3-ecee-4c89-bbfd-4c9ded89f0ef}</Project>
<Name>Service</Name>
</ProjectReference>
<ProjectReference Include="..\Shared\Shared.csproj">
<Project>{2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}</Project>
<Project>{2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}</Project>
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>

View File

@@ -4,6 +4,12 @@
<NameOfLastUsedPublishProfile>BeWo2.0</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<ProjectExtensions>
<VisualStudio>

View File

@@ -0,0 +1,18 @@
INSERT INTO `query`(`Tid`, `Type`, `Title`, `SQL`, `Notice`, `InsTs`, `InsUser`, `UdpUser`, `Version`, `IsActive`, `SystemEntryID`, `UserGroupOids`, `ReportTypeName`, `FileName`, `ExportTitle`)
VALUES
(24, 0, 'Qlik-Report Mitarbeiter', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Klienten', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Zeiterfassung', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Budgetausschöpfung', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Bewilligungszeitraum', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Mitarbeiterabwesenheiten', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Mitarbeiterqualifikationen', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Teams', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen'),
(24, 0, 'Qlik-Report Team-Mitarbeiter-Relationen', '', 'direct', NULL, NULL, NULL, 1, 1, NULL, 1, NULL, NULL, 'Datei erstellen')
;
INSERT INTO parameter(queryoid, tid, name, type) VALUES
((SELECT Oid FROM query WHERE Title = 'Qlik-Report Mitarbeiter'), 25, 'Von_Bis', 5),
((SELECT Oid FROM query WHERE Title = 'Qlik-Report Zeiterfassung'), 25, 'Von_Bis', 5),
((SELECT Oid FROM query WHERE Title = 'Qlik-Report Mitarbeiterabwesenheiten'), 25, 'Von_Bis', 5)
;

View File

@@ -1,16 +1,5 @@
using System;
using System.Linq;
using BS.Shared;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BeWo.Data.Entities;
using BeWo.Data.Access;
using System.Collections.Generic;
using BS.Shared.Core;
using BS.Shared.Services;
using BS.Shared.DataContracts;
using BeWo.Service.DCEntityMapper;
using BeWo.Service.ServiceImplementations;
namespace BeWo.Report.DefaultReports
{

View File

@@ -8,7 +8,6 @@ using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using DevExpress.Entity.Model;
namespace BeWo.Report.ReportObjects

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Web;
using System.Windows.Forms.VisualStyles;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.DCEntityMapper;
@@ -18,7 +14,6 @@ using BeWo.Service.Plugins;
using BS.Shared.Core;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using DevExpress.Data.Helpers;
namespace BeWo.Report.ReportObjects
{

View File

@@ -121,15 +121,7 @@ namespace BeWo.Report.ReportObjects
if (add)
{
ro.EmployeeDetailList.Add(empDetail);
empDetail.Teams = team == null
? DAOFactory.SearchDAO.FindTeamsOfEmployee(emp.Oid.Value)
: new List<Team> {team};
empDetail.Employee = emp;
empDetail.LastName = emp.Person.LastName;
empDetail.FirstName = emp.Person.FirstName;
empDetail.FullName = String.Format("{0}, {1}", empDetail.LastName, empDetail.FirstName);
ro.EmployeeDetailList.Add(CreateEmployeeDetail(emp, team));
}
if (!empOidDict.ContainsKey(emp.Oid.Value))
@@ -174,7 +166,7 @@ namespace BeWo.Report.ReportObjects
return ro;
}
private static Contract GetNextValidContractForDate(DateTime dt, Employee emp)
private static Contract GetNextValidContractForDate(DateTime dt, Employee emp)
{
Contract contractNextToStartDate = emp.GetValidContractForDate(dt);
@@ -409,5 +401,19 @@ namespace BeWo.Report.ReportObjects
public IList<DateTimeSpan> ZusammenhaengendeZeitraeume { get; set; }
}
public static EmployeeDetail CreateEmployeeDetail(Employee employee, Team team)
{
var employeeDetail = new EmployeeDetail
{
Teams = team == null ? DAOFactory.SearchDAO.FindTeamsOfEmployee(employee.Oid.Value) : new List<Team>(),
Employee = employee,
LastName = employee.Person.LastName,
FirstName = employee.Person.FirstName,
FullName = $"{employee.Person.LastName}, {employee.Person.FirstName}"
};
return employeeDetail;
}
}
}

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
@@ -13,8 +12,6 @@ using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Services;
using BS.Shared.Extensions;
namespace BeWo.Report.ReportObjects
{

View File

@@ -1,16 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using BeWo.Report;
using BeWo.Data.Entities;
using BeWo.Data.Access;
using BeWo.Service.Configuration;
using BeWo.Service.ServiceImplementations;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.Extensions;
using DevExpress.XtraCharts.Native;
namespace BeWo.Report.ReportObjects

View File

@@ -0,0 +1,24 @@
using BeWo.Service.Plugins;
using BS.Shared.DataContracts;
namespace demo_reports.Export
{
public class CustomDataExporter : DataExporter
{
public override string CreateExportString(string pFileID, string[] pHeaderCaption, string[][] pContent)
{
// TODO: anpassen -> Contains("Qlik")
//if(pHeaderCaption != null && pHeaderCaption.Length > 0 && pHeaderCaption[0].Contains("FibuNet"))
//{
// return QlikCsvExporter.CreateExportString(pHeaderCaption, pContent);
//}
return base.CreateExportString(pFileID, pHeaderCaption, pContent);
}
public override QueryDC CreateQuery(QueryDC query)
{
return QlikCsvExporter.CreateQuery(query);
}
}
}

View File

@@ -0,0 +1,348 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report.ReportObjects;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using CsvHelper;
namespace demo_reports.Export
{
public class QlikCsvExporter
{
public static QueryDC CreateQuery(QueryDC query)
{
if(query != null)
{
var dateTimeSpan = new DateTimeSpan(new DateTime(1900, 1, 1), DateTime.Today);
if(query.Parameter.Any() && query.Parameter[0].Value is DateTimeSpan span)
{
dateTimeSpan = span;
}
switch(query.Title)
{
case "Qlik-Report Mitarbeiter":
query.QueryResult = GetEmployeeCSV(dateTimeSpan);
break;
case "Qlik-Report Klienten":
query.QueryResult = GetCustomerCSV();
break;
case "Qlik-Report Teams":
query.QueryResult = CreateTeamsCSV();
break;
case "Qlik-Report Team-Mitarbeiter-Relationen":
query.QueryResult = CreateTeamEmployeeRelationCSV();
break;
case "Qlik-Report Zeiterfassung":
query.QueryResult = GetServiceRecordCSV(dateTimeSpan);
break;
case "Qlik-Report Budgetausschöpfung":
query.QueryResult = GetBudgetCSV();
break;
case "Qlik-Report Mitarbeiterabwesenheiten":
query.QueryResult = GetEmployeeAbsenceTimes(dateTimeSpan);
break;
case "Qlik-Report Mitarbeiterqualifikationen":
query.QueryResult = GetEmployeeeQualifications();
break;
}
query.FileName = $"{query.Title}.csv";
}
return query;
}
private static string CreateTeamEmployeeRelationCSV()
{
var resultList = new List<object>();
var teams = DAOFactory.GenericDAO.GetAllActive<Team>();
teams.DoForEach(team => {
team.MemberList.DoForEach(member =>
{
resultList.Add(new
{
TeamId = team.Oid,
MitarbeiterId = member.Oid,
IstLeitung = team.Leader.Equals(member)
});
});
});
return CreateCsvString(resultList);
}
private static string CreateTeamsCSV()
{
var resultList = new List<object>();
var teams = DAOFactory.GenericDAO.GetAllActive<Team>();
teams.DoForEach(team => {
resultList.Add(new
{
TeamId = team.Oid,
Teamname = team.Name,
});
});
return CreateCsvString(resultList);
}
private static string GetEmployeeeQualifications()
{
var resultList = new List<object>();
var employees = DAOFactory.GenericDAO.GetAllActive<Employee>();
employees.DoForEach(employee =>
{
employee.ValueList.Where(w => w.Entry.Type.Equals(ValueListEntryType.StaffQualificationsType)).DoForEach(valueListEntry2Object =>
{
resultList.Add(new
{
MitarbeiterId = employee.Oid,
Qualifikation = valueListEntry2Object.Entry.Value
});
});
});
return CreateCsvString(resultList);
}
private static string GetEmployeeAbsenceTimes(DateTimeSpan dateTimeSpan)
{
var resultList = new List<object>();
var absenceTimes = DAOFactory.SearchDAO.FindAbsenceTimes(dateTimeSpan.StartDate, dateTimeSpan.EndDate).Where(absenceTime => absenceTime.AbsenceReason.Description.ToLower().Contains("krank"));
absenceTimes.DoForEach(absenceTime =>
{
if(absenceTime.EmployeeOid.HasValue)
{
resultList.Add(new
{
MitarbeiterId = absenceTime.EmployeeOid,
Beginn = $"{absenceTime.Start:yyyy-MM-dd}",
Ende = $"{absenceTime.End:yyyy-MM-dd}",
Abwesenheitskategorie = absenceTime.AbsenceReason.Description
});
}
});
return CreateCsvString(resultList);
}
private static string GetEmployeeCSV(DateTimeSpan dateTimeSpan)
{
var resultList = new List<object>();
var employee2Teams = new Dictionary<long, List<Team>>();
var teams = DAOFactory.GenericDAO.GetAllActive<Team>();
var mitarbeiterstundenkontoBerechnung = new MitarbeiterstundenkontoBerechnung();
var employees = DAOFactory.GenericDAO.GetAllActive<Employee>();
employees.DoForEach(employee =>
{
teams.DoForEach(team =>
{
if(team.MemberList.Contains(employee) && employee.Oid.HasValue)
{
employee2Teams.AddOrUpdateValueInDictionary(employee.Oid.Value, new List<Team> { team });
}
});
});
var employeeOids = employees.Where(employee => employee.Oid.HasValue).Select(employee => employee.Oid.Value).ToList();
employees.DoForEach(employee =>
{
try
{
var teamOids = teams.Where(w => w.Leader.Oid == employee.Oid || w.MemberList.Any(a => a.Oid == employee.Oid)).ToList().Select(s => s.Oid.Value).ToList();
var flsIstSum = 0m;
var flsSollSum = 0m;
var gesamtIstSum = 0m;
var stundenSollSum = 0m;
var counter = 0;
var start = dateTimeSpan.StartDate;
var end = dateTimeSpan.EndDate;
var currentDate = start.GetFirstOfMonth();
while(currentDate <= end)
{
var reportObject = MitarbeiterstundenkontoRO.Create(employee.Oid, teamOids, currentDate, currentDate.AddMonths(1), employeeOids);
mitarbeiterstundenkontoBerechnung.CreateReport(reportObject);
var employeeDetail = reportObject.EmployeeDetailList.FirstOrDefault(empDetail => empDetail.Employee.Equals(employee));
if(employeeDetail != null)
{
flsIstSum += employeeDetail.FlsIst;
flsSollSum += employeeDetail.FlsSoll;
gesamtIstSum += employeeDetail.StundenGesamtIst;
stundenSollSum += employeeDetail.StundenSollMax;
}
counter++;
currentDate = currentDate.AddMonths(1);
}
var flsIst = flsIstSum / counter;
var flsSoll = flsSollSum / counter;
var gesamtIst = gesamtIstSum / counter;
var stundenSoll = stundenSollSum / counter;
resultList.Add(new
{
MitarbeiterId = employee.Oid,
Nachname = employee.Person.LastName,
Vorname = employee.Person.FirstName,
FLSIst = flsIst,
FLSSoll = flsSoll,
GesamtIst = gesamtIst,
StundenSoll = stundenSoll,
IstFachkraft = employee.IsQualified ?? false
});
}
catch(Exception exception)
{
Console.WriteLine(exception);
throw;
}
});
var stringWriter = new StringWriter();
using(var csv = new CsvWriter(stringWriter, CultureInfo.InvariantCulture))
{
csv.WriteRecords(resultList);
}
return stringWriter.ToString();
}
private static string GetCustomerCSV()
{
var customers = DAOFactory.GenericDAO.GetAllActive<Customer>();
var resultList = new List<object>();
customers.DoForEach(customer =>
{
resultList.Add(new
{
KlientenId = customer.Oid,
Nachname = customer.Person.LastName,
Vorname = customer.Person.FirstName
});
});
return CreateCsvString(resultList);
}
private static string GetServiceRecordCSV(DateTimeSpan dateTimeSpan)
{
var serviceRecords = DAOFactory.SearchDAO.FindServiceRecordsInSpan(dateTimeSpan, null);
var resultList = new List<object>();
serviceRecords.DoForEach(serviceRecord =>
{
resultList.Add(
new
{
MitarbeiterId = serviceRecord.EmployeeOid,
KlientenId = serviceRecord.CustomerOid,
ZeiterfassungseintragId = serviceRecord.Oid,
Beginn = $"{serviceRecord.Start:yyyy-MM-dd HH:mm}",
Ende = $"{serviceRecord.End:yyyy-MM-dd HH:mm}",
GerundeteDauer = serviceRecord.RoundedDuration,
GerundeteGruppendauer = serviceRecord.GroupRoundedDuration,
GruppenId = serviceRecord.GroupOid,
Kategorie = serviceRecord.ServiceDescription.Name,
KostentraegerZuHilfeplanId = serviceRecord.CostBearer2SupportConceptOid
});
});
return CreateCsvString(resultList);
}
private static string GetBudgetCSV()
{
var resultList = new List<object>();
// KostentraegerZuHilfeplanId (zum Verknüpfen mit der Zeiterfassung), KlientenId, Von, Bis FLSSoll, FLSIst (kann man mit den ServiceRecords berechnen), Intervall, IstAbgeschlossen (archiviert oder in der Vergangenheit)
var costBearer2SupportConcepts = DAOFactory.GenericDAO.GetAll<CostBearer2SupportConcept>();
costBearer2SupportConcepts.DoForEach(cb2Sc =>
{
var approvedSpan = cb2Sc.GetApprovedSpan();
if(approvedSpan != null)
{
var istAbgeschlossen = approvedSpan.EndDate < DateTime.Now || cb2Sc.IsActive != ActivationTypeId.Active;
cb2Sc.ApprovalPeriodList.DoForEach(period =>
{
var start = period.StartDate;
var end = period.EndDate;
var customerId = cb2Sc.SupportConcept.Customer.Oid;
var interval = period.ApprovedBEInterval != null ? EnumTranslations.SupportConceptApprovalInterval2Translations[(SupportConceptApprovalInterval) period.ApprovedBEInterval] : null;
var total = period.ApprovedBETotal;
var perInterval = period.ApprovedBEPerInterval;
resultList.Add(new
{
KostentraegerZuHilfeplanId = cb2Sc.Oid,
KlientenId = customerId,
Beginn = $"{start:yyyy-MM-dd}",
Ende = $"{end:yyyy-MM-dd}",
Intervall = interval,
FLSGesamt = total,
FLSProIntervall = perInterval ?? 0,
IstAbgeschlossen = istAbgeschlossen
});
});
}
});
return CreateCsvString(resultList);
}
private static string CreateCsvString(List<object> dataList)
{
if(dataList == null)
{
return null;
}
var stringWriter = new StringWriter();
using(var csv = new CsvWriter(stringWriter, CultureInfo.InvariantCulture))
{
csv.WriteRecords(dataList);
}
return stringWriter.ToString();
}
}
}

View File

@@ -71,6 +71,9 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CsvHelper, Version=15.0.0.0, Culture=neutral, PublicKeyToken=8c4959082be5c823, processorArchitecture=MSIL">
<HintPath>..\..\packages\CsvHelper.15.0.5\lib\net45\CsvHelper.dll</HintPath>
</Reference>
<Reference Include="DevExpress.Pdf.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Printing.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.Data.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
@@ -89,11 +92,21 @@
<Reference Include="DevExpress.RichEdit.v17.1.Core, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.RichEdit.v17.1.Export, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraReports.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
@@ -106,6 +119,8 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Export\QlikCsvExporter.cs" />
<Compile Include="Export\CustomDataExporter.cs" />
<Compile Include="InvoiceCustomerReport.cs">
<SubType>Component</SubType>
</Compile>
@@ -144,24 +159,6 @@
<DependentUpon>SettlementReport2.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Data\Data.csproj">
<Project>{B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}</Project>
<Name>Data</Name>
</ProjectReference>
<ProjectReference Include="..\..\Report\Report.csproj">
<Project>{40D8B312-EA64-49E3-A31A-5E57ED4D5654}</Project>
<Name>Report</Name>
</ProjectReference>
<ProjectReference Include="..\..\Service\Service.csproj">
<Project>{094331C3-ECEE-4C89-BBFD-4C9DED89F0EF}</Project>
<Name>Service</Name>
</ProjectReference>
<ProjectReference Include="..\..\Shared\Shared.csproj">
<Project>{2F50B83D-A3F0-4EC4-979A-3F9B7E3D8ED4}</Project>
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="InvoiceCustomerReport.resx">
<DependentUpon>InvoiceCustomerReport.cs</DependentUpon>
@@ -205,6 +202,28 @@
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Data\Data.csproj">
<Project>{b0d73e3d-4ae7-4024-93a6-db1f46d7ccee}</Project>
<Name>Data</Name>
</ProjectReference>
<ProjectReference Include="..\..\Report\Report.csproj">
<Project>{40d8b312-ea64-49e3-a31a-5e57ed4d5654}</Project>
<Name>Report</Name>
</ProjectReference>
<ProjectReference Include="..\..\Service\Service.csproj">
<Project>{094331c3-ecee-4c89-bbfd-4c9ded89f0ef}</Project>
<Name>Service</Name>
</ProjectReference>
<ProjectReference Include="..\..\Shared\Shared.csproj">
<Project>{2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}</Project>
<Name>Shared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -19,7 +19,7 @@ namespace BeWo.Service.Plugins
#if DEBUG
var t = "demo";
t = "irgendwaswasesnichtgibt";
//t = "irgendwaswasesnichtgibt";
//t = "5473568546"; //Interner Chat
//t = "2356097460"; // Lebenshilfe Würzburg
//t = "1234567890"; // Präsentationsdatenbank
@@ -269,7 +269,6 @@ namespace BeWo.Service.Plugins
public static T FindClass<T>() where T : new()
{
var t = FindClass<T>(null, null);
if (t == null)
{
@@ -287,6 +286,8 @@ namespace BeWo.Service.Plugins
{
Type[] lAllTypes = null;
var type = typeof(T);
if (Tenant != null)
{
if (File.Exists(CustomerPluginPath()))

View File

@@ -896,7 +896,7 @@ namespace BeWo.Service.ServiceImplementations
return token;
}
public FileAttachmentDC GetFileAttachment(long oid)
{
PluginLoader.FindClass<IpAddressChecker>().CheckIpAddress();

View File

@@ -543,5 +543,10 @@ namespace BS.Shared.Extensions
return interval1.IntersectsWithExcludingBounds(interval2);
}
public static DateTime GetFirstOfMonth(this DateTime dateTime)
{
return new DateTime(dateTime.Year, dateTime.Month, 1);
}
}
}