MH: HiBa Niedersachsen Zeug
This commit is contained in:
@@ -93,11 +93,11 @@ namespace Hiba
|
||||
}
|
||||
}
|
||||
|
||||
// Klären, wann QB genommen werden soll
|
||||
//if (ro.StartDate >= new DateTime(2023, 10, 01))
|
||||
// report = new Quittierungsbeleg();
|
||||
//else
|
||||
report = new Stundenzettel();
|
||||
// Klären, wann QB genommen werden soll
|
||||
if (ro.StartDate >= new DateTime(2024, 07, 01))
|
||||
report = new Quittierungsbeleg();
|
||||
else
|
||||
report = new Stundenzettel();
|
||||
|
||||
report.SetReportDataSource(ro);
|
||||
|
||||
|
||||
@@ -142,14 +142,18 @@ namespace Hiba
|
||||
//}
|
||||
}
|
||||
|
||||
// Fällt ab 01.01.2024 weg
|
||||
InvoiceItem ttii = CreateFahrkostenZonenInvoiceItem(serviceRecordsInPeriod, scap, calc);
|
||||
// Fällt ab 01.07.2024 weg
|
||||
InvoiceItem ttii = CreateFahrkostenZonenInvoiceItem(serviceRecordsInPeriod.Where(s => s.Start.HasValue && s.Start.Value.Date < new DateTime(2024, 07, 01)).ToList(), scap, calc);
|
||||
if (ttii != null)
|
||||
list.Add(ttii);
|
||||
|
||||
//InvoiceItem fahrtkostenAb2024 = CreateFahrkostenInvoiceItemAb2024(serviceRecordsInPeriod, scap, calc);
|
||||
//if (fahrtkostenAb2024 != null)
|
||||
// list.Add(fahrtkostenAb2024);
|
||||
InvoiceItem fahrtkostenQualifiziert = CreateFahrkostenInvoiceItemAb2024(serviceRecordsInPeriod.Where(s => s.ServiceDescription.Category.Name.ToLower().Contains("qualifiziert") || s.ServiceDescription.Name.ToLower().Contains("qualifiziert")).ToList(), scap, calc);
|
||||
if (fahrtkostenQualifiziert != null)
|
||||
list.Add(fahrtkostenQualifiziert);
|
||||
InvoiceItem fahrtkostenKompensatorisch = CreateFahrkostenInvoiceItemAb2024(serviceRecordsInPeriod.Where(s => s.ServiceDescription.Category.Name.ToLower().Contains("kompensatorisch") || s.ServiceDescription.Name.ToLower().Contains("kompensatorisch")).ToList(), scap, calc);
|
||||
if (fahrtkostenKompensatorisch != null)
|
||||
list.Add(fahrtkostenKompensatorisch);
|
||||
|
||||
|
||||
//list = list.OrderBy(ii => ii.ItemPeriodStart).ToList();
|
||||
|
||||
@@ -295,7 +299,8 @@ namespace Hiba
|
||||
|
||||
private InvoiceItem CreateFahrkostenInvoiceItemAb2024(List<ServiceRecordDC> serviceRecordsInPeriod, SupportConceptApprovalPeriod scap, Calculations calc)
|
||||
{
|
||||
decimal anzahlFahrtkostenAb2024 = 0;
|
||||
decimal anzahlFahrtkostenQualifiziert = 0;
|
||||
decimal anzahlFahrtkostenKompensatorisch = 0;
|
||||
|
||||
if (!accountingPeriodStart.HasValue)
|
||||
accountingPeriodStart = scap.StartDate;
|
||||
@@ -304,36 +309,72 @@ namespace Hiba
|
||||
|
||||
foreach (var sr in serviceRecordsInPeriod)
|
||||
{
|
||||
if (sr.DistanceInMeter.HasValue && sr.DistanceInMeter.Value > 0)
|
||||
if (DarfPauschaleAnfallen(sr))
|
||||
{
|
||||
if (sr.GroupPersonCount != null && sr.GroupPersonCount.HasValue)
|
||||
if (sr.ServiceDescription.Name.ToLower().Contains("kompensatorisch"))
|
||||
{
|
||||
decimal count = sr.GroupPersonCount.Value;
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 01, 01))
|
||||
anzahlFahrtkostenAb2024 += 1 / count;
|
||||
if (sr.GroupPersonCount != null && sr.GroupPersonCount.HasValue)
|
||||
{
|
||||
decimal count = sr.GroupPersonCount.Value;
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 07, 01))
|
||||
anzahlFahrtkostenKompensatorisch += 1 / count;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 07, 01))
|
||||
anzahlFahrtkostenKompensatorisch += 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 01, 01))
|
||||
anzahlFahrtkostenAb2024 += 1;
|
||||
if (sr.GroupPersonCount != null && sr.GroupPersonCount.HasValue)
|
||||
{
|
||||
decimal count = sr.GroupPersonCount.Value;
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 07, 01))
|
||||
anzahlFahrtkostenQualifiziert += 1 / count;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sr.Start.HasValue && sr.Start.Value.Date >= new DateTime(2024, 07, 01))
|
||||
anzahlFahrtkostenQualifiziert += 1;
|
||||
}
|
||||
}
|
||||
sr.DistanceInMeter = 0;
|
||||
|
||||
sr.DistanceInMeter = 0; // Verhindern, dass bei erneutem Aufruf doppelt Fahrtkosten abgerechnet werden
|
||||
}
|
||||
}
|
||||
|
||||
var customer = scap.CostBearer2SupportConcept.SupportConcept.Customer;
|
||||
if (anzahlFahrtkostenAb2024 > 0)
|
||||
if (anzahlFahrtkostenQualifiziert > 0)
|
||||
{
|
||||
var invoiceItem = new InvoiceItem();
|
||||
invoiceItem.AmountPerUnit = GetFahrtkosten(customer);
|
||||
//invoiceItem.AmountPerUnit = GetPauschale();
|
||||
invoiceItem.UnitCount = Math.Round(anzahlFahrtkostenAb2024, 2, MidpointRounding.AwayFromZero);
|
||||
//invoiceItem.AmountPerUnit = GetFahrtkosten(customer);
|
||||
invoiceItem.AmountPerUnit = GetPauschale("Fahrtkostenpauschale qualifizierte Assistenz", accountingPeriodStart.Value);
|
||||
invoiceItem.UnitCount = Math.Round(anzahlFahrtkostenQualifiziert, 2, MidpointRounding.AwayFromZero);
|
||||
invoiceItem.AmountTotal = invoiceItem.UnitCount * invoiceItem.AmountPerUnit;
|
||||
invoiceItem.RateFactor = null;
|
||||
invoiceItem.ItemPeriodStart = accountingPeriodStart;
|
||||
invoiceItem.ItemPeriodEnd = accountingPeriodEnd;
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
|
||||
invoiceItem.ItemDescription = String.Format("Wegezeitenpauschale");
|
||||
invoiceItem.ItemDescription = String.Format("Wegezeitenpauschale qual. Assistenz");
|
||||
invoiceItem.UnitDescription = String.Format("Pauschalsatz");
|
||||
if (scap != null)
|
||||
invoiceItem.SupportConceptApprovalPeriodOid = scap.Oid;
|
||||
|
||||
return invoiceItem;
|
||||
}
|
||||
if (anzahlFahrtkostenKompensatorisch > 0)
|
||||
{
|
||||
var invoiceItem = new InvoiceItem();
|
||||
//invoiceItem.AmountPerUnit = GetFahrtkosten(customer);
|
||||
invoiceItem.AmountPerUnit = GetPauschale("Fahrtkostenpauschale kompensatorische Assistenz", accountingPeriodStart.Value);
|
||||
invoiceItem.UnitCount = Math.Round(anzahlFahrtkostenKompensatorisch, 2, MidpointRounding.AwayFromZero);
|
||||
invoiceItem.AmountTotal = invoiceItem.UnitCount * invoiceItem.AmountPerUnit;
|
||||
invoiceItem.RateFactor = null;
|
||||
invoiceItem.ItemPeriodStart = accountingPeriodStart;
|
||||
invoiceItem.ItemPeriodEnd = accountingPeriodEnd;
|
||||
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
|
||||
invoiceItem.ItemDescription = String.Format("Wegezeitenpauschale komp. Assistenz");
|
||||
invoiceItem.UnitDescription = String.Format("Pauschalsatz");
|
||||
if (scap != null)
|
||||
invoiceItem.SupportConceptApprovalPeriodOid = scap.Oid;
|
||||
@@ -373,9 +414,20 @@ namespace Hiba
|
||||
return 0;
|
||||
}
|
||||
|
||||
private decimal? GetPauschale()
|
||||
private decimal? GetPauschale(string art, DateTime datum)
|
||||
{
|
||||
return 0;
|
||||
return GetPreis(art, datum);
|
||||
}
|
||||
private bool DarfPauschaleAnfallen(ServiceRecordDC sr)
|
||||
{
|
||||
if (sr.DistanceInMeter.HasValue && sr.DistanceInMeter.Value > 0 &&
|
||||
(sr.ServiceDescription.Category.Name.ToLower().Contains("qualifiziert") || sr.ServiceDescription.Category.Name.ToLower().Contains("kompensatorisch") ||
|
||||
sr.ServiceDescription.Name.ToLower().Contains("qualifiziert") || sr.ServiceDescription.Name.ToLower().Contains("kompensatorisch")))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
ReportImp/Hiba/Quittierungsbeleg.Designer.cs
generated
4
ReportImp/Hiba/Quittierungsbeleg.Designer.cs
generated
@@ -277,7 +277,7 @@ namespace Hiba
|
||||
//
|
||||
this.GroupHeader1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
|
||||
this.xrTableServiceRecords1});
|
||||
this.GroupHeader1.HeightF = 136.1859F;
|
||||
this.GroupHeader1.HeightF = 34.10257F;
|
||||
this.GroupHeader1.Name = "GroupHeader1";
|
||||
this.GroupHeader1.RepeatEveryPage = true;
|
||||
//
|
||||
@@ -290,7 +290,7 @@ namespace Hiba
|
||||
this.xrTableServiceRecords1.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
|
||||
this.xrTableServiceRecords1.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
|
||||
this.xrTableRow2});
|
||||
this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(1108F, 136.1859F);
|
||||
this.xrTableServiceRecords1.SizeF = new System.Drawing.SizeF(1108F, 34.10257F);
|
||||
this.xrTableServiceRecords1.StylePriority.UseBackColor = false;
|
||||
this.xrTableServiceRecords1.StylePriority.UseBorders = false;
|
||||
this.xrTableServiceRecords1.StylePriority.UseFont = false;
|
||||
|
||||
@@ -13,6 +13,7 @@ using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace Hiba
|
||||
@@ -58,7 +59,8 @@ namespace Hiba
|
||||
|
||||
// Felder für Wegepauschale setzen (Wenn Kategorie = ??? bzw. Leistung = ??? dann ja)
|
||||
// Klären, welche Kategorie/Leistung das triggert
|
||||
if (sd.ServiceCategory.ToLower().Contains("fachleistungsstunde") && sd.ServiceDescription.ToLower().Contains("face to face"))
|
||||
if ((sd.ServiceCategory.ToLower().Contains("qualifiziert") || sd.ServiceCategory.ToLower().Contains("kompensatorisch") ||
|
||||
sd.ServiceDescription.ToLower().Contains("qualifiziert") || sd.ServiceDescription.ToLower().Contains("kompensatorisch")) && !sd.GefahreneKilometer.IsNullOrEmpty())
|
||||
{
|
||||
sd.Notice4 = "1";
|
||||
summeWegepauschalen++;
|
||||
|
||||
Reference in New Issue
Block a user