KontaktUndKrisenhilfeReports/Budgetnachweis Umstellung Fehlkontakte

This commit is contained in:
2023-12-13 14:45:36 +01:00
parent 6f9b95eb91
commit d0dd3fd545
3 changed files with 105 additions and 108 deletions

View File

@@ -76,7 +76,6 @@ namespace KontaktUndKrisenhilfeReports.Neu
if (!String.IsNullOrEmpty(pRO.SenderContactPersonMail))
pRO.SenderContactPersonMail = pRO.SenderContactPersonMail.Replace("E-Mail:", "").Trim();
// quick and DIRTY - solange Berechnung S2RO gemäß LVR noch die Stunden und nicht den Preis rundet
decimal RecFLS = 0;
bool Fehlkontakt = false;
foreach (var ii in pRO.InvoiceItems)
@@ -84,9 +83,16 @@ namespace KontaktUndKrisenhilfeReports.Neu
if (ii.RateFactor == 0)
{
Fehlkontakt = true;
RecFLS += (decimal)ii.UnitCount / 80 * 100;
ii.UnitCount = ii.UnitCount / 80 * 100;
ii.AmountPerUnit = ii.AmountPerUnit * 80 / 100;
if (pRO.InvoiceDate <= new DateTime(2023, 12, 1))
{
RecFLS += (decimal)ii.UnitCount / 80 * 100;
ii.UnitCount = ii.UnitCount / 80 * 100;
ii.AmountPerUnit = ii.AmountPerUnit * 80 / 100;
}
else
{
RecFLS += (decimal)ii.UnitCount;
}
}
else
{

View File

@@ -474,21 +474,25 @@ namespace KontaktUndKrisenhilfe.Invoicing
rf = ii.RateFactor.Value;
rf = (100 + rf) / 100;
}
var countMitFactor = Math.Round((ii.UnitCount ?? 0) * rf, 2, MidpointRounding.AwayFromZero);
if (maxApprovedFls < countMitFactor)
countMitFactor = maxApprovedFls;
maxApprovedFls -= countMitFactor;
ii.UnitCount = countMitFactor;
if (ii.AmountPerUnit.HasValue)
{
ii.AmountTotal = ii.UnitCount.Value * ii.AmountPerUnit.Value;
if (!String.IsNullOrEmpty(ii.ItemDescription) && ii.ItemDescription == "Fehlkontakte")
{
ii.AmountPerUnit = ii.AmountPerUnit * ii.ProzentAbrechenbar / 100;
}
else
{
ii.UnitCount = countMitFactor;
}
ii.AmountTotal = ii.UnitCount.Value * ii.AmountPerUnit.Value;
ii.GrossAmountTotal = Math.Round(ii.AmountTotal.Value, 2, MidpointRounding.AwayFromZero);
@@ -499,13 +503,11 @@ namespace KontaktUndKrisenhilfe.Invoicing
}
}
}
}
public override IList<ApprovalPeriod> CreateApprovalPeriods(Settlement2DC si, CostBearer2SupportConcept c2s)
{
var list = base.CreateApprovalPeriods(si, c2s);
return list;
}

View File

@@ -1,104 +1,93 @@
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared.Extensions;
namespace BeWo.KontaktUndKrisenhilfeReports.Neu
{
public partial class lblClaimText : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
public lblClaimText()
{
InitializeComponent();
}
public void SetReportDataSource(Settlement2RO pRO)
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using BeWo.Report.ReportObjects;
using BeWo.Report;
using BS.Shared.Extensions;
namespace BeWo.KontaktUndKrisenhilfeReports.Neu
{
public partial class lblClaimText : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<Settlement2RO>
{
public lblClaimText()
{
//decimal max = Math.Round(pRO.TotalApprovedFLSWithOldHourlyRate * (pRO.HourlyRateOld ?? 0) * pRO.RateFactor, 2, MidpointRounding.AwayFromZero);
//max += Math.Round(pRO.TotalApprovedFLSWithNewHourlyRate * (pRO.HourlyRateNew ?? 0) * pRO.RateFactor, 2, MidpointRounding.AwayFromZero);
//max += Math.Round(pRO.TotalApprovedFLSWithHourlyRate3 * pRO.HourlyRate3 * pRO.RateFactor, 2, MidpointRounding.AwayFromZero);
//max = Math.Round(max, 2, MidpointRounding.AwayFromZero);
InitializeComponent();
}
//if (Math.Round(pRO.AmountRecordedFLS, 2, MidpointRounding.AwayFromZero) > max)
//{
// decimal diff = pRO.AmountRecordedFLS - max;
// pRO.AmountRecordedFLS = max;
// pRO.ClaimWithEigenbeteiligung -= diff;
//}
public void SetReportDataSource(Settlement2RO pRO)
{
if (pRO.RecipientOrganisation.Contains("LVR"))
{
xrRichText3.Text = "";
}
if (!(pRO.Claim < 0))
{
lblClaim.Text = "Betrag:";
}
string period = null;
string betrag = null;
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
var days = ii.PeriodEndDate.Value.Subtract(ii.PeriodStartDate.Value).TotalDays + 1;
decimal weeks = (decimal)days * 0.1427m;
ii.UnitDescription = String.Format("{0:0.00}", weeks);
ii.MaxApprovedUnitCount = Math.Round(weeks, 2, MidpointRounding.AwayFromZero) * ii.ApprovedPerUnit;
if (!ii.MaxApprovedAmount.HasValue)
{
ii.MaxApprovedAmount =
Math.Round(weeks, 2, MidpointRounding.AwayFromZero) * ii.ApprovedPerUnit * ii.AmountPerUnit;
}
decimal rateFactor = 1;
if (ii.RateFactor.HasValue)
{
rateFactor = (100 + ii.RateFactor.Value) / 100;
}
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
{
Zwischensumme.Visible = true;
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
ii.ItemDescription = "Fehlkontakte";
ii.UnitCount = ii.UnitCount / 80 * 100;
ii.AmountPerUnit = ii.AmountPerUnit * 80 / 100;
}
if (ii.RateFactor != 0)
{
if (period != null)
{
period += " \n";
}
period += string.Format("mit {0:0.00} Std. von {1:dd.MM.yyyy} bis {2:dd.MM.yyyy} ({3} Wo) a {4:0.00} € ({5:0.00} FLS) =",
ii.ApprovedPerUnit, ii.PeriodStartDate, ii.PeriodEndDate, ii.UnitDescription, ii.AmountPerUnit, ii.MaxApprovedUnitCount);
if (betrag != null)
{
betrag += " \n";
}
betrag += string.Format("{0:c2}", ii.MaxApprovedAmount);
}
else if (ii.ItemDescription.IsNullOrEmpty())
{
ii.ItemDescription = "Fachleistungsstunden";
}
}
}
lblBetrag.Text = betrag;
lblPeriode.Text = period;
this.bindingSource1.DataSource = pRO;
}
}
}
if (!(pRO.Claim < 0))
{
lblClaim.Text = "Betrag:";
}
string period = null;
string betrag = null;
if (pRO.InvoiceItems != null)
{
foreach (var ii in pRO.InvoiceItems)
{
var days = ii.PeriodEndDate.Value.Subtract(ii.PeriodStartDate.Value).TotalDays + 1;
decimal weeks = (decimal)days * 0.1427m;
ii.UnitDescription = String.Format("{0:0.00}", weeks);
ii.MaxApprovedUnitCount = Math.Round(weeks, 2, MidpointRounding.AwayFromZero) * ii.ApprovedPerUnit;
if (!ii.MaxApprovedAmount.HasValue)
{
ii.MaxApprovedAmount = Math.Round(weeks, 2, MidpointRounding.AwayFromZero) * ii.ApprovedPerUnit * ii.AmountPerUnit;
}
decimal rateFactor = 1;
if (ii.RateFactor.HasValue)
{
rateFactor = (100 + ii.RateFactor.Value) / 100;
}
if (!pRO.FehlkontakteString.IsNullOrEmpty() && ii.RateFactor == 0)
{
Zwischensumme.Visible = true;
ii.AbrechnungsText = ii.AbrechnungsText.Replace("FLS", "Std.");
ii.ItemDescription = "Fehlkontakte";
if (pRO.InvoiceDate <= new DateTime(2023, 12, 1))
{
ii.UnitCount = ii.UnitCount / 80 * 100;
ii.AmountPerUnit = ii.AmountPerUnit * 80 / 100;
}
}
if (ii.RateFactor != 0)
{
if (period != null)
{
period += " \n";
}
period += string.Format("mit {0:0.00} Std. von {1:dd.MM.yyyy} bis {2:dd.MM.yyyy} ({3} Wo) a {4:0.00} € ({5:0.00} FLS) =",
ii.ApprovedPerUnit, ii.PeriodStartDate, ii.PeriodEndDate, ii.UnitDescription, ii.AmountPerUnit, ii.MaxApprovedUnitCount);
if (betrag != null)
{
betrag += " \n";
}
betrag += string.Format("{0:c2}", ii.MaxApprovedAmount);
}
else if (ii.ItemDescription.IsNullOrEmpty())
{
ii.ItemDescription = "Fachleistungsstunden";
}
}
}
lblBetrag.Text = betrag;
lblPeriode.Text = period;
this.bindingSource1.DataSource = pRO;
}
}
}