SprungbrettTheresia/Budgetnachweis.cs - Umstellung auf neuen LWL-Budgetnachweis mit Anhang -1.0

This commit is contained in:
2025-01-20 12:00:16 +01:00
parent 770dd80443
commit 1756754682
9 changed files with 1266 additions and 1436 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +1,13 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared.DataContracts;
using System.Text;
using DevExpress.XtraReports.UI;
namespace BeWo.SprungbrettTheresia
{
@@ -21,82 +20,34 @@ namespace BeWo.SprungbrettTheresia
public void SetReportDataSource(SettlementRO pRO)
{
chkNichtBeendet.Checked = true;
DateTime? terminationDate = null;
StringBuilder sb = new StringBuilder();
if (!String.IsNullOrEmpty(pRO.RecipientOrganisation))
if (!String.IsNullOrEmpty(pRO.SenderContactPersonPhone))
{
sb.AppendLine(pRO.RecipientOrganisation);
pRO.SenderContactPersonPhone = pRO.SenderContactPersonPhone.Replace("Tel.:", "").Trim();
}
if (!String.IsNullOrEmpty(pRO.RecipientContactPerson))
if (!String.IsNullOrEmpty(pRO.SenderContactPersonFax))
{
sb.AppendLine(pRO.RecipientContactPerson);
pRO.SenderContactPersonFax = pRO.SenderContactPersonFax.Replace("Fax:", "").Trim();
}
if (!String.IsNullOrEmpty(pRO.RecipientDivision))
if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail))
{
sb.AppendLine(pRO.RecipientDivision);
}
if (!String.IsNullOrEmpty(pRO.RecipientStreet))
{
sb.AppendLine(pRO.RecipientStreet);
}
if (!String.IsNullOrEmpty(pRO.RecipientPostCodeAndTown))
{
sb.Append(pRO.RecipientPostCodeAndTown);
}
lblAdresse.Text = sb.ToString();
if (pRO.Approvals != null && pRO.Approvals.Count > 0)
{
pRO.ApprovedFLSWeekly = pRO.Approvals[0].ApprovedPerUnit ?? 0;
pRO.ApprovedFLSWeeklyString = String.Format("{0:0.00}", pRO.ApprovedFLSWeekly);
pRO.SenderContactPersonMail = pRO.SenderContactPersonMail.Replace("E-Mail:", "").Trim();
}
chkNichtBeendet.Checked = true;
xrCheckBox2.Checked = true;
if (pRO.CostBearer2SupportConceptOid > 0)
{
var c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(pRO.CostBearer2SupportConceptOid);
if (c2s.SupportConcept.Customer.TerminationDate.HasValue)
{
chkBeendet.Text = String.Format(" Die Betreuung wurde am {0:dd.MM.yyyy} beendet.",
xrCheckBox1.Text = String.Format(" Die Betreuung wurde beendet am {0:dd.MM.yyyy}",
c2s.SupportConcept.Customer.TerminationDate);
chkNichtBeendet.Checked = false;
chkBeendet.Checked = true;
}
}
ErstelleRechnungspositionen(pRO, terminationDate);
var anhang = new BudgetnachweisSeite2();
xrSubreport1.ReportSource = anhang;
anhang.SetReportDataSource(pRO);
this.bindingSource1.DataSource = pRO;
}
private void ErstelleRechnungspositionen(SettlementRO pRO, DateTime? terminationDate)
{
if (pRO.InvoiceItems != null)
{
XRTableRow newRow = null;
int rowIndex = 2;
foreach (var ii in pRO.InvoiceItems)
{
if (rowIndex > 2)
newRow = tableRechnungspositionen.InsertRowBelow(tableRechnungspositionen.Rows[tableRechnungspositionen.Rows.Count - 1]);
newRow = tableRechnungspositionen.Rows[rowIndex];
newRow.Cells[0].Text = String.Format("{0:dd.MM.yyyy}", ii.ItemPeriodStart);
newRow.Cells[1].Text = String.Format("{0:dd.MM.yyyy}", ii.ItemPeriodEnd);
newRow.Cells[2].Text = String.Format("{0:0.00}", ii.AmountPerUnit);
newRow.Cells[3].Text = String.Format("{0:0.00}", ii.UnitCount);
rowIndex += 1;
xrCheckBox2.Checked = false;
xrCheckBox1.Checked = true;
}
}
bindingSource1.DataSource = pRO;
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -21,9 +21,7 @@ namespace BeWo.SprungbrettTheresia
public override XtraReport CreateSettlementReport(string dcId, long? invoiceBaseOid)
{
XtraReport report = null;
Settlement2DC lSettlementDC;
long result;
if (string.IsNullOrEmpty(dcId) && invoiceBaseOid.HasValue)
@@ -37,32 +35,27 @@ namespace BeWo.SprungbrettTheresia
string lPath = BS.Shared.Core.Utils.CreateSavePath(TempPath, dcId);
lSettlementDC = Utils.XMLDeserialize<Settlement2DC>(lPath);
}
if (lSettlementDC.RecordedBillableFLSNetto == 0)
// Fallunterscheidung 01/2025 abgeschafft mit "neuem" Budgetnachweis LWL
var ro = new Budgetnachweis();
ro.SetReportDataSource(SettlementRO.Create(lSettlementDC));
ro.CreateDocument();
report = ro as XtraReport;
if (report != null)
{
lSettlementDC.RecordedBillableFLSNetto = lSettlementDC.RecordedBillableFLSBrutto ?? 0;
}
String reportId = null;
if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
{
CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
reportId = c2s.CostBearer.ID;
var anhang = CreateBudgetnachweisAnhang(lSettlementDC);
if (anhang != null)
{
anhang.CreateDocument();
report.Pages.AddRange(anhang.Pages);
}
var intern = new BudgetnachweisSeite2();
intern.SetReportDataSource(SettlementRO.Create(lSettlementDC));
intern.CreateDocument();
report.Pages.AddRange(intern.Pages);
}
if (lSettlementDC.DifferentHourlyRateCount > 0 && lSettlementDC.DifferentHourlyRateCount < 4)
{
IBeWoReport<SettlementRO> lSettlementReport = FindReportImp<SettlementRO>(reportId);
var ro = SettlementRO.Create(lSettlementDC);
lSettlementReport.SetReportDataSource(ro);
report = lSettlementReport as XtraReport;
}
else
{
var ro = new Budgetnachweis();
ro.SetReportDataSource(SettlementRO.Create(lSettlementDC));
ro.CreateDocument();
report = ro as XtraReport;
}
return report;
}

View File

@@ -18,9 +18,7 @@ namespace BeWo.SprungbrettTheresia
{
public override void CalculateInvoiceItemAmounts(Settlement2DC si)
{
decimal maxApprovedFls = si.ApprovedFLS ?? 0;
foreach (var ii in si.InvoiceItems)
{
if (ii.UnitCount.HasValue)
@@ -28,25 +26,22 @@ namespace BeWo.SprungbrettTheresia
decimal uc = ii.UnitCount ?? 0;
if (maxApprovedFls < uc)
{
uc = maxApprovedFls;
}
maxApprovedFls -= uc;
ii.UnitCount = uc;
if (ii.RateFactor.HasValue && ii.RateFactor.Value != 0)
{
ii.UnitCount *= ((100m + ii.RateFactor.Value) / 100m);
}
ii.UnitCount = Math.Round(ii.UnitCount ?? 0, 2, MidpointRounding.AwayFromZero);
if (ii.AmountPerUnit.HasValue)
{
ii.AmountTotal = ii.UnitCount.Value * ii.AmountPerUnit.Value;
ii.GrossAmountTotal = ii.AmountTotal;
}
if (ii.MaxApprovedUnitCount < ii.UnitCount)
{
@@ -54,7 +49,6 @@ namespace BeWo.SprungbrettTheresia
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,7 @@ namespace BeWo.SprungbrettTheresia.Alt
{
public partial class Spitzabrechnung : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<SettlementRO>
{
// 01/2025 abgeschafft mit "neuem" Budgetnachweis LWL
public Spitzabrechnung()
{
InitializeComponent();
@@ -44,20 +45,9 @@ namespace BeWo.SprungbrettTheresia.Alt
}
lblAdresse.Text = sb.ToString();
//if (pRO.ClaimWithEigenbeteiligung < 0)
//{
// lblClaimText1.Text = "Rückzahlungsanspruch LWL:";
// lblClaimText2.Text = "Rückzahlungsanspruch LWL:";
//}
//else
//{
// lblClaimText1.Text = "Betrag:";
// lblClaimText2.Text = "Betrag:";
//}
if (pRO.Approvals != null && pRO.Approvals.Count > 0)
{
pRO.ApprovedFLSWeekly = pRO.Approvals[0].ApprovedPerUnit ?? 0;
pRO.ApprovedFLSWeeklyString = String.Format("{0:0.00}", pRO.ApprovedFLSWeekly);
}
@@ -83,16 +73,6 @@ namespace BeWo.SprungbrettTheresia.Alt
xrPanel2Amounts.Visible = false;
xrPanel3Amounts.Visible = false;
xrPanel1Amount.Visible = true;
cellStart1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodStart);
cellEnde1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodEnd);
cellStundensatz1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].AmountPerUnit);
cellFLS1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].UnitCount);
pRO.AccountingStartDateString = cellStart1.Text;
pRO.AccountingEndDateString = cellEnde1.Text;
pRO.HourlyRateNewString = cellStundensatz1.Text;
pRO.RecordedFLSWithNewHourlyRateString = cellFLS1.Text;
pRO.AmountTotalWithNewHourlyRate = pRO.InvoiceItems[0].AmountTotal;
var weeks = BerechneWochen(pRO.InvoiceItems[0].ItemPeriodStart, pRO.InvoiceItems[0].ItemPeriodEnd);
@@ -106,27 +86,6 @@ namespace BeWo.SprungbrettTheresia.Alt
xrPanel2Amounts.Visible = true;
xrPanel3Amounts.Visible = false;
xrPanel1Amount.Visible = false;
cellStart1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodStart);
cellEnde1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodEnd);
cellStundensatz1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].AmountPerUnit);
cellFLS1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].UnitCount);
cellStart2.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[1].ItemPeriodStart);
cellEnde2.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[1].ItemPeriodEnd);
cellStundensatz2.Text = String.Format("{0:0.00}", pRO.InvoiceItems[1].AmountPerUnit);
cellFLS2.Text = String.Format("{0:0.00}", pRO.InvoiceItems[1].UnitCount);
pRO.AccountingStartDateString = cellStart1.Text;
pRO.HourlyRateOldEndDateString = cellEnde1.Text;
pRO.HourlyRateOldString = cellStundensatz1.Text;
pRO.RecordedFLSWithOldHourlyRateString = cellFLS1.Text;
pRO.AmountTotalWithOldHourlyRate = pRO.InvoiceItems[0].AmountTotal;
pRO.HourlyRateNewStartDateString = cellStart2.Text;
pRO.AccountingEndDateString = cellEnde2.Text;
pRO.HourlyRateNewString = cellStundensatz2.Text;
pRO.RecordedFLSWithNewHourlyRateString = cellFLS2.Text;
pRO.AmountTotalWithNewHourlyRate = pRO.InvoiceItems[1].AmountTotal;
var weeks = BerechneWochen(pRO.InvoiceItems[0].ItemPeriodStart, pRO.InvoiceItems[0].ItemPeriodEnd);
@@ -143,39 +102,8 @@ namespace BeWo.SprungbrettTheresia.Alt
xrPanel3Amounts.Visible = true;
xrPanel2Amounts.Visible = false;
xrPanel1Amount.Visible = false;
cellStart1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodStart);
cellEnde1.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[0].ItemPeriodEnd);
cellStundensatz1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].AmountPerUnit);
cellFLS1.Text = String.Format("{0:0.00}", pRO.InvoiceItems[0].UnitCount);
cellStart2.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[1].ItemPeriodStart);
cellEnde2.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[1].ItemPeriodEnd);
cellStundensatz2.Text = String.Format("{0:0.00}", pRO.InvoiceItems[1].AmountPerUnit);
cellFLS2.Text = String.Format("{0:0.00}", pRO.InvoiceItems[1].UnitCount);
cellStart3.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[2].ItemPeriodStart);
cellEnde3.Text = String.Format("{0:dd.MM.yyyy}", pRO.InvoiceItems[2].ItemPeriodEnd);
cellStundensatz3.Text = String.Format("{0:0.00}", pRO.InvoiceItems[2].AmountPerUnit);
cellFLS3.Text = String.Format("{0:0.00}", pRO.InvoiceItems[2].UnitCount);
pRO.AccountingStartDateString = cellStart1.Text;
pRO.HourlyRate3EndDateString = cellEnde1.Text;
pRO.HourlyRate3String = cellStundensatz1.Text;
pRO.RecordedFLSWithHourlyRate3String = cellFLS1.Text;
pRO.AmountTotalWithHourlyRate3 = pRO.InvoiceItems[0].AmountTotal ?? 0;
pRO.HourlyRateOldStartDateString = cellStart2.Text;
pRO.HourlyRateOldEndDateString = cellEnde2.Text;
pRO.HourlyRateOldString = cellStundensatz2.Text;
pRO.RecordedFLSWithOldHourlyRateString = cellFLS2.Text;
pRO.AmountTotalWithOldHourlyRate = pRO.InvoiceItems[1].AmountTotal;
pRO.HourlyRateNewStartDateString = cellStart3.Text;
pRO.AccountingEndDateString = cellEnde3.Text;
pRO.HourlyRateNewString = cellStundensatz3.Text;
pRO.RecordedFLSWithNewHourlyRateString = cellFLS3.Text;
pRO.AmountTotalWithNewHourlyRate = pRO.InvoiceItems[2].AmountTotal;
var weeks = BerechneWochen(pRO.InvoiceItems[0].ItemPeriodStart, pRO.InvoiceItems[0].ItemPeriodEnd);
@@ -199,13 +127,9 @@ namespace BeWo.SprungbrettTheresia.Alt
if (itemPeriodStart.HasValue && itemPeriodEnd.HasValue)
{
var days = (decimal)itemPeriodEnd.Value.Subtract(itemPeriodStart.Value).TotalDays + 1;
return Math.Round(days * 0.1427m, 2);
return Math.Round(days * 0.1427m, 2);
}
return null;
}
}
}

File diff suppressed because one or more lines are too long

View File

@@ -63,6 +63,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Budgetnachweis.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Budgetnachweis.designer.cs">
<DependentUpon>Budgetnachweis.cs</DependentUpon>
</Compile>
<Compile Include="CustomerDataReport.cs">
<SubType>Component</SubType>
</Compile>
@@ -92,18 +98,6 @@
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
</Compile>
<Compile Include="SettlementInvoiceCreation.cs" />
<Compile Include="SettlementReport.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SettlementReport.Designer.cs">
<DependentUpon>SettlementReport.cs</DependentUpon>
</Compile>
<Compile Include="Budgetnachweis.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Budgetnachweis.Designer.cs">
<DependentUpon>Budgetnachweis.cs</DependentUpon>
</Compile>
<Compile Include="BudgetnachweisSeite2.cs">
<SubType>Component</SubType>
</Compile>
@@ -112,6 +106,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Budgetnachweis.resx">
<DependentUpon>Budgetnachweis.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomerDataReport.resx">
<DependentUpon>CustomerDataReport.cs</DependentUpon>
<SubType>Designer</SubType>
@@ -128,14 +125,6 @@
<EmbeddedResource Include="ServicesOverviewReport.resx">
<DependentUpon>ServicesOverviewReport.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SettlementReport.resx">
<DependentUpon>SettlementReport.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Budgetnachweis.resx">
<DependentUpon>Budgetnachweis.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="BudgetnachweisSeite2.resx">
<DependentUpon>BudgetnachweisSeite2.cs</DependentUpon>
<SubType>Designer</SubType>