BeWoDarmstadt Zeitverteilung
This commit is contained in:
85
ReportImp/BeWoDarmstadt/BeWoDarmstadt.csproj
Normal file
85
ReportImp/BeWoDarmstadt/BeWoDarmstadt.csproj
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{5945C51C-8CAB-4DAF-8077-75B74EC3160A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BeWoDarmstadt</RootNamespace>
|
||||
<AssemblyName>4748304562_Reports</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Host\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Host\bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DevExpress.Data.v17.1, 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.Utils.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraPrinting.v17.1, 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="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Zeitzuschlagsbeleg.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Zeitzuschlagsbeleg.Designer.cs">
|
||||
<DependentUpon>Zeitzuschlagsbeleg.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="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Zeitzuschlagsbeleg.resx">
|
||||
<DependentUpon>Zeitzuschlagsbeleg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
123
ReportImp/BeWoDarmstadt/CustomReportCreator.cs
Normal file
123
ReportImp/BeWoDarmstadt/CustomReportCreator.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using BeWo.Data;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoDarmstadt
|
||||
{
|
||||
public class CustomReportCreator : DefaultReportCreator
|
||||
{
|
||||
public override XtraReport CreateQueryReport(long queryOid, string queryReportId)
|
||||
{
|
||||
|
||||
if (queryOid == 200)
|
||||
{
|
||||
return CreateZeitzuschlagsbeleg(queryOid, queryReportId);
|
||||
}
|
||||
return base.CreateQueryReport(queryOid, queryReportId);
|
||||
|
||||
}
|
||||
|
||||
private XtraReport CreateZeitzuschlagsbeleg(long queryOid, string queryReportId)
|
||||
{
|
||||
var query = DAOFactory.GenericDAO.LoadByID<Query>(queryOid);
|
||||
|
||||
if (query == null)
|
||||
return new XtraReport();
|
||||
|
||||
var path = Path.Combine(TempPath, queryReportId + ".xml");
|
||||
var table = Utils.XMLDeserialize<DataTable>(path);
|
||||
var qro = QueryRO.Create(query, table);
|
||||
|
||||
if (qro.Rows.Count > 0)
|
||||
{
|
||||
long? employeeOid = null;
|
||||
if (qro.Rows[0].Field2 != null && qro.Rows[0].Field2.ToString() != "0")
|
||||
employeeOid = Int64.Parse(qro.Rows[0].Field2.ToString());
|
||||
|
||||
DateTime monat = DateTime.Parse(qro.Rows[0].Field1.ToString());
|
||||
DateTimeSpan span = new DateTimeSpan();
|
||||
span.StartDateTime = monat;
|
||||
span.EndDateTime = monat.AddMonths(1).AddTicks(-1);
|
||||
|
||||
//IList<long> teamOids = null;
|
||||
|
||||
//if (!employeeOid.HasValue && queryOid == 500)
|
||||
//{
|
||||
// //Suche Mitarbeiter des Teams
|
||||
// ApplicationUser loggedInUser;
|
||||
|
||||
// if (LoggedInUserOperationContextExt.Current != null &&
|
||||
// LoggedInUserOperationContextExt.Current.User != null)
|
||||
// {
|
||||
// loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// loggedInUser = SessionFacade.LoggedInUser;
|
||||
// }
|
||||
|
||||
// if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
// {
|
||||
// var teams = DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value);
|
||||
// teamOids = teams.Select(t => t.Oid.Value).ToList();
|
||||
// }
|
||||
//}
|
||||
|
||||
MitarbeiterstundenkontoRO ro = MitarbeiterstundenkontoRO.Create(employeeOid, null, monat, monat.AddMonths(1), null);
|
||||
|
||||
var msb = new MitarbeiterstundenkontoBerechnung();
|
||||
msb.CreateReport(ro);
|
||||
|
||||
|
||||
//IEnumerable<ServiceRecord> records = null;
|
||||
|
||||
//if (employeeOid.HasValue && employeeOid.Value > 0)
|
||||
//{
|
||||
// records = DAOFactory.SearchDAO.FindEmployeeServiceRecords(employeeOid, span, null, null);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// records = DAOFactory.SearchDAO.FindServiceRecordsInSpan(span, null);
|
||||
// }
|
||||
|
||||
XtraReport allReports = null;
|
||||
|
||||
|
||||
foreach (var ed in ro.EmployeeDetailList)
|
||||
{
|
||||
ed.StundenGesamtIst += ed.Custom10;
|
||||
|
||||
Zeitzuschlagsbeleg beleg = new Zeitzuschlagsbeleg();
|
||||
|
||||
beleg.SetReportDataSource(ro.ReportStartDate, ed);
|
||||
|
||||
beleg.CreateDocument();
|
||||
if (allReports == null)
|
||||
allReports = beleg;
|
||||
else
|
||||
allReports.Pages.AddRange(beleg.Pages);
|
||||
}
|
||||
|
||||
if (allReports != null)
|
||||
{
|
||||
return allReports;
|
||||
}
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
ReportImp/BeWoDarmstadt/Properties/AssemblyInfo.cs
Normal file
36
ReportImp/BeWoDarmstadt/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Allgemeine Informationen über eine Assembly werden über die folgenden
|
||||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
|
||||
// die einer Assembly zugeordnet sind.
|
||||
[assembly: AssemblyTitle("KundeXyz")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("KundeXyz")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
|
||||
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
|
||||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
|
||||
[assembly: Guid("c1fed668-adb9-47e0-b589-1389618e1b6e")]
|
||||
|
||||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
|
||||
//
|
||||
// Hauptversion
|
||||
// Nebenversion
|
||||
// Buildnummer
|
||||
// Revision
|
||||
//
|
||||
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
|
||||
// indem Sie "*" wie unten gezeigt eingeben:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
1
ReportImp/BeWoDarmstadt/Properties/licenses.licx
Normal file
1
ReportImp/BeWoDarmstadt/Properties/licenses.licx
Normal file
@@ -0,0 +1 @@
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
12993
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.Designer.cs
generated
Normal file
12993
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
472
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.cs
Normal file
472
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.cs
Normal file
@@ -0,0 +1,472 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BS.Shared.Core;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Report;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.Plugins;
|
||||
using DevExpress.Charts.Native;
|
||||
|
||||
namespace BeWoDarmstadt
|
||||
{
|
||||
public partial class Zeitzuschlagsbeleg : DevExpress.XtraReports.UI.XtraReport
|
||||
{
|
||||
private VacationService _vs = null;
|
||||
|
||||
private Dictionary<int, double> samstag2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> sonntag2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> feiertag2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> heiligSil2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> OsterSa2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> nacht2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> nachtSa2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> nachtSo2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> nachtFe2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> direkteBetr2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> indirekteBetr2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> vorArbeiten2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> flsX2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> flsY2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> fobiUrKr2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> team2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> subervis2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> gremArbeit2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> div2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> fahrzeit2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> qz2Minuten = new Dictionary<int, double>();
|
||||
private Dictionary<int, double> leitung2Minuten = new Dictionary<int, double>();
|
||||
|
||||
|
||||
public Zeitzuschlagsbeleg()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetReportDataSource(DateTime monat, MitarbeiterstundenkontoRO.EmployeeDetail ed)
|
||||
{
|
||||
ed.FirstName = "";
|
||||
|
||||
if (ed.Custom9 > 0 || ed.Custom8 > 0)
|
||||
{
|
||||
ed.FirstName = String.Format("{0:0.##} / {1:0.##}", ed.Custom9, ed.Custom8);
|
||||
}
|
||||
|
||||
_vs = PluginLoader.FindClass<VacationService>();
|
||||
InitTable(monat);
|
||||
FillTableData(monat, ed);
|
||||
|
||||
lblZeitraum.Text = String.Format("{0:MMMM yyyy}", monat);
|
||||
lblStelle.Text = String.Format("{0:0.00}", ed.SollProWoche/40);
|
||||
|
||||
this.bindingSource1.DataSource = ed;
|
||||
}
|
||||
|
||||
private void FillTableData(DateTime monat, MitarbeiterstundenkontoRO.EmployeeDetail ed)
|
||||
{
|
||||
decimal kmTotal = 0;
|
||||
decimal rufTotal = 0;
|
||||
decimal notdienstTotal = 0;
|
||||
|
||||
if (ed.ServiceRecordsInSelectedTimeSpan != null)
|
||||
{
|
||||
foreach (var sr in ed.ServiceRecordsInSelectedTimeSpan)
|
||||
{
|
||||
if (sr.DistanceInMeter.HasValue)
|
||||
{
|
||||
kmTotal += sr.DistanceInMeter.Value;
|
||||
}
|
||||
AddValueToTableZuschlag(sr);
|
||||
AddValueToTableLeistungen(sr);
|
||||
}
|
||||
}
|
||||
|
||||
BerechneGesamtsummen();
|
||||
lblGesamtKm.Text = String.Format("{0:0.00} km", kmTotal);
|
||||
lblRufGesamt.Text = String.Format("{0:0.00} Std.", rufTotal / 60);
|
||||
lblStelle.Text = String.Format("{0:0.00} Std.", notdienstTotal / 60);
|
||||
}
|
||||
|
||||
private void BerechneGesamtsummen()
|
||||
{
|
||||
BerechneGesamtsumme(table1.Rows[1], samstag2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[2], sonntag2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[3], heiligSil2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[4], OsterSa2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[5], feiertag2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[6], nacht2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[7], nachtSa2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[8], nachtSo2Minuten);
|
||||
BerechneGesamtsumme(table1.Rows[9], nachtFe2Minuten);
|
||||
BerechneGesamtsumme(tableFLS.Rows[1], direkteBetr2Minuten);
|
||||
BerechneGesamtsumme(tableFLS.Rows[2], indirekteBetr2Minuten);
|
||||
BerechneGesamtsumme(tableFLS.Rows[3], vorArbeiten2Minuten);
|
||||
BerechneGesamtsumme(tableFLS.Rows[4], flsX2Minuten);
|
||||
BerechneGesamtsumme(tableFLS.Rows[5], flsY2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[1], fobiUrKr2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[2], team2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[3], subervis2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[4], gremArbeit2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[5], div2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[6], fahrzeit2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[7], qz2Minuten);
|
||||
BerechneGesamtsumme(tableRahmenzeit.Rows[8], leitung2Minuten);
|
||||
}
|
||||
|
||||
private void BerechneGesamtsumme(XRTableRow row, Dictionary<int, double> dict)
|
||||
{
|
||||
double gesamt = 0;
|
||||
for (int i = 1; i <= 31; i++)
|
||||
{
|
||||
if (dict.ContainsKey(i))
|
||||
{
|
||||
gesamt += dict[i];
|
||||
}
|
||||
}
|
||||
row.Cells[33].Text = String.Format("{0:0.00}", gesamt / 60);
|
||||
}
|
||||
|
||||
|
||||
private void InitTable(DateTime monat)
|
||||
{
|
||||
int rowIdx = 0;
|
||||
|
||||
foreach (XRTableRow row in table1.Rows)
|
||||
{
|
||||
if (rowIdx > 0)
|
||||
{
|
||||
bool isHeaderRow = false;
|
||||
|
||||
int maxDays = 31;
|
||||
if (rowIdx == 1 || rowIdx == 4 || rowIdx == 7 || rowIdx == 10 || rowIdx == 13)
|
||||
{
|
||||
isHeaderRow = true;
|
||||
int days = DateTime.DaysInMonth(monat.Year, monat.Month);
|
||||
|
||||
maxDays = days;
|
||||
}
|
||||
|
||||
int cellIdx = 0;
|
||||
foreach (XRTableCell cell in row.Cells)
|
||||
{
|
||||
|
||||
if (cellIdx > 1)
|
||||
{
|
||||
cell.Text = "";
|
||||
if (cellIdx <= 32)
|
||||
{
|
||||
cell.Font = new Font(cell.Font.FontFamily, 7, FontStyle.Regular);
|
||||
}
|
||||
|
||||
bool setBackground = false;
|
||||
|
||||
setBackground = !isHeaderRow || (maxDays < 31 && cellIdx > maxDays + 1 && cellIdx <= 32);
|
||||
|
||||
if (setBackground)
|
||||
{
|
||||
cell.BackColor = Color.LightGray;
|
||||
}
|
||||
}
|
||||
cellIdx++;
|
||||
}
|
||||
}
|
||||
rowIdx++;
|
||||
}
|
||||
|
||||
foreach (XRTableRow row in tableFLS.Rows)
|
||||
{
|
||||
if (rowIdx > 0)
|
||||
{
|
||||
bool isHeaderRow = false;
|
||||
|
||||
int maxDays = 31;
|
||||
if (rowIdx == 1)
|
||||
{
|
||||
isHeaderRow = true;
|
||||
int days = DateTime.DaysInMonth(monat.Year, monat.Month);
|
||||
|
||||
maxDays = days;
|
||||
}
|
||||
}
|
||||
}
|
||||
rowIdx++;
|
||||
}
|
||||
|
||||
private void AddValueToTableZuschlag(ServiceRecord sr)
|
||||
{
|
||||
DateTime datum = sr.Start.Value;
|
||||
|
||||
if (datum.Second == 0)
|
||||
{
|
||||
var zs = BerechneZuschlag(sr);
|
||||
|
||||
if (zs.MinutenSamstag13_21 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenSamstag13_21, datum, table1.Rows[1], samstag2Minuten);
|
||||
}
|
||||
if (zs.MinutenSonntag6_21 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenSonntag6_21, datum, table1.Rows[2], sonntag2Minuten);
|
||||
}
|
||||
if (zs.MinutenHeiligabendSilvester14_21 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenHeiligabendSilvester14_21, datum, table1.Rows[3], heiligSil2Minuten);
|
||||
}
|
||||
if (zs.MinutenOsterPfSa12_24 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenOsterPfSa12_24, datum, table1.Rows[4], OsterSa2Minuten);
|
||||
}
|
||||
if (zs.MinutenFeiertag6_21 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenFeiertag6_21, datum, table1.Rows[5], feiertag2Minuten);
|
||||
}
|
||||
if (zs.MinutenNacht21_6 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenNacht21_6, datum, table1.Rows[6], nacht2Minuten);
|
||||
}
|
||||
if (zs.MinutenNachtSa21_6 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenNachtSa21_6, datum, table1.Rows[7], nachtSa2Minuten);
|
||||
}
|
||||
if (zs.MinutenNachtSo21_6 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenNachtSo21_6, datum, table1.Rows[8], nachtSo2Minuten);
|
||||
}
|
||||
if (zs.MinutenNachtFe21_6 > 0)
|
||||
{
|
||||
AddValueToCell(zs.MinutenNachtFe21_6, datum, table1.Rows[9], nachtFe2Minuten);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddValueToTableLeistungen(ServiceRecord sr)
|
||||
{
|
||||
DateTime datum = sr.Start.Value;
|
||||
var duration = GetDuration(sr);
|
||||
Zeitverteilung zv = new Zeitverteilung();
|
||||
zv.minutenLeistung = CheckUhrzeiten(datum, 0, 24, (double)duration);
|
||||
|
||||
if (datum.Second == 0)
|
||||
{
|
||||
if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("eingliederungshilfe") || sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("jugendhilfe")
|
||||
|| sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("fachleistungsstunde")) // FLS nach Debug entfernen
|
||||
{
|
||||
if (sr.ServiceDescription.Name.ToLower().StartsWith("direkte"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[1], direkteBetr2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().StartsWith("indirekte"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[2], indirekteBetr2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("nacharbeiten"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[3], vorArbeiten2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("(x)"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[4], flsX2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("(y)"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableFLS.Rows[5], flsY2Minuten);
|
||||
}
|
||||
else if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("rahmenzeit"))
|
||||
{
|
||||
if (sr.ServiceDescription.Name.ToLower().Contains("fortbildung"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[1], fobiUrKr2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().StartsWith("team"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[2], team2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("superv"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[3], subervis2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("gremien"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[4], gremArbeit2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("diverses"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[5], div2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("fahrtzeit"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[6], fahrzeit2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("qz"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[7], qz2Minuten);
|
||||
else if (sr.ServiceDescription.Name.ToLower().Contains("leitung"))
|
||||
AddValueToCell(zv.minutenLeistung, datum, tableRahmenzeit.Rows[8], leitung2Minuten);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AddValueToCell(double minuten, DateTime datum, XRTableRow row, Dictionary<int, double> dict)
|
||||
{
|
||||
XRTableCell cell = row.Cells[datum.Day + 1];
|
||||
|
||||
if (!dict.ContainsKey(datum.Day))
|
||||
{
|
||||
dict[datum.Day] = 0;
|
||||
}
|
||||
|
||||
dict[datum.Day] += minuten;
|
||||
|
||||
cell.Text = String.Format("{0:0.00}", dict[datum.Day] / 60);
|
||||
|
||||
}
|
||||
|
||||
private decimal GetDuration(ServiceRecord sr)
|
||||
{
|
||||
decimal duration = 0;
|
||||
|
||||
if (sr.GroupRoundedDuration.HasValue)
|
||||
{
|
||||
duration = sr.GroupRoundedDuration.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
duration = sr.RoundedDuration;
|
||||
}
|
||||
decimal p = sr.ServiceDescription.ServiceCategory.ProzentStundenkonto ?? 0;
|
||||
if (p != 100 && p > 0)
|
||||
{
|
||||
duration *= (p / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
p = sr.ServiceDescription.ProzentStundenkonto ?? 0;
|
||||
if (p != 100 && p > 0)
|
||||
{
|
||||
duration *= (p / 100);
|
||||
}
|
||||
}
|
||||
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// int test = 0;
|
||||
//}
|
||||
|
||||
return duration;
|
||||
}
|
||||
|
||||
public virtual Zeitverteilung BerechneZuschlag(ServiceRecord sr)
|
||||
{
|
||||
Zeitverteilung zv = new Zeitverteilung();
|
||||
DateTime datum = sr.Start.Value;
|
||||
var duration = GetDuration(sr);
|
||||
int nachtStart = 21;
|
||||
|
||||
if (duration > 0)
|
||||
{
|
||||
if (datum.Month == 12 && (datum.Day == 24 || datum.Day == 31))
|
||||
{
|
||||
zv.MinutenHeiligabendSilvester14_21 = CheckUhrzeiten(datum, 14, 21, (double) duration);
|
||||
zv.MinutenNachtFe21_6 = CheckUhrzeiten(datum, nachtStart, 6, (double)duration);
|
||||
|
||||
if (sr.Start.Value.DayOfWeek == DayOfWeek.Saturday)
|
||||
{
|
||||
zv.MinutenSamstag13_21 = CheckUhrzeiten(datum, 13, 21, (double) duration);
|
||||
}
|
||||
else if (sr.Start.Value.DayOfWeek == DayOfWeek.Sunday)
|
||||
{
|
||||
zv.MinutenSonntag6_21 = CheckUhrzeiten(datum, 6, 21, (double) duration);
|
||||
}
|
||||
|
||||
//nachtStart = 21;
|
||||
}
|
||||
else if (_vs.IstFeiertag(datum))
|
||||
{
|
||||
DateTime OsterSo = GetOsterSonntag(datum.Year);
|
||||
if (datum == OsterSo.AddDays(-1) || datum == OsterSo.AddDays(48))
|
||||
{
|
||||
zv.MinutenOsterPfSa12_24 = CheckUhrzeiten(datum, 12, 24, (double)duration);
|
||||
zv.MinutenNachtFe21_6 = CheckUhrzeiten(datum, 24, 6, (double)duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
zv.MinutenFeiertag6_21 = CheckUhrzeiten(datum, 6, 21, (double)duration);
|
||||
zv.MinutenNachtFe21_6 = CheckUhrzeiten(datum, nachtStart, 6, (double)duration);
|
||||
}
|
||||
}
|
||||
else if (sr.Start.Value.DayOfWeek == DayOfWeek.Sunday)
|
||||
{
|
||||
zv.MinutenSonntag6_21 = CheckUhrzeiten(datum, 6, 21, (double) duration);
|
||||
zv.MinutenNachtSo21_6 = CheckUhrzeiten(datum, nachtStart, 6, (double)duration);
|
||||
}
|
||||
else if (sr.Start.Value.DayOfWeek == DayOfWeek.Saturday)
|
||||
{
|
||||
zv.MinutenSamstag13_21 = CheckUhrzeiten(datum, 13, 21, (double) duration);
|
||||
zv.MinutenNachtFe21_6 = CheckUhrzeiten(datum, nachtStart, 6, (double)duration);
|
||||
}
|
||||
else
|
||||
zv.MinutenNacht21_6 = CheckUhrzeiten(datum, nachtStart, 6, (double) duration);
|
||||
}
|
||||
|
||||
return zv;
|
||||
}
|
||||
|
||||
private double CheckUhrzeiten(DateTime start, int startStunde, int endStunde, double minuten)
|
||||
{
|
||||
if (startStunde > endStunde) //Nachts
|
||||
{
|
||||
DateTime nachtStartDt = start.Date.AddHours(startStunde);
|
||||
DateTime nachtEndDt = start.Date.AddDays(1).AddHours(endStunde);
|
||||
|
||||
|
||||
DateTime dtEnd = start.AddMinutes(minuten);
|
||||
|
||||
double minutes = GetOverlappingMinutes(start, dtEnd, nachtStartDt, nachtEndDt);
|
||||
minutes += GetOverlappingMinutes(start, dtEnd, nachtStartDt.AddDays(-1), nachtEndDt.AddDays(-1));
|
||||
minutes += GetOverlappingMinutes(start, dtEnd, nachtStartDt.AddDays(1), nachtEndDt.AddDays(1));
|
||||
|
||||
return minutes;
|
||||
}
|
||||
else
|
||||
{
|
||||
DateTime tagsStartDt = start.Date.AddHours(startStunde);
|
||||
DateTime tagsEndDt = start.Date.AddHours(endStunde);
|
||||
|
||||
|
||||
DateTime dtEnd = start.AddMinutes(minuten);
|
||||
|
||||
double minutes = GetOverlappingMinutes(start, dtEnd, tagsStartDt, tagsEndDt);
|
||||
|
||||
return minutes;
|
||||
}
|
||||
}
|
||||
|
||||
private double GetOverlappingMinutes(DateTime start, DateTime end, DateTime start2, DateTime end2)
|
||||
{
|
||||
if (end > start2 && start < end2)
|
||||
{
|
||||
DateTime dtStart = start;
|
||||
|
||||
if (dtStart < start2)
|
||||
dtStart = start2;
|
||||
|
||||
DateTime dtEnd = end;
|
||||
|
||||
if (dtEnd > end2)
|
||||
dtEnd = end2;
|
||||
TimeSpan ts = dtEnd.Subtract(dtStart);
|
||||
|
||||
return ts.TotalMinutes;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected DateTime GetOsterSonntag(int year)
|
||||
{
|
||||
return VacationService.GetOsterSonntag(year);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Zeitverteilung
|
||||
{
|
||||
public double MinutenSamstag13_21 { get; set; }
|
||||
public double MinutenSonntag6_21 { get; set; }
|
||||
public double MinutenFeiertag6_21 { get; set; }
|
||||
public double MinutenHeiligabendSilvester14_21 { get; set; }
|
||||
public double MinutenOsterPfSa12_24 { get; set; }
|
||||
public double MinutenNacht21_6 { get; set; }
|
||||
public double MinutenNachtSa21_6 { get; set; }
|
||||
public double MinutenNachtSo21_6 { get; set; }
|
||||
public double MinutenNachtFe21_6 { get; set; }
|
||||
public double minutenLeistung { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
123
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.resx
Normal file
123
ReportImp/BeWoDarmstadt/Zeitzuschlagsbeleg.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>21, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Reference in New Issue
Block a user