PraxisPusteblume/Invoicing/IFSSammelInvoiceCreation.cs - Neue Leistungen - Gruppe Interdisziplinär und Team Vernetzung - Finish

This commit is contained in:
2025-09-26 12:13:01 +02:00
parent abb30a3ebe
commit 7d36d7bdef
3 changed files with 106 additions and 38 deletions

View File

@@ -38,6 +38,8 @@ namespace PraxisPusteblume
this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
this.ruleRateFactorNull = new DevExpress.XtraReports.UI.FormattingRule();
this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand();
this.xrRichText3 = new DevExpress.XtraReports.UI.XRRichText();
this.xrRichText1 = new DevExpress.XtraReports.UI.XRRichText();
this.rtKopfIfs = new DevExpress.XtraReports.UI.XRRichText();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.rtFussIfs = new DevExpress.XtraReports.UI.XRRichText();
@@ -114,19 +116,17 @@ namespace PraxisPusteblume
this.fieldGruppe = new DevExpress.XtraReports.UI.CalculatedField();
this.GroupFooter2 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.xrRichText4 = new DevExpress.XtraReports.UI.XRRichText();
this.xrRichText1 = new DevExpress.XtraReports.UI.XRRichText();
this.xrRichText3 = new DevExpress.XtraReports.UI.XRRichText();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.lblEinrichtung)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rtKopfIfs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rtFussIfs)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
@@ -188,6 +188,22 @@ namespace PraxisPusteblume
this.topMarginBand1.HeightF = 205F;
this.topMarginBand1.Name = "topMarginBand1";
//
// xrRichText3
//
this.xrRichText3.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
this.xrRichText3.LocationFloat = new DevExpress.Utils.PointFloat(639.7494F, 27.16669F);
this.xrRichText3.Name = "xrRichText3";
this.xrRichText3.SerializableRtfString = resources.GetString("xrRichText3.SerializableRtfString");
this.xrRichText3.SizeF = new System.Drawing.SizeF(303.9965F, 36.85409F);
//
// xrRichText1
//
this.xrRichText1.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
this.xrRichText1.LocationFloat = new DevExpress.Utils.PointFloat(639.7495F, 103.6041F);
this.xrRichText1.Name = "xrRichText1";
this.xrRichText1.SerializableRtfString = resources.GetString("xrRichText1.SerializableRtfString");
this.xrRichText1.SizeF = new System.Drawing.SizeF(303.9965F, 54.16667F);
//
// rtKopfIfs
//
this.rtKopfIfs.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
@@ -627,6 +643,8 @@ namespace PraxisPusteblume
//
this.xrTableCell15.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovalPeriod")});
this.xrTableCell15.Name = "xrTableCell15";
this.xrTableCell15.StylePriority.UseBorders = false;
this.xrTableCell15.Weight = 0.08720205014077366D;
@@ -635,6 +653,8 @@ namespace PraxisPusteblume
//
this.xrTableCell43.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell43.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedAmount")});
this.xrTableCell43.Multiline = true;
this.xrTableCell43.Name = "xrTableCell43";
this.xrTableCell43.StylePriority.UseBorders = false;
@@ -670,19 +690,23 @@ namespace PraxisPusteblume
//
this.xrTableCell48.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell48.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.ApprovedBE")});
this.xrTableCell48.Multiline = true;
this.xrTableCell48.Name = "xrTableCell48";
this.xrTableCell48.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 3, 0, 0, 100F);
this.xrTableCell48.StylePriority.UseBorders = false;
this.xrTableCell48.StylePriority.UsePadding = false;
this.xrTableCell48.StylePriority.UseTextAlignment = false;
this.xrTableCell48.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
this.xrTableCell48.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter;
this.xrTableCell48.Weight = 0.07710687924216629D;
//
// xrTableCell49
//
this.xrTableCell49.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTableCell49.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "ServiceInvoicePeriods.Notice")});
this.xrTableCell49.Multiline = true;
this.xrTableCell49.Name = "xrTableCell49";
this.xrTableCell49.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 3, 0, 0, 100F);
@@ -967,22 +991,6 @@ namespace PraxisPusteblume
this.xrRichText4.SerializableRtfString = resources.GetString("xrRichText4.SerializableRtfString");
this.xrRichText4.SizeF = new System.Drawing.SizeF(284.2049F, 92.06244F);
//
// xrRichText1
//
this.xrRichText1.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
this.xrRichText1.LocationFloat = new DevExpress.Utils.PointFloat(639.7495F, 103.6041F);
this.xrRichText1.Name = "xrRichText1";
this.xrRichText1.SerializableRtfString = resources.GetString("xrRichText1.SerializableRtfString");
this.xrRichText1.SizeF = new System.Drawing.SizeF(303.9965F, 54.16667F);
//
// xrRichText3
//
this.xrRichText3.Font = new DevExpress.Drawing.DXFont("Verdana", 10F);
this.xrRichText3.LocationFloat = new DevExpress.Utils.PointFloat(639.7494F, 27.16669F);
this.xrRichText3.Name = "xrRichText3";
this.xrRichText3.SerializableRtfString = resources.GetString("xrRichText3.SerializableRtfString");
this.xrRichText3.SizeF = new System.Drawing.SizeF(303.9965F, 36.85409F);
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);
@@ -1016,14 +1024,14 @@ namespace PraxisPusteblume
this.Watermarks.Add(xrWatermark1);
((System.ComponentModel.ISupportInitialize)(this.lblEinrichtung)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rtKopfIfs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rtFussIfs)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();

View File

@@ -112,6 +112,10 @@ namespace PraxisPusteblume
decimal teamPreis = 0;
decimal investStunden = 0;
decimal investPreis = 0;
decimal gruppeInterStunden = 0;
decimal gruppeInterPreis = 0;
decimal vernetzungStunden = 0;
decimal vernetzungPreis = 0;
if (sip.ServiceInvoiceItems != null && sip.ServiceInvoiceItems.Count > 0)
{
@@ -131,6 +135,16 @@ namespace PraxisPusteblume
investPreis += i.NetAmount ?? 0;
investStunden += i.UnitCount ?? 0;
}
else if (i.ServiceDescription.Contains("Vernetzung"))
{
vernetzungPreis += i.NetAmount ?? 0;
vernetzungStunden = 1;
}
else if (i.ServiceDescription.ToLower().Contains("interd"))
{
gruppeInterPreis += GetGrossAmount(i);
gruppeInterStunden += i.UnitCount ?? 0;
}
else if (i.ServiceDescription.Contains("Gruppe"))
{
gruppePreis += GetGrossAmount(i);
@@ -164,9 +178,12 @@ namespace PraxisPusteblume
newItem.UnitCountString = String.Format("{0:c}", teamPreis);
newItem.UnitDescription = String.Format("{0:0.##}", investStunden);
sip.NotBillableString = String.Format("{0:c}", investPreis);
sip.ApprovalPeriod = String.Format("{0:0.##}", gruppeInterStunden);
sip.ApprovedAmount = String.Format("{0:c}", gruppeInterPreis);
sip.ApprovedBE = String.Format("{0:0.##}", vernetzungStunden);
sip.Notice = String.Format("{0:c}", vernetzungPreis);
return newItem;
return newItem;
}
private decimal GetGrossAmount(ServiceInvoiceItemRO ii)
@@ -226,12 +243,11 @@ namespace PraxisPusteblume
preisInvest = GetPreis(preise, "Invest (MQ)", pRO.AccountingPeriodStart);
preisTeam = GetPreis(preise, "Team", pRO.AccountingPeriodStart);
}
if (pRO.AccountingPeriodStart >= new DateTime(2025, 08, 01))
if (pRO.AccountingPeriodStart >= new DateTime(2025, 09, 01))
{
var preise = DAOFactory.GenericDAO.GetAllActive<Preis>();
preisGruppe = GetPreis(preise, "Gruppe", pRO.AccountingPeriodStart);
preisGruppeInter = GetPreis(preise, "Gruppe Interdisziplinär", pRO.AccountingPeriodStart);
preisVernetzung = GetPreis(preise, "Team Vernetzung", pRO.AccountingPeriodStart);
preisGruppeInter = 42.18m;
}
var cat = DAOFactory.SearchDAO.FindServiceCategoryByName("IFS - Psychologie / Heilpädagogik");
@@ -261,7 +277,8 @@ namespace PraxisPusteblume
preisAmbulant = crp.CostRateValue.Value;
}
}
var gruppe = sdList.FirstOrDefault(s => s.Name.Contains("Gruppe"));
var gruppe = sdList.FirstOrDefault(s => s.Name.Contains("(G)") || (s.Name.Contains("Gruppe") && !s.Name.Contains("IG")));
var gruppeInter = sdList.FirstOrDefault(s => s.Name.Contains("(IG)"));
if (gruppe != null && ambulant.CostRatePeriods != null)
{
var crpList = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(gruppe.CostRatePeriods);
@@ -271,7 +288,17 @@ namespace PraxisPusteblume
{
preisGruppe = crp.CostRateValue.Value;
}
}
}
if (gruppeInter != null && ambulant.CostRatePeriods != null)
{
var crpList = MapperFactory.CostRatePeriodDC_CostRatePeriod.MapToNewDCs(gruppeInter.CostRatePeriods);
CostRatePeriodDC crp = crpList.GetCostRatePeriodForDate(CostRatePeriodType.AmountOfMoney, pRO.AccountingPeriodStart);
if (crp != null && crp.CostRateValue.HasValue)
{
preisGruppeInter = crp.CostRateValue.Value;
}
}
}
cellPreisAmbulant.Text = String.Format("{0:c}", preisAmbulant);

View File

@@ -91,10 +91,7 @@ namespace PraxisPusteblume.Invoicing
{
serviceInvoicePeriod.InvoiceItemList.Add(item);
}
}
if (serviceInvoicePeriod.InvoiceItemList != null && serviceInvoicePeriod.InvoiceItemList.Count > 0)
{
decimal count = 0;
foreach (var ii in serviceInvoicePeriod.InvoiceItemList)
{
@@ -103,12 +100,41 @@ namespace PraxisPusteblume.Invoicing
if (count > 0)
{
var item = CreateInvestInvoiceItem(scap, invoicePeriod, count);
serviceInvoicePeriod.InvoiceItemList.Add(item);
var itemInvest = CreateInvestInvoiceItem(scap, invoicePeriod, count, invoice.InvoiceBase.RecipientOrganisation);
if (itemInvest != null)
{
serviceInvoicePeriod.InvoiceItemList.Add(itemInvest);
}
}
}
List<int> vernetzung = new List<int> { 2, 3, 5, 9, 12 };
if (invoicePeriod.StartDateTime >= new DateTime(2025, 09, 01) && vernetzung.Contains(invoicePeriod.EndDate.Month))
{
var itemVernetzung = CreateVernetzungInvoiceItem(scap, invoicePeriod);
if (itemVernetzung != null)
{
serviceInvoicePeriod.InvoiceItemList.Add(itemVernetzung);
}
}
}
}
private InvoiceItem CreateVernetzungInvoiceItem(SupportConceptApprovalPeriodDC scap, DateTimeSpan invoicePeriod)
{
var preisVernetzung = base.GetPreis("Team Vernetzung", invoicePeriod.StartDate);
var invoiceItem = new InvoiceItem();
invoiceItem.AmountPerUnit = preisVernetzung;
invoiceItem.UnitCount = 1;
invoiceItem.AmountTotal = invoiceItem.AmountPerUnit;
invoiceItem.RateFactor = null;
invoiceItem.ItemPeriodStart = invoicePeriod.StartDate;
invoiceItem.ItemPeriodEnd = invoicePeriod.EndDate;
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
invoiceItem.ItemDescription = String.Format("Team Vernetzung");
if (scap != null)
invoiceItem.SupportConceptApprovalPeriodOid = scap.SupportConceptApprovalPeriodOid;
return invoiceItem;
}
private InvoiceItem CreateTeamSitzungInvoiceItem(SupportConceptApprovalPeriodDC scap, DateTimeSpan invoicePeriod)
@@ -161,7 +187,7 @@ namespace PraxisPusteblume.Invoicing
}
private InvoiceItem CreateInvestInvoiceItem(SupportConceptApprovalPeriodDC scap, DateTimeSpan invoicePeriod, decimal count)
private InvoiceItem CreateInvestInvoiceItem(SupportConceptApprovalPeriodDC scap, DateTimeSpan invoicePeriod, decimal count, string costBearerName)
{
decimal betrag = 4.84m;
@@ -173,6 +199,13 @@ namespace PraxisPusteblume.Invoicing
{
betrag = base.GetPreis("Invest (MQ)", invoicePeriod.StartDate);
}
if (invoicePeriod.StartDateTime >= new DateTime(2024, 09, 01))
{
if (costBearerName.Contains("(TS"))
{
betrag = base.GetPreis("Invest (TS)", invoicePeriod.StartDate);
}
}
var invoiceItem = new InvoiceItem();
invoiceItem.AmountPerUnit = betrag;