ZukunftLeben: Leistungsnachweis Soziotherapie (Vorschlag für Kunden)
This commit is contained in:
137
ReportImp/ZukunftLeben/CustomReportCreator.cs
Normal file
137
ReportImp/ZukunftLeben/CustomReportCreator.cs
Normal file
@@ -0,0 +1,137 @@
|
||||
using System.Collections.Generic;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace ZukunftLeben
|
||||
{
|
||||
public class CustomReportCreator : DefaultReportCreator
|
||||
{
|
||||
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, serviceCategoryOid);
|
||||
|
||||
if (lROs.Count > 0)
|
||||
{
|
||||
var rootReport = CreateServicesOverviewReportForRo(lROs[0], serviceCategoryOid);
|
||||
if (rootReport.Pages.Count == 0)
|
||||
{
|
||||
rootReport.CreateDocument();
|
||||
}
|
||||
|
||||
for (int i = 1; i < lROs.Count; i++)
|
||||
{
|
||||
var lNext = CreateServicesOverviewReportForRo(lROs[i], serviceCategoryOid);
|
||||
if (lNext.Pages.Count == 0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private XtraReport CreateServicesOverviewReportForRo(ServicesOverviewRO ro, long? serviceCategoryOid)
|
||||
{
|
||||
ServicesOverviewRO defaultRo = ServicesOverviewRO.CopyFromRO(ro);
|
||||
ServicesOverviewRO sozioRo = ServicesOverviewRO.CopyFromRO(ro);
|
||||
|
||||
if (ro.Services != null)
|
||||
{
|
||||
foreach (ServicesOverviewRO.ServiceDetail s in ro.Services)
|
||||
{
|
||||
ServicesOverviewRO.CreateSignatureString(s);
|
||||
|
||||
if (s.ServiceCategory.ToLower().Contains("sozio"))
|
||||
{
|
||||
sozioRo.Services.Add(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
defaultRo.Services.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XtraReport report = null;
|
||||
report = AddReportToReport<QuittierungsbelegMitDatum>(report, defaultRo);
|
||||
report = AddReportToReport<LeistungsnachweisSoziotherapie>(report, sozioRo);
|
||||
|
||||
if (report == null)
|
||||
report = new XtraReport();
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
public override XtraReport CreateReportForServicesOverviewRo(ServicesOverviewRO ro, string reportId)
|
||||
{
|
||||
return CreateServicesOverviewReportForRo(ro, null);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
153
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.cs
Normal file
153
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using BS.Shared.Core;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Report;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
|
||||
namespace ZukunftLeben
|
||||
{
|
||||
|
||||
public partial class LeistungsnachweisSoziotherapie : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
||||
{
|
||||
public LeistungsnachweisSoziotherapie()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetReportDataSource(ServicesOverviewRO pRO)
|
||||
{
|
||||
double gesamt = 0;
|
||||
double gesamtGruppe = 0;
|
||||
|
||||
if (pRO.Services != null)
|
||||
{
|
||||
foreach (ServicesOverviewRO.ServiceDetail s in pRO.Services)
|
||||
{
|
||||
ServicesOverviewRO.CreateSignatureString(s);
|
||||
|
||||
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(s.ServiceRecordOid);
|
||||
pRO.ReferenceNumber = serviceRecord.CostBearer2SupportConcept.CustomerReferenceNumber;
|
||||
if (serviceRecord.CostBearer2SupportConcept.ApprovedStartDate != null)
|
||||
pRO.ApprovedStartDate = String.Format("{0:dd.MM.yyyy}", serviceRecord.CostBearer2SupportConcept.ApprovedStartDate);
|
||||
if (serviceRecord.CostBearer2SupportConcept.ApprovedEndDate != null)
|
||||
pRO.ApprovedEndDate = String.Format("{0:dd.MM.yyyy}", serviceRecord.CostBearer2SupportConcept.ApprovedEndDate);
|
||||
var srDc = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDC(serviceRecord);
|
||||
|
||||
s.GoalList = String.Empty;
|
||||
if (srDc.Goals != null && srDc.Goals.Count > 0)
|
||||
{
|
||||
foreach (var goal in srDc.Goals)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(goal.Abbreviation))
|
||||
{
|
||||
if (s.GoalList.Length > 0)
|
||||
s.GoalList += ", ";
|
||||
s.GoalList += goal.Abbreviation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (s.ServiceDescription.Contains("Gruppe"))
|
||||
{
|
||||
s.IsGroup = true;
|
||||
gesamtGruppe += s.Minutes;
|
||||
s.ServiceDescription = "E";
|
||||
s.Notice5 = "2002672";
|
||||
}
|
||||
else
|
||||
{
|
||||
gesamt += s.Minutes;
|
||||
}
|
||||
|
||||
if (s.ServiceDescription.Contains("Video"))
|
||||
{
|
||||
s.ServiceDescription = "V";
|
||||
if (s.Minutes <= 30)
|
||||
{
|
||||
s.Notice5 = "2001615";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.Notice5 = "2001616";
|
||||
}
|
||||
}
|
||||
else if (s.ServiceDescription.Contains("Telefon"))
|
||||
{
|
||||
s.ServiceDescription = "T";
|
||||
if (s.Minutes <= 30)
|
||||
{
|
||||
s.Notice5 = "2001618";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.Notice5 = "2001617";
|
||||
}
|
||||
}
|
||||
else if (s.ServiceDescription.Contains("Aufsuchende Prob"))
|
||||
{
|
||||
s.ServiceDescription = "A";
|
||||
s.Notice5 = "2001607";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (s.ServiceDescription.Contains("Büro"))
|
||||
{
|
||||
s.ServiceDescription = "E";
|
||||
}
|
||||
else if (s.ServiceDescription.Contains("Aufsuchend"))
|
||||
{
|
||||
s.ServiceDescription = "A";
|
||||
}
|
||||
|
||||
if (s.Minutes <= 30)
|
||||
{
|
||||
s.Notice5 = "2001612";
|
||||
}
|
||||
else
|
||||
{
|
||||
s.Notice5 = "2001610";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cellGesamt.Text = String.Format("{0:0.00}", gesamt / 60);
|
||||
if (gesamtGruppe > 0)
|
||||
{
|
||||
cellGesamtGruppe.Text = String.Format("{0:0.00}", gesamtGruppe / 60);
|
||||
}
|
||||
|
||||
this.bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
private void picSignature_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
XRPictureBox xrBox = sender as XRPictureBox;
|
||||
string base64String = xrBox.Tag as string;
|
||||
if (!String.IsNullOrWhiteSpace(base64String))
|
||||
{
|
||||
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
|
||||
var binData = Convert.FromBase64String(base64Data);
|
||||
System.Drawing.Image img = ByteArrayToImage(binData);
|
||||
xrBox.Image = Utils.CropImage(img);
|
||||
}
|
||||
else
|
||||
{
|
||||
xrBox.Image = null;
|
||||
}
|
||||
}
|
||||
|
||||
public System.Drawing.Image ByteArrayToImage(byte[] byteArrayIn)
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(byteArrayIn))
|
||||
{
|
||||
return System.Drawing.Image.FromStream(memoryStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1002
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.designer.cs
generated
Normal file
1002
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
120
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.resx
Normal file
120
ReportImp/ZukunftLeben/LeistungsnachweisSoziotherapie.resx
Normal file
@@ -0,0 +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>
|
||||
</root>
|
||||
@@ -1,7 +1,7 @@
|
||||
using BeWo.Report.ReportObjects;
|
||||
namespace ZukunftLeben
|
||||
{
|
||||
partial class Quittierungsbeleg2
|
||||
partial class QuittierungsbelegMitDatum
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
||||
@@ -11,9 +11,9 @@ using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace ZukunftLeben
|
||||
{
|
||||
public partial class Quittierungsbeleg2 : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
||||
public partial class QuittierungsbelegMitDatum : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<ServicesOverviewRO>
|
||||
{
|
||||
public Quittierungsbeleg2()
|
||||
public QuittierungsbelegMitDatum()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
@@ -56,9 +56,16 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Calculations\CustomGroupDurationCalculator.cs" />
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="Export\CustomDataExporter.cs" />
|
||||
<Compile Include="Export\DatevExporter.cs" />
|
||||
<Compile Include="Invoicing\SettlementInvoiceCreation.cs" />
|
||||
<Compile Include="LeistungsnachweisSoziotherapie.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LeistungsnachweisSoziotherapie.designer.cs">
|
||||
<DependentUpon>LeistungsnachweisSoziotherapie.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -104,6 +111,9 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="LeistungsnachweisSoziotherapie.resx">
|
||||
<DependentUpon>LeistungsnachweisSoziotherapie.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
||||
Reference in New Issue
Block a user