MH: Alzey diverse Anpassungen

This commit is contained in:
2023-09-22 14:49:48 +02:00
parent 4926c0b4f1
commit b938b05d06
6 changed files with 175 additions and 90 deletions

View File

@@ -61,6 +61,7 @@
<DependentUpon>RechnungPa.cs</DependentUpon>
</Compile>
<Compile Include="Service\CustomAccountingService.cs" />
<Compile Include="Service\CustomSaveInterceptor.cs" />
<Compile Include="StundenzettelBi2.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -75,6 +75,72 @@ namespace AlzeyTeilhabe.Invoicing
return result.Count > 1 ? result.OrderBy(i => i.InvoiceBase.CustomerLastName).ToList() : result;
}
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod,
CompactSupportConceptDC supportConcept, List<ServiceRecordDC> serviceRecords)
{
var s = base.CreateSingleInvoice(invoiceCounter, costBearer, invoicePeriod, supportConcept, serviceRecords);
SetAmountEquityContribution(s);
if (s.AmountEquityContribution != null && s.AmountEquityContribution != 0)
{
foreach (var sipl in s.ServiceInvoicePeriodList)
{
if (sipl == s.ServiceInvoicePeriodList.Last())
{
sipl.InvoiceItemList.Add(new InvoiceItem()
{
AmountPerUnit = s.AmountEquityContribution.Value,
AmountTotal = s.AmountEquityContribution.Value,
GrossAmountTotal = s.AmountEquityContribution.Value,
ItemDescription = "Eigenanteil",
ItemPeriodStart = sipl.Start,
ItemPeriodEnd = sipl.End,
RateFactor = null,
UnitCount = 1,
UnitDescription = "Eigenanteil"
});
}
}
}
return s;
}
public override void SetAmountEquityContribution(ServiceInvoice invoice)
{
decimal equity = 0;
IList<InvoiceBase> EquityInvoiceList =
DAOFactory.SearchDAO.GetInvoiceBaseByTypeAndSupportConceptOid(InvoiceType.CustomerEquity, invoice.InvoiceBase.SupportConceptOid.Value);
var list = new List<InvoiceBase>();
foreach (var ib in EquityInvoiceList)
{
if (ib.AccountingPeriodStart.HasValue && ib.AccountingPeriodEnd.HasValue)
{
if (ib.AccountingPeriodStart <= invoice.InvoiceBase.AccountingPeriodEnd &&
ib.AccountingPeriodEnd >= invoice.InvoiceBase.AccountingPeriodStart)
{
list.Add(ib);
}
}
}
foreach (InvoiceBase iEquityInvoice in list)
{
foreach (InvoiceItem item in iEquityInvoice.InvoiceItems)
{
if (item.AmountTotal != null)
{
equity += item.AmountTotal.Value;
}
}
}
invoice.AmountEquityContribution = equity;
}
public override IList<InvoiceItem> CreateSummaryInvoiceItems(IList<InvoiceItem> itemList, DateTimeSpan invoicePeriod, SupportConceptApprovalPeriod scap,
Calculations calc)
{

View File

@@ -54,6 +54,7 @@ namespace AlzeyTeilhabe
this.xrPictureBox3 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrRichText2 = new DevExpress.XtraReports.UI.XRRichText();
this.Page1 = new DevExpress.XtraReports.UI.GroupHeaderBand();
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell1 = new DevExpress.XtraReports.UI.XRTableCell();
@@ -89,7 +90,6 @@ namespace AlzeyTeilhabe
this.xrLabel10 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel6 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel8 = new DevExpress.XtraReports.UI.XRLabel();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit();
@@ -333,6 +333,19 @@ namespace AlzeyTeilhabe
this.Page1.Name = "Page1";
this.Page1.StylePriority.UseFont = false;
//
// xrLabel8
//
this.xrLabel8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "AccountingPeriodEnd", "{0:dd.MM.yyyy}")});
this.xrLabel8.Font = new System.Drawing.Font("Arial", 12F);
this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(419.7223F, 263.9127F);
this.xrLabel8.Name = "xrLabel8";
this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel8.SizeF = new System.Drawing.SizeF(257.2777F, 19.99994F);
this.xrLabel8.StylePriority.UseFont = false;
this.xrLabel8.StylePriority.UseTextAlignment = false;
this.xrLabel8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// xrTable1
//
this.xrTable1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@@ -734,18 +747,6 @@ namespace AlzeyTeilhabe
this.xrLabel1.StylePriority.UseTextAlignment = false;
this.xrLabel1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
//
// xrLabel8
//
this.xrLabel8.Font = new System.Drawing.Font("Arial", 12F);
this.xrLabel8.LocationFloat = new DevExpress.Utils.PointFloat(419.7223F, 263.9127F);
this.xrLabel8.Name = "xrLabel8";
this.xrLabel8.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel8.SizeF = new System.Drawing.SizeF(257.2777F, 19.99994F);
this.xrLabel8.StylePriority.UseFont = false;
this.xrLabel8.StylePriority.UseTextAlignment = false;
this.xrLabel8.Text = "[InvoiceDate]";
this.xrLabel8.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServiceInvoiceRO);

View File

@@ -61,6 +61,13 @@ namespace AlzeyTeilhabe
foreach (var ii in sip.ServiceInvoiceItems)
{
ii.UnitCountString = String.Format("{0:0.00}", ii.UnitCount);
if (ii.ServiceDescription == "Eigenanteil")
{
ii.GrossAmount = "-" + ii.GrossAmount;
string[] grossClaimStringArray = pRO.GrossClaim.Split(' ');
var grossClaimOhneEigenanteil = Convert.ToDecimal(grossClaimStringArray[0]) - ii.AmountPerUnit;
pRO.GrossClaim = string.Format("{0:0.00} €", grossClaimOhneEigenanteil);
}
}
}
this.bindingSource1.DataSource = pRO;

View File

@@ -0,0 +1,19 @@
using BeWo.Data.Entities;
using BeWo.Service.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AlzeyTeilhabe.Service
{
public class CustomSaveInterceptor : SaveInterceptor
{
public override void BeforeSaveServiceRecord(ServiceRecord sr)
{
if (sr.ServiceDescription.ServiceCategory.Name.ToLower().Contains("fahrt"))
sr.DistanceInMeter = sr.Customer.DistanceInMeter;
}
}
}

View File

@@ -51,6 +51,7 @@ namespace AlzeyTeilhabe
this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell15 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell16 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
@@ -62,9 +63,11 @@ namespace AlzeyTeilhabe
this.xrLabel21 = new DevExpress.XtraReports.UI.XRLabel();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.xrLabel2 = new DevExpress.XtraReports.UI.XRLabel();
this.xrPageInfo1 = new DevExpress.XtraReports.UI.XRPageInfo();
this.piPage = new DevExpress.XtraReports.UI.XRPageInfo();
this.ReportFooter = new DevExpress.XtraReports.UI.ReportFooterBand();
this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.lblGesamtpreis = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTable1 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow1 = new DevExpress.XtraReports.UI.XRTableRow();
this.xrTableCell5 = new DevExpress.XtraReports.UI.XRTableCell();
@@ -74,16 +77,12 @@ namespace AlzeyTeilhabe
this.fieldAbrechenbareFLS = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldStunden = new DevExpress.XtraReports.UI.CalculatedField();
this.fieldTotalSum = new DevExpress.XtraReports.UI.CalculatedField();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.xrTable2 = new DevExpress.XtraReports.UI.XRTable();
this.xrTableRow3 = new DevExpress.XtraReports.UI.XRTableRow();
this.lblGesamtpreis = new DevExpress.XtraReports.UI.XRTableCell();
this.xrTableCell6 = new DevExpress.XtraReports.UI.XRTableCell();
this.xrLabel3 = new DevExpress.XtraReports.UI.XRLabel();
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// Detail
@@ -343,6 +342,10 @@ namespace AlzeyTeilhabe
this.xrTableCell16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
this.xrTableCell16.Weight = 0.11742309062325153D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// formattingRuleStartDate
//
this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]";
@@ -394,6 +397,7 @@ namespace AlzeyTeilhabe
// topMarginBand1
//
this.topMarginBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel3,
this.lblVersichertennummer,
this.xrLabel21,
this.xrLabel1});
@@ -431,9 +435,7 @@ namespace AlzeyTeilhabe
// bottomMarginBand1
//
this.bottomMarginBand1.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
this.xrLabel2,
this.xrPageInfo1,
this.piPage});
this.xrLabel2});
this.bottomMarginBand1.HeightF = 98.95837F;
this.bottomMarginBand1.Name = "bottomMarginBand1";
//
@@ -451,24 +453,6 @@ namespace AlzeyTeilhabe
"kumentation";
this.xrLabel2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomLeft;
//
// xrPageInfo1
//
this.xrPageInfo1.Format = "{0:dd.MM.yyyy}";
this.xrPageInfo1.LocationFloat = new DevExpress.Utils.PointFloat(871.9999F, 50.33331F);
this.xrPageInfo1.Name = "xrPageInfo1";
this.xrPageInfo1.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrPageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime;
this.xrPageInfo1.SizeF = new System.Drawing.SizeF(100F, 23F);
//
// piPage
//
this.piPage.LocationFloat = new DevExpress.Utils.PointFloat(971.9999F, 50.33331F);
this.piPage.Name = "piPage";
this.piPage.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.piPage.SizeF = new System.Drawing.SizeF(100F, 23F);
this.piPage.StylePriority.UseTextAlignment = false;
this.piPage.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight;
//
// ReportFooter
//
this.ReportFooter.Controls.AddRange(new DevExpress.XtraReports.UI.XRControl[] {
@@ -479,6 +463,49 @@ namespace AlzeyTeilhabe
this.ReportFooter.Name = "ReportFooter";
this.ReportFooter.StylePriority.UseFont = false;
//
// xrTable2
//
this.xrTable2.BorderColor = System.Drawing.Color.Black;
this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(802.0005F, 0F);
this.xrTable2.Name = "xrTable2";
this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow3});
this.xrTable2.SizeF = new System.Drawing.SizeF(177.0001F, 40F);
this.xrTable2.StylePriority.UseFont = false;
this.xrTable2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// xrTableRow3
//
this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell6,
this.lblGesamtpreis});
this.xrTableRow3.Name = "xrTableRow3";
this.xrTableRow3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTableRow3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
this.xrTableRow3.Weight = 2D;
//
// xrTableCell6
//
this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.Right;
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.StylePriority.UseBorders = false;
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell6.Weight = 0.11174248242405439D;
//
// lblGesamtpreis
//
this.lblGesamtpreis.Name = "lblGesamtpreis";
this.lblGesamtpreis.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F);
this.lblGesamtpreis.StylePriority.UseFont = false;
this.lblGesamtpreis.StylePriority.UsePadding = false;
this.lblGesamtpreis.StylePriority.UseTextAlignment = false;
this.lblGesamtpreis.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.lblGesamtpreis.Weight = 0.11174248242405439D;
//
// xrTable1
//
this.xrTable1.BorderColor = System.Drawing.Color.Black;
@@ -554,52 +581,17 @@ namespace AlzeyTeilhabe
this.fieldTotalSum.Expression = "Round([TotalFLMBillable] / 60, 2) * [RateFactor]";
this.fieldTotalSum.Name = "fieldTotalSum";
//
// bindingSource1
// xrLabel3
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// xrTable2
//
this.xrTable2.BorderColor = System.Drawing.Color.Black;
this.xrTable2.Borders = ((DevExpress.XtraPrinting.BorderSide)(((DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right)
| DevExpress.XtraPrinting.BorderSide.Bottom)));
this.xrTable2.LocationFloat = new DevExpress.Utils.PointFloat(802.0005F, 0F);
this.xrTable2.Name = "xrTable2";
this.xrTable2.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTable2.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow3});
this.xrTable2.SizeF = new System.Drawing.SizeF(177.0001F, 40F);
this.xrTable2.StylePriority.UseFont = false;
this.xrTable2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
//
// xrTableRow3
//
this.xrTableRow3.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] {
this.xrTableCell6,
this.lblGesamtpreis});
this.xrTableRow3.Name = "xrTableRow3";
this.xrTableRow3.Padding = new DevExpress.XtraPrinting.PaddingInfo(0, 0, 0, 0, 100F);
this.xrTableRow3.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopLeft;
this.xrTableRow3.Weight = 2D;
//
// lblGesamtpreis
//
this.lblGesamtpreis.Name = "lblGesamtpreis";
this.lblGesamtpreis.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 0, 0, 0, 100F);
this.lblGesamtpreis.StylePriority.UseFont = false;
this.lblGesamtpreis.StylePriority.UsePadding = false;
this.lblGesamtpreis.StylePriority.UseTextAlignment = false;
this.lblGesamtpreis.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
this.lblGesamtpreis.Weight = 0.11174248242405439D;
//
// xrTableCell6
//
this.xrTableCell6.Borders = DevExpress.XtraPrinting.BorderSide.Right;
this.xrTableCell6.Name = "xrTableCell6";
this.xrTableCell6.StylePriority.UseBorders = false;
this.xrTableCell6.StylePriority.UseTextAlignment = false;
this.xrTableCell6.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
this.xrTableCell6.Weight = 0.11174248242405439D;
this.xrLabel3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CostBearer2SupportConceptList.CostBearer.Organisation.Name")});
this.xrLabel3.Font = new System.Drawing.Font("Arial", 11F);
this.xrLabel3.LocationFloat = new DevExpress.Utils.PointFloat(788.8334F, 53.75001F);
this.xrLabel3.Name = "xrLabel3";
this.xrLabel3.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96F);
this.xrLabel3.SizeF = new System.Drawing.SizeF(273.1666F, 34.79166F);
this.xrLabel3.StylePriority.UseFont = false;
this.xrLabel3.Text = "xrLabel3";
//
// StundenzettelSoziotherapie
//
@@ -631,9 +623,9 @@ namespace AlzeyTeilhabe
this.Version = "17.1";
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}
@@ -683,11 +675,10 @@ namespace AlzeyTeilhabe
private DevExpress.XtraReports.UI.XRTableCell xrTableCell15;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell16;
private DevExpress.XtraReports.UI.XRLabel xrLabel2;
private DevExpress.XtraReports.UI.XRPageInfo xrPageInfo1;
private DevExpress.XtraReports.UI.XRPageInfo piPage;
private DevExpress.XtraReports.UI.XRTable xrTable2;
private DevExpress.XtraReports.UI.XRTableRow xrTableRow3;
private DevExpress.XtraReports.UI.XRTableCell lblGesamtpreis;
private DevExpress.XtraReports.UI.XRTableCell xrTableCell6;
private DevExpress.XtraReports.UI.XRLabel xrLabel3;
}
}