HilfeDaheim2: nicht benötigte Dateien (Kopien) entsorgt

This commit is contained in:
2024-01-22 18:56:38 +01:00
parent 3c50240ee5
commit 1777951898
6 changed files with 0 additions and 5424 deletions

View File

@@ -1,197 +0,0 @@
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 BeWo.Report.DefaultReports
{
public partial class Quittierungsbeleg : XtraReport, IBeWoReport<ServicesOverviewRO>
{
public Quittierungsbeleg()
{
InitializeComponent();
}
public void SetReportDataSource(ServicesOverviewRO pRO)
{
// Get calling method name
//StackTrace stackTrace = new StackTrace();
//Debug.WriteLine(stackTrace.GetFrame(1).GetMethod().Name);
bool hatGruppen = false;
//if (pRO == null)
// return;
if (pRO.Services != null)
{
List<ServicesOverviewRO.ServiceDetail> servicesBillable = new List<ServicesOverviewRO.ServiceDetail>();
foreach (var sd in pRO.Services)
{
if (sd.IsBillable)
{
ServicesOverviewRO.CreateSignatureString(sd);
if (sd.IsGroup)
{
//sd.Notice5 = String.Format("{0} Teilnehmer", sd.CustomerCount);
hatGruppen = true;
}
servicesBillable.Add(sd);
}
}
pRO.Services = servicesBillable;
}
if (String.IsNullOrWhiteSpace(pRO.AbsenceTimes))
{
lblHatAbwesenheiten.Text = "X";
}
if (!hatGruppen)
{
lblHatGruppen.Text = "X";
}
ErstelleAbwesenheitenTabelle(pRO);
if (pRO.Services.Count > 0)
{
if (pRO.Services[0].ServiceCategory.ToLower().Contains("assistenz"))
{
lblUeberschrift.Text = "Quittierungsbeleg für Assistenzleistungen";
lblTabellenspalte.Text = "AssL in";
}
}
bindingSource1.DataSource = pRO;
}
private void ErstelleAbwesenheitenTabelle(ServicesOverviewRO pRo)
{
if (pRo.Abwesenheiten != null)
{
int newRows = 0;
int index = 1;
foreach (var at in pRo.Abwesenheiten)
{
DevExpress.XtraReports.UI.XRTableRow row = null;
if (index < xrTableAbwesenheiten.Rows.Count)
{
row = xrTableAbwesenheiten.Rows[index];
}
else
{
row = xrTableAbwesenheiten.InsertRowBelow(xrTableAbwesenheiten.Rows[xrTableAbwesenheiten.Rows.Count - 1]);
newRows++;
}
row.Cells[0].Text = String.Format("{0:dd.MM.yyyy}", at.Start);
int? days = null;
if (at.End.HasValue)
{
row.Cells[1].Text = String.Format("{0:dd.MM.yyyy}", at.End);
days = (int)at.End.Value.Subtract(at.Start.Value).TotalDays + 1;
}
else
{
row.Cells[1].Text = "unbekannt";
}
row.Cells[2].Text = String.Format("{0:0}", days);
index++;
}
if (newRows > 0)
{
lblUnterschriftKlient.Top += newRows * 20;
lblUnterschriftMitarbeiter.Top += newRows * 20;
}
}
}
// TODO: Wie anzeigen? Alle?
private void EmployeeSignature_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
return;
if(sender is XRPictureBox pictureBox)
{
var base64String = pictureBox.Tag as string;
if(!string.IsNullOrWhiteSpace(base64String))
{
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
var binaryData = Convert.FromBase64String(base64Data);
var image = ByteArrayToImage(binaryData);
pictureBox.Image = image;
}
else
{
pictureBox.Image = null;
}
}
}
// TODO: Wie anzeigen? Alle?
// TODO: Visibile der Datumstextboxen auf true setzen!
private void CustomerSignature_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
{
return;
if(sender is XRPictureBox pictureBox)
{
var base64String = pictureBox.Tag as string;
if(!string.IsNullOrWhiteSpace(base64String))
{
var base64Data = Regex.Match(base64String, @"data:image/(?<type>.+?),(?<data>.+)").Groups["data"].Value;
var binaryData = Convert.FromBase64String(base64Data);
var image = ByteArrayToImage(binaryData);
pictureBox.Image = image;
}
else
{
pictureBox.Image = 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)
{
using(var memoryStream = new MemoryStream(byteArrayIn))
{
return Image.FromStream(memoryStream);
}
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,217 +0,0 @@
using System;
using System.Collections.Generic;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using BS.Shared.DataContracts;
namespace ProBeWoDueren
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
{
public Spitzabrechnung()
{
InitializeComponent();
}
public void SetReportDataSource(SettlementRO pRO)
{
bool isDefaultSpitzabrechnung = false;
if (pRO.InvoiceItems != null && pRO.InvoiceItems.Count == 1)
{
var ii = pRO.InvoiceItems[0];
if ((ii.ItemDescription == "Spitzabrechung" || ii.ItemDescription == "Spitzabrechnung") && ii.GrossAmountTotal == null && ii.RateFactor == null)
{
isDefaultSpitzabrechnung = true;
}
}
if (!isDefaultSpitzabrechnung)
{
if (pRO.DifferentHourlyRateCount > 0 && pRO.HourlyRateNew.HasValue)
{
isDefaultSpitzabrechnung = true;
}
}
if (isDefaultSpitzabrechnung)
{
//UpdateAbrechnungsFelder(pRO);
pRO.InvoiceItems = CreateDefaultSpitzabrechnungInvoiceItems(pRO);
}
else
{
var id = GetCustomerId(pRO);
if (id == "LWLNEU")
{
pRO.RateFactorText = null;
pRO.RateFactorText2 = null;
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
ii.ItemDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS x {3:c}",
ii.ItemPeriodStart, ii.ItemPeriodEnd, ii.UnitCount, ii.AmountPerUnit);
}
}
}
else
{
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
ii.ItemDescription = String.Format("{0:dd.MM.yyyy} bis {1:dd.MM.yyyy}: {2:0.##} FLS {3}x {4:c}",
ii.ItemPeriodStart, ii.ItemPeriodEnd,
ii.UnitCount, ii.RateFactor == 0 ? "" : " x " + pRO.RateFactorText2 + " ",
ii.AmountPerUnit);
}
}
}
}
// Wenn kein TerminationDate gesetzt ist, das dazugehörige Label entfernen
if (pRO.TerminationDate == null)
{
lblStammdaten.Text = lblStammdaten.Text.Remove(lblStammdaten.Text.Length - 32, 32);
}
this.bindingSource1.DataSource = pRO;
}
private String GetCustomerId(SettlementRO pRO)
{
var cb2sc = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
return cb2sc.CostBearer.ID;
}
private IList<InvoiceItemDC> CreateDefaultSpitzabrechnungInvoiceItems(SettlementRO pRO)
{
IList<InvoiceItemDC> itemList = new List<InvoiceItemDC>();
if (pRO.DifferentHourlyRateCount == 3)
{
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatz3, pRO.HourlyRate3, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatz3 * pRO.RateFactor * pRO.HourlyRate3
});
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatzAlt, pRO.HourlyRateOld, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatzAlt * pRO.RateFactor * pRO.HourlyRateOld
});
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.HourlyRateNew, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatzAktuell * pRO.RateFactor * pRO.HourlyRateNew
});
}
else if (pRO.DifferentHourlyRateCount == 2)
{
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatzAlt, pRO.HourlyRateOld, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld
});
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.HourlyRateNew, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatzAktuell * pRO.RateFactor * pRO.HourlyRateNew
});
}
else
{
itemList.Add(new InvoiceItemDC
{
ItemDescription = String.Format("{0:0.##} FLS x {1:c} x {2:0.00}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.HourlyRateNew, pRO.RateFactor),
GrossAmountTotal = pRO.GeleisteteFLSMitStundensatzAktuell * pRO.RateFactor * pRO.HourlyRateNew
});
}
return itemList;
}
private void UpdateAbrechnungsFelder(SettlementRO pRO)
{
if (pRO.DifferentHourlyRateCount == 3)
{
//Erbrachte Leistungen (FLS) - bis [HourlyRateOldEndDateString] à [HourlyRateOldString] €
pRO.Abrechnungstext1 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.HourlyRate3EndDateString);
pRO.Abrechnungstext1 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatz3, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRate3);
//[AccountingStartDateString] - [HourlyRate3EndDateString] sind [RecordedFLSWithHourlyRate3String] Std. x [HourlyRate3String] € =";
pRO.Betrag1 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatz3 * (decimal)pRO.RateFactor * pRO.HourlyRate3);
pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
pRO.HourlyRateOldStartDateString, pRO.HourlyRateOldEndDateString);
pRO.Abrechnungstext2 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
else if (pRO.DifferentHourlyRateCount == 2)
{
pRO.Abrechnungstext2 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.HourlyRateOldEndDateString);
pRO.Abrechnungstext2 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatzAlt, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateOld);
pRO.Betrag2 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAlt * (decimal)pRO.RateFactor * pRO.HourlyRateOld);
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
pRO.HourlyRateNewStartDateString, pRO.AccountingEndDateString);
pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
else
{
pRO.Abrechnungstext3 = String.Format("{0} bis {1}",
pRO.AccountingStartDateString, pRO.AccountingEndDateString);
pRO.Abrechnungstext3 += String.Format(": {0:0.##} FLS {1}x {2:c}",
pRO.GeleisteteFLSMitStundensatzAktuell, pRO.RateFactor == 1 ? "" : "x " + pRO.RateFactorText2 + " ", pRO.HourlyRateNew);
pRO.Betrag3 = String.Format("{0:c}", pRO.GeleisteteFLSMitStundensatzAktuell * (decimal)pRO.RateFactor * pRO.HourlyRateNew);
}
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff