2022-05-31 17:14:22 +02:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using BeWo.Report;
|
|
|
|
|
using BeWo.Report.ReportObjects;
|
|
|
|
|
using BS.Shared.Core;
|
|
|
|
|
using DevExpress.XtraReports.UI;
|
|
|
|
|
|
|
|
|
|
namespace PerspektivenEV
|
|
|
|
|
{
|
|
|
|
|
public partial class Quittierungsbeleg : XtraReport, IBeWoReport<ServicesOverviewRO>
|
|
|
|
|
{
|
|
|
|
|
public Quittierungsbeleg()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetReportDataSource(ServicesOverviewRO pRO)
|
|
|
|
|
{
|
|
|
|
|
double qualifiedMin = 0;
|
|
|
|
|
double unqualifiedMin = 0;
|
|
|
|
|
decimal anfahrt = 0;
|
|
|
|
|
|
|
|
|
|
if (pRO.Services != null)
|
|
|
|
|
{
|
|
|
|
|
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
|
|
|
|
|
|
|
|
|
|
foreach (var sr in pRO.Services)
|
|
|
|
|
{
|
2023-03-07 13:32:15 +01:00
|
|
|
ServicesOverviewRO.CreateSignatureString(sr);
|
|
|
|
|
|
2022-05-31 17:14:22 +02:00
|
|
|
if (sr.ServiceDescription.ToLower().Contains("anfahrt"))
|
|
|
|
|
{
|
|
|
|
|
sr.Notice5 = "x";
|
|
|
|
|
anfahrt += 1;
|
|
|
|
|
}
|
|
|
|
|
if (sr.MinutesQualified > 0)
|
|
|
|
|
qualifiedMin += sr.MinutesQualified;
|
|
|
|
|
else if (sr.MinutesUnqualified > 0)
|
|
|
|
|
unqualifiedMin += sr.MinutesUnqualified;
|
|
|
|
|
|
|
|
|
|
servicesBillable.Add(sr);
|
|
|
|
|
}
|
|
|
|
|
pRO.Services = servicesBillable;
|
|
|
|
|
}
|
|
|
|
|
lblMinSonstige.Text = unqualifiedMin.ToString();
|
|
|
|
|
lblFachkraftMin.Text = qualifiedMin.ToString();
|
|
|
|
|
lblAnfahrtCount.Text = anfahrt.ToString();
|
|
|
|
|
bindingSource1.DataSource = pRO;
|
|
|
|
|
|
|
|
|
|
}
|
2024-03-04 15:55:19 +01:00
|
|
|
private void picSignature_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e)
|
2023-03-07 13:32:15 +01:00
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-31 17:14:22 +02:00
|
|
|
}
|
|
|
|
|
}
|