LebenshilfeWolfsburg/Reporting/Leistungsnachweis2024 - neuer LN für QA und KA

This commit is contained in:
2024-07-10 16:22:14 +02:00
parent 3f35ff0154
commit 3429a9bec0
5 changed files with 1491 additions and 1330 deletions

View File

@@ -55,18 +55,17 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CustomReportCreator.cs" />
<Compile Include="Export\CustomDataExporter.cs" />
<Compile Include="Export\LohnExporter.cs" />
<Compile Include="LeistungsnachweisQualifizierteAssistenz.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="LeistungsnachweisQualifizierteAssistenz.Designer.cs">
<DependentUpon>LeistungsnachweisQualifizierteAssistenz.cs</DependentUpon>
</Compile>
<Compile Include="Reporting\CustomMitarbeiterstundenkontoBerechnung.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Reporting\CustomReportCreator.cs" />
<Compile Include="Reporting\Leistungsnachweis2024.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Reporting\Leistungsnachweis2024.Designer.cs">
<DependentUpon>Leistungsnachweis2024.cs</DependentUpon>
</Compile>
<Compile Include="Reporting\Lohnschnittstellenhelper.cs" />
<Compile Include="Reporting\Schnittstellendruck.cs">
<SubType>Component</SubType>
@@ -100,11 +99,11 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LeistungsnachweisQualifizierteAssistenz.resx">
<DependentUpon>LeistungsnachweisQualifizierteAssistenz.cs</DependentUpon>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Reporting\Leistungsnachweis2024.resx">
<DependentUpon>Leistungsnachweis2024.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Reporting\Schnittstellendruck.resx">
<DependentUpon>Schnittstellendruck.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -8,6 +8,7 @@ using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared;
using BS.Shared.Core;
using DevExpress.XtraReports.UI;
@@ -61,5 +62,195 @@ namespace LebenshilfeWolfsburg.Reporting
return new XtraReport();
}
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
{
//List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay);
List<ServicesOverviewRO> lROs = Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
if (lROs.Count > 0)
{
var rootReport = CreateServicesOverviewReportForRo(lROs[0], serviceCategoryOid);
rootReport.CreateDocument();
for (int i = 1; i < lROs.Count; i++)
{
var lNext = CreateServicesOverviewReportForRo(lROs[i], serviceCategoryOid);
lNext.CreateDocument();
rootReport.Pages.AddRange(lNext.Pages);
}
return rootReport;
}
return new XtraReport();
}
private List<ServicesOverviewRO> Create(int pMonth, int pYear, long orgaOid, long empOid, int startDay, int endDay, long? serviceCategoryOid = null)
{
var roList = new List<ServicesOverviewRO>();
List<long> customerOids = new List<long>();
ApplicationUser loggedInUser = null;
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
{
loggedInUser = LoggedInUserOperationContextExt.Current.User;
}
else
{
loggedInUser = SessionFacade.LoggedInUser;
}
if (loggedInUser != null && loggedInUser.Employee != null)
{
bool all = false;
foreach (var group in loggedInUser.UserGroups)
{
if (group.Name.ToLower().Contains("admin") || group.Name.ToLower().Contains("verwaltung"))
{
all = true;
}
}
if (all)
{
customerOids.AddRange(DAOFactory.GenericDAO.GetAllActive<Customer>()
.OrderBy(ob => ob.Person.LastName + ", " + ob.Person.FirstName).Select(c => c.Oid.Value));
}
else
{
var teams = DAOFactory.SearchDAO.FindLeadingTeams(loggedInUser.Employee.Oid.Value);
foreach (var team in teams)
{
foreach (var employee in team.MemberList)
{
foreach (var e2c in employee.Employee2CustomerList)
{
if (e2c.Customer.IsActive == ActivationTypeId.Active)
{
foreach (var v2o in e2c.ValueList)
{
if (v2o.Entry.Type == ValueListEntryType.StaffRoleType &&
v2o.Entry.Value.Contains("Hauptbetreuung"))
{
if (!customerOids.Contains(e2c.Customer.Oid.Value))
{
customerOids.Add(e2c.Customer.Oid.Value);
}
}
}
}
}
}
}
}
}
foreach (var coid in customerOids)
{
var ro = ServicesOverviewRO.Create(coid, pMonth, pYear, true, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
//ServicesOverviewRO ro = ServicesOverviewRO.Create(customer, pSpan, disableEmptySupportConcepts, orgaOid, empOid, searchServiceRecordsByEndDate, serviceCategoryOid);
if (ro != null)
{
roList.Add(ro);
}
}
return roList.OrderBy(r => r.CustomerLastName + ", " + r.CustomerFirstName).ToList();
}
public override XtraReport CreateServiceOverviewReportForCustomers(IList<long> customerOids, int month, int year, long? orgaOid, long? empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
{
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);
}
}
if (roList.Count > 0)
{
var rootReport = CreateServicesOverviewReportForRo(roList[0], serviceCategoryOid);
rootReport.CreateDocument();
for (int i = 1; i < roList.Count; i++)
{
var lNext = CreateServicesOverviewReportForRo(roList[i], serviceCategoryOid);
lNext.CreateDocument();
rootReport.Pages.AddRange(lNext.Pages);
}
return rootReport;
}
return new XtraReport();
}
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
{
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
return CreateServicesOverviewReportForRo(ro, serviceCategoryOid);
}
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, long? serviceCategoryOid)
{
XtraReport report = null;
ServicesOverviewRO newRo = ServicesOverviewRO.CopyFromRO(ro);
ServicesOverviewRO oldRo = ServicesOverviewRO.CopyFromRO(ro);
newRo.TotalFLMBillable = 0;
oldRo.TotalFLMBillable = 0;
if (ro.Services != null)
{
foreach (ServicesOverviewRO.ServiceDetail s in ro.Services)
{
if (ro.Costbearer.Contains("2024"))
{
newRo.Services.Add(s);
newRo.TotalFLMBillable += s.Minutes;
newRo.TotalFLMBillable += s.Minutes / 60;
}
else
{
oldRo.Services.Add(s);
oldRo.TotalFLMBillable += s.Minutes;
oldRo.TotalFLMBillable += s.Minutes / 60;
}
}
}
report = AddReportToReport<Leistungsnachweis2024>(report, newRo);
report = AddReportToReport<Stundenzettel>(report, oldRo);
if (report == null)
{
report = new XtraReport();
}
return report;
}
private XtraReport AddReportToReport<T>(XtraReport report, ServicesOverviewRO ro) where T : XtraReport, IBeWoReport<ServicesOverviewRO>, new()
{
if (ro.Services.Count > 0)
{
if (report == null)
{
report = new T();
((T)report).SetReportDataSource(ro);
}
else
{
if (report.Pages.Count == 0)
report.CreateDocument();
XtraReport newReport = new T();
((T)newReport).SetReportDataSource(ro);
newReport.CreateDocument();
report.Pages.AddRange(newReport.Pages);
}
}
return report;
}
}
}

View File

@@ -16,11 +16,11 @@ using BS.Shared.DataContracts;
using BS.Shared.Services;
using DevExpress.XtraReports.UI;
namespace LebenshilfeWolfsburg
namespace LebenshilfeWolfsburg.Reporting
{
public partial class LeistungsnachweisQualifizierteAssistenz : XtraReport, IBeWoReport<ServicesOverviewRO>
public partial class Leistungsnachweis2024 : XtraReport, IBeWoReport<ServicesOverviewRO>
{
public LeistungsnachweisQualifizierteAssistenz()
public Leistungsnachweis2024()
{
InitializeComponent();
}
@@ -36,30 +36,26 @@ namespace LebenshilfeWolfsburg
int summeAusfallstunden = 0;
foreach (var sd in pRO.Services)
{
sd.IsBillable = sd.ServiceDescription.Contains("50 direkt") || sd.ServiceDescription.Contains("Ausfall");
//sd.IsBillable = sd.ServiceDescription.ToLower().Contains("face") || sd.ServiceDescription.ToLower().Contains("ausfall");
if (sd.IsBillable && !sd.ServiceCategory.Contains("Fahrt"))
{
sd.FLSQualified = sd.Minutes / 50;
minuten += sd.Minutes;
ServicesOverviewRO.CreateSignatureString(sd);
sd.Notice3 = "";
ServicesOverviewRO.CreateSignatureString(sd);
sd.Notice2 = "";
if (sd.IsGroup)
{
sd.Notice3 = "1";
sd.Notice2 = "1";
}
// Felder für Wegepauschale setzen (Wenn FLS FaceToFace, dann ja)
sd.Notice4 = "";
if (!String.IsNullOrWhiteSpace(sd.GefahreneKilometer) && Decimal.TryParse(sd.GefahreneKilometer, out var k))
if (sd.ServiceDescription.ToLower().Contains("face"))
{
if (k > 0)
{
sd.Notice4 = "1";
summeWegepauschalen++;
}
sd.Notice4 = "1";
summeWegepauschalen++;
}
// Felder für Ausfallstundnen setzen
@@ -86,6 +82,15 @@ namespace LebenshilfeWolfsburg
lblRestbudget.Text = String.Format("{0:0.00}", pRO.ApprovedFLSTotal - pRO.MinutenGeleistetBisVormonat);
//lblHeader je nach Art der Leistung des Hilfeplans
if (pRO.Costbearer.Contains("Helfer"))
{
lblHeader.Text = "Kompensatorische Assistenz";
}
if (pRO.SupportConceptCostBearer.AuswahlBezeichnung != null && pRO.SupportConceptCostBearer.AuswahlBezeichnung.Length > 0)
{
lblHeader.Text += " - " + pRO.SupportConceptCostBearer.AuswahlBezeichnung;
}
bindingSource1.DataSource = pRO;
}

View File

@@ -1,120 +1,120 @@
<?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>
<?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>
</root>