MH: ProIntegra Niedersachsen QB
This commit is contained in:
88
ReportImp/ProIntegra/CustomReportCreator.cs
Normal file
88
ReportImp/ProIntegra/CustomReportCreator.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using DevExpress.XtraReports.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace ProIntegra
|
||||
{
|
||||
class CustomReportCreator : DefaultReportCreator
|
||||
{
|
||||
|
||||
public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
|
||||
{
|
||||
List<ServicesOverviewRO> lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid, true, nurFehlende);
|
||||
|
||||
if (lROs.Count > 0)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
|
||||
IBeWoReport<ServicesOverviewRO> lServiceOverviewAllCustomersReport = new Quittierungsbeleg();
|
||||
if (reportId != null)
|
||||
{
|
||||
if (reportId.ToLower().Contains("neu"))
|
||||
lServiceOverviewAllCustomersReport = new QuittierungsbelegNiedersachsen();
|
||||
}
|
||||
|
||||
lServiceOverviewAllCustomersReport.SetReportDataSource(lROs[0]);
|
||||
(lServiceOverviewAllCustomersReport as XtraReport).CreateDocument();
|
||||
var Report = lServiceOverviewAllCustomersReport as XtraReport;
|
||||
|
||||
for (int i = 1; i < lROs.Count; i++)
|
||||
{
|
||||
IBeWoReport<ServicesOverviewRO> lNext = new Quittierungsbeleg();
|
||||
if (reportId != null)
|
||||
{
|
||||
if (reportId.ToLower().Contains("neu"))
|
||||
lNext = new QuittierungsbelegNiedersachsen();
|
||||
}
|
||||
lNext.SetReportDataSource(lROs[i]);
|
||||
(lNext as XtraReport).CreateDocument();
|
||||
Report.Pages.AddRange((lNext as XtraReport).Pages);
|
||||
}
|
||||
|
||||
return lServiceOverviewAllCustomersReport as XtraReport;
|
||||
}
|
||||
return new XtraReport();
|
||||
}
|
||||
|
||||
public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
|
||||
{
|
||||
String reportId = null;
|
||||
if (orgaOid > 0)
|
||||
{
|
||||
var organisation = DAOFactory.GenericDAO.LoadByID<Organisation>(orgaOid);
|
||||
if (organisation != null)
|
||||
reportId = organisation.Name;
|
||||
}
|
||||
|
||||
var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
|
||||
IBeWoReport<ServicesOverviewRO> lServiceOverviewSingleCustomerReport = new Quittierungsbeleg();
|
||||
if (reportId == null)
|
||||
reportId = ro.Costbearer;
|
||||
|
||||
if (reportId != null)
|
||||
{
|
||||
if (reportId.ToLower().Contains("neu"))
|
||||
lServiceOverviewSingleCustomerReport = new QuittierungsbelegNiedersachsen();
|
||||
}
|
||||
|
||||
if (ro != null)
|
||||
{
|
||||
lServiceOverviewSingleCustomerReport.SetReportDataSource(ro);
|
||||
}
|
||||
|
||||
return lServiceOverviewSingleCustomerReport as XtraReport;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@
|
||||
<Compile Include="CustomerDataReport.Designer.cs">
|
||||
<DependentUpon>CustomerDataReport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CustomReportCreator.cs" />
|
||||
<Compile Include="InvoiceCustomerReport.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -65,6 +66,12 @@
|
||||
<Compile Include="Invoicing\CustomSettlementInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\PauschalenHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="QuittierungsbelegNiedersachsen.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="QuittierungsbelegNiedersachsen.Designer.cs">
|
||||
<DependentUpon>QuittierungsbelegNiedersachsen.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="QuittierungsbelegMitDatum.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
@@ -116,6 +123,10 @@
|
||||
<DependentUpon>InvoiceCustomerReport.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="QuittierungsbelegNiedersachsen.resx">
|
||||
<DependentUpon>QuittierungsbelegNiedersachsen.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="QuittierungsbelegMitDatum.resx">
|
||||
<DependentUpon>QuittierungsbelegMitDatum.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
1471
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.Designer.cs
generated
Normal file
1471
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
140
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.cs
Normal file
140
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using BeWo.Report;
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWo.Service.DCEntityMapper;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace ProIntegra
|
||||
{
|
||||
public partial class QuittierungsbelegNiedersachsen : XtraReport, IBeWoReport<ServicesOverviewRO>
|
||||
{
|
||||
public QuittierungsbelegNiedersachsen()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetReportDataSource(ServicesOverviewRO pRO)
|
||||
{
|
||||
// Get calling method name
|
||||
//StackTrace stackTrace = new StackTrace();
|
||||
//Debug.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
|
||||
|
||||
bool hatGruppen = false;
|
||||
double minuten = 0;
|
||||
|
||||
var cr = pRO.CostBearer2SupportConceptList[0].CostBearer.CostRatePeriods.Where(p => p.CostRateType == CostRatePeriodType.MinutesPerServiceUnit).OrderBy(c => c.EndDate).ToList();
|
||||
var currentFLSUnit = cr.FirstOrDefault(c => c.EndDate >= pRO.EndDate);
|
||||
if (currentFLSUnit == null)
|
||||
currentFLSUnit = cr[0];
|
||||
|
||||
if (pRO.Services != null)
|
||||
{
|
||||
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
||||
int summeWegepauschalen = 0;
|
||||
int summeAusfallstunden = 0;
|
||||
foreach (var sd in pRO.Services)
|
||||
{
|
||||
if (sd.IsBillable && !sd.ServiceCategory.Contains("Fahrt"))
|
||||
{
|
||||
minuten += sd.Minutes;
|
||||
ServicesOverviewRO.CreateSignatureString(sd);
|
||||
sd.Notice5 = "F";
|
||||
if (sd.ServiceDescription.Contains("ear"))
|
||||
sd.Notice5 = "E";
|
||||
else if (sd.IsGroup)
|
||||
{
|
||||
//sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount);
|
||||
hatGruppen = true;
|
||||
sd.Notice3 = "1";
|
||||
}
|
||||
|
||||
// Felder für Wegepauschale setzen (Wenn FLS FaceToFace, dann ja)
|
||||
if (sd.ServiceDescription.ToLower().Contains("face to face") || sd.ServiceDescription.ToLower().Contains("face to face"))
|
||||
{
|
||||
sd.Notice4 = "1";
|
||||
summeWegepauschalen++;
|
||||
}
|
||||
else
|
||||
sd.Notice4 = "";
|
||||
|
||||
// Felder für Ausfallstundnen setzen
|
||||
if (sd.ServiceCategory.ToLower().Contains("ausfallstunde") || sd.ServiceDescription.ToLower().Contains("ausfallstunde"))
|
||||
{
|
||||
sd.Notice5 = "1";
|
||||
summeAusfallstunden++;
|
||||
}
|
||||
else
|
||||
sd.Notice5 = "";
|
||||
|
||||
servicesBillable.Add(sd);
|
||||
}
|
||||
}
|
||||
pRO.Services = servicesBillable;
|
||||
lblSummeWegepauschalen.Text = string.Format("{0:0}", summeWegepauschalen);
|
||||
lblSummeAusfallstunden.Text = string.Format("{0:0}", summeAusfallstunden);
|
||||
|
||||
}
|
||||
|
||||
if (pRO.CostBearer2SupportConceptList != null && pRO.CostBearer2SupportConceptList.Count > 0)
|
||||
{
|
||||
var c2s = pRO.CostBearer2SupportConceptList[0];
|
||||
var dc = MapperFactory.SupportConceptCostBearerRelDC_CostBearer2SupportConcept.MapToNewDC(c2s);
|
||||
|
||||
foreach (var scap in dc.ApprovalPeriodList)
|
||||
{
|
||||
if (scap.ApprovedBEPerInterval.HasValue && scap.ApprovedBEInterval.HasValue && scap.ServiceCategory != null && scap.ServiceCategory.Name == pRO.Services[0].ServiceCategory)
|
||||
{
|
||||
lblBewilligtFls.Text = String.Format("{0:0.00}", scap.ApprovedBEPerInterval.Value);
|
||||
pRO.ApprovedFLSTotal = Convert.ToDecimal((scap.EndDate.Value - scap.StartDate.Value).TotalDays / 7) * scap.ApprovedBEPerInterval.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pRO.TotalFLMBillable = minuten;
|
||||
|
||||
foreach (var s in pRO.Services)
|
||||
s.FLSQualified = s.MinutesQualified / Convert.ToDouble(currentFLSUnit.CostRateValue);
|
||||
pRO.TotalFLSQualified = pRO.TotalFLMQualified / Convert.ToDouble(currentFLSUnit.CostRateValue);
|
||||
|
||||
pRO.CalculateFLSSollIst2();
|
||||
lblRestbudget.Text = String.Format("{0:0.00}", pRO.ApprovedFLSTotal - pRO.MinutenGeleistetBisVormonat / currentFLSUnit.CostRateValue);
|
||||
|
||||
bindingSource1.DataSource = pRO;
|
||||
}
|
||||
|
||||
private void picSignature_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
|
||||
{
|
||||
XRPictureBox xrBox = sender as XRPictureBox;
|
||||
//var test = this.GetCurrent
|
||||
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);
|
||||
Image img = ByteArrayToImage(binData);
|
||||
xrBox.Image = Utils.CropImage(img);
|
||||
}
|
||||
else
|
||||
{
|
||||
xrBox.Image = null;
|
||||
}
|
||||
}
|
||||
|
||||
public Image ByteArrayToImage(byte[] byteArrayIn)
|
||||
{
|
||||
using (var memoryStream = new MemoryStream(byteArrayIn))
|
||||
{
|
||||
return Image.FromStream(memoryStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
123
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.resx
Normal file
123
ReportImp/ProIntegra/QuittierungsbelegNiedersachsen.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