MH: BAW Rundung fixen + BetreuWo Unterschriften

This commit is contained in:
2023-02-09 16:48:37 +01:00
parent de1b269bf3
commit 5beb04bd12
6 changed files with 150 additions and 6 deletions

View File

@@ -6,6 +6,10 @@ using BS.Shared.DataContracts;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using System.Text.RegularExpressions;
using System.Drawing;
using System.IO;
using BS.Shared.Core;
namespace BeWo.BetreuWoReports
{
@@ -42,7 +46,8 @@ namespace BeWo.BetreuWoReports
{
foreach (var item in pRO.Services)
{
if (item.ServiceCategory.StartsWith("UA "))
ServicesOverviewRO.CreateSignatureString(item);
if (item.ServiceCategory.StartsWith("UA "))
{
minTotal += item.Minutes;
@@ -86,5 +91,32 @@ namespace BeWo.BetreuWoReports
}
return null;
}
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)
{
Image returnImage = null;
MemoryStream ms = new System.IO.MemoryStream(byteArrayIn);
returnImage = Image.FromStream(ms);
return returnImage;
}
}
}

View File

@@ -79,6 +79,9 @@ namespace BeWo.BetreuWoReports
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.GroupFooter3 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.GroupHeader2 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.picSignature = new DevExpress.XtraReports.UI.XRPictureBox();
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
@@ -105,7 +108,7 @@ namespace BeWo.BetreuWoReports
this.xrTableServiceRecords1.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F);
this.xrTableServiceRecords1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow2});
this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(480F, 20F);
this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(707F, 20F);
this.xrTableServiceRecords1.StylePriority.UseBackColor = false;
this.xrTableServiceRecords1.StylePriority.UseBorders = false;
this.xrTableServiceRecords1.StylePriority.UseFont = false;
@@ -120,7 +123,8 @@ namespace BeWo.BetreuWoReports
this.xrTableCell4,
this.xrTableCell1,
this.xrTableCell2,
this.xrTableCell11});
this.xrTableCell11,
this.xrTableCell5});
this.xrTableRow2.Name = "xrTableRow2";
this.xrTableRow2.StylePriority.UsePadding = false;
this.xrTableRow2.StylePriority.UseTextAlignment = false;
@@ -198,7 +202,7 @@ namespace BeWo.BetreuWoReports
this.xrTable3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow6});
this.xrTable3.SizeF = new System.Drawing.SizeF(480F, 20F);
this.xrTable3.SizeF = new System.Drawing.SizeF(707F, 20F);
this.xrTable3.StylePriority.UseBorders = false;
this.xrTable3.StylePriority.UseFont = false;
this.xrTable3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
@@ -210,7 +214,8 @@ namespace BeWo.BetreuWoReports
this.xrTableCell7,
this.xrTableCell14,
this.xrTableCell15,
this.xrTableCell16});
this.xrTableCell16,
this.xrTableCell6});
this.xrTableRow6.FormattingRules.Add(this.ruleRowInvisible);
this.xrTableRow6.Name = "xrTableRow6";
this.xrTableRow6.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F);
@@ -569,6 +574,37 @@ namespace BeWo.BetreuWoReports
this.GroupHeader2.Name = "GroupHeader2";
this.GroupHeader2.RepeatEveryPage = true;
//
// xrTableCell5
//
this.xrTableCell5.Name = "xrTableCell5";
this.xrTableCell5.StylePriority.UseTextAlignment = false;
this.xrTableCell5.Text = "Unterschrift Klient/in";
this.xrTableCell5.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell5.Weight = 0.55356034248081987D;
//
// xrTableCell6
//
this.xrTableCell6.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.picSignature});
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTableCell6.StylePriority.UsePadding = false;
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell6.Weight = 0.28661621662654468D;
//
// picSignature
//
this.picSignature.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.picSignature.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Tag", null, "Services.Signature")});
this.picSignature.LocationFloat = new DevExpress.Utils.PointFloat(0F, 0F);
this.picSignature.Name = "picSignature";
this.picSignature.SizeF = new System.Drawing.SizeF(227.0001F, 20.00001F);
this.picSignature.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
this.picSignature.StylePriority.UseBorders = false;
this.picSignature.BeforePrint += new System.Drawing.Printing.PrintEventHandler(this.picSignature_BeforePrint);
//
// StundenzettelALS
//
this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {
@@ -657,5 +693,8 @@ namespace BeWo.BetreuWoReports
private DevExpress.XtraReports.UI.XRLabel xrLabel1;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell5;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRPictureBox picSignature;
}
}

View File

@@ -51,6 +51,8 @@
<Compile Include="CustomMitarbeiterstundenkontoBerechnung.cs" />
<Compile Include="CustomMitarbeiterstundenkontoBerechnungMonate.cs" />
<Compile Include="CustomReportCreator.cs" />
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
<Compile Include="Mitarbeiterarbeitszeitkonto.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -0,0 +1,50 @@
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BetreuungsserviceFuerAlltagUndWohnen.Invoicing
{
public class CustomInvoiceCreation : InvoiceCreation
{
public override void BerechneSummaryItemsSummen(List<InvoiceItem> newlist, bool addRateFactorToUnitCount)
{
addRateFactorToUnitCount = true;
foreach (InvoiceItem invoiceItem in newlist)
{
if (!invoiceItem.AmountPerUnit.HasValue)
{
invoiceItem.AmountPerUnit = 0;
}
invoiceItem.AmountPerUnit = Math.Round(invoiceItem.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero);
if (!invoiceItem.UnitCount.HasValue)
{
invoiceItem.UnitCount = 0;
}
if (addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
{
invoiceItem.UnitCount = (invoiceItem.UnitCount ?? 0) * ((invoiceItem.RateFactor + 100) / 100);
}
invoiceItem.UnitCount = Math.Round(invoiceItem.UnitCount.Value, 2, MidpointRounding.AwayFromZero);
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount;
invoiceItem.AmountTotal = Math.Round(invoiceItem.AmountTotal.Value, 2, MidpointRounding.AwayFromZero);
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
if (!addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue)
{
invoiceItem.GrossAmountTotal *= ((invoiceItem.RateFactor + 100) / 100);
}
}
}
}
}

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Service.Invoicing;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
namespace BetreuungsserviceFuerAlltagUndWohnen.Invoicing
{
public class CustomInvoiceFactory : InvoiceFactory
{
public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary<CompactSupportConceptDC, List<ServiceRecordDC>> supportConcepts2ServiceRecords)
{
return new CustomInvoiceCreation();
}
}
}

View File

@@ -25,7 +25,7 @@ namespace BetreuungsserviceFuerAlltagUndWohnen
hourlyRate = invoiceItem.HourlyRate.Value;
}
}
flsGesamt = flsGesamt * (1 + pRO.InvoiceBase.SupportConceptCostBearerRelDc.CostBearer.ActualRateFactor / 100);
//flsGesamt = flsGesamt * (1 + pRO.InvoiceBase.SupportConceptCostBearerRelDc.CostBearer.ActualRateFactor / 100);
lblGesamtFLS.Text = string.Format("{0:0.00}", flsGesamt);
lblGesamtforderung.Text = string.Format("{0:0.00} Stunden x {1:c}", flsGesamt, hourlyRate);