From 036ffe43c6d491f4e424efa423cdfd826de42e50 Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Mon, 6 Feb 2023 08:58:45 +0100 Subject: [PATCH] MH: aha eV Anpassungen --- .../Invoicing/CustomInvoiceCreation.cs | 50 ------------------- .../Invoicing/CustomInvoiceFactory.cs | 21 -------- ...CustomMitarbeiterstundenkontoBerechnung.cs | 9 ++++ ReportImp/ahaEV/CustomVacationService.cs | 12 +++++ .../ahaEV/Mitarbeiterarbeitszeitkonto.cs | 12 ++++- .../Mitarbeiterarbeitszeitkonto.designer.cs | 16 +++--- 6 files changed, 39 insertions(+), 81 deletions(-) delete mode 100644 ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceCreation.cs delete mode 100644 ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceFactory.cs diff --git a/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceCreation.cs b/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceCreation.cs deleted file mode 100644 index 546cea976..000000000 --- a/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceCreation.cs +++ /dev/null @@ -1,50 +0,0 @@ -using BeWo.Data.Entities; -using BeWo.Service.Invoicing; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BetreuungsserviceFuerAlltagUndWohnen.Invoicing -{ - public class CustomInvoiceCreation : InvoiceCreation - { - public override void BerechneSummaryItemsSummen(List newlist, bool addRateFactorToUnitCount) - { - addRateFactorToUnitCount = true; - foreach (InvoiceItem invoiceItem in newlist) - { - if (!invoiceItem.AmountPerUnit.HasValue) - { - invoiceItem.AmountPerUnit = 0; - } - invoiceItem.AmountPerUnit = Math.Round(invoiceItem.AmountPerUnit.Value, 2, MidpointRounding.AwayFromZero); - - if (!invoiceItem.UnitCount.HasValue) - { - invoiceItem.UnitCount = 0; - } - - if (addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue) - { - invoiceItem.UnitCount = (invoiceItem.UnitCount ?? 0) * ((invoiceItem.RateFactor + 100) / 100); - } - - invoiceItem.UnitCount = Math.Round(invoiceItem.UnitCount.Value, 2, MidpointRounding.AwayFromZero); - - - invoiceItem.AmountTotal = invoiceItem.AmountPerUnit * invoiceItem.UnitCount; - invoiceItem.AmountTotal = Math.Round(invoiceItem.AmountTotal.Value, 2, MidpointRounding.AwayFromZero); - - invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal; - - - if (!addRateFactorToUnitCount && invoiceItem.RateFactor.HasValue) - { - invoiceItem.GrossAmountTotal *= ((invoiceItem.RateFactor + 100) / 100); - } - } - } - } -} diff --git a/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceFactory.cs b/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceFactory.cs deleted file mode 100644 index a67126d06..000000000 --- a/ReportImp/BetreuungsserviceFuerAlltagUndWohnen/Invoicing/CustomInvoiceFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using BeWo.Data.Access; -using BeWo.Data.Entities; -using BeWo.Service.Invoicing; -using BS.Shared.DataContracts; -using BS.Shared.DataContracts.Compact; - -namespace BetreuungsserviceFuerAlltagUndWohnen.Invoicing -{ - public class CustomInvoiceFactory : InvoiceFactory - { - - public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) - { - return new CustomInvoiceCreation(); - } - - - } -} diff --git a/ReportImp/ahaEV/CustomMitarbeiterstundenkontoBerechnung.cs b/ReportImp/ahaEV/CustomMitarbeiterstundenkontoBerechnung.cs index f0d51c1e8..9195aadb0 100644 --- a/ReportImp/ahaEV/CustomMitarbeiterstundenkontoBerechnung.cs +++ b/ReportImp/ahaEV/CustomMitarbeiterstundenkontoBerechnung.cs @@ -8,6 +8,15 @@ namespace ahaEV { public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung { + public override List GetFeiertage(int year) + { + var list = base.GetFeiertage(year); + + + + return list; + } + public override bool ShouldCreateDayDetails() { return true; diff --git a/ReportImp/ahaEV/CustomVacationService.cs b/ReportImp/ahaEV/CustomVacationService.cs index 661babf7e..07fb14724 100644 --- a/ReportImp/ahaEV/CustomVacationService.cs +++ b/ReportImp/ahaEV/CustomVacationService.cs @@ -10,5 +10,17 @@ namespace ahaEV class CustomVacationService : VacationService { public override string Bundesland { get => "Hessen"; } + + public override decimal GetFeiertagsFaktor(DateTime start) + { + if (IstFeiertag(start)) + { + return 1; + } + else if (start.Month == 12 && start.Day == 24 || start.Month == 12 && start.Day == 31) + return 0.5m; + + return 0; + } } } diff --git a/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.cs b/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.cs index 157a49f6b..c2e4897bd 100644 --- a/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.cs +++ b/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.cs @@ -24,6 +24,8 @@ namespace ahaEV var msb = new CustomMitarbeiterstundenkontoBerechnung(); msb.CreateReport(pRO); + var stunden = 0.0m; + foreach (var ed in pRO.EmployeeDetailList) { var c = ed.Employee.GetValidContractForDate(pRO.ReportStartDate); @@ -38,8 +40,16 @@ namespace ahaEV ed.Regelarbeitszeit = String.Format("{0:0.00} Stunden pro Woche", c.WeeklyTotalHours); } } - + + foreach (var day in ed.Days) + { + stunden += day.MinutesTotal / 60; + } + stunden += ed.SollProTag * ed.UrlaubUndKrankheit.Value; + ed.Custom15 = stunden; } + + this.bindingSource1.DataSource = pRO; } diff --git a/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.designer.cs b/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.designer.cs index bdea37074..143c44a64 100644 --- a/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.designer.cs +++ b/ReportImp/ahaEV/Mitarbeiterarbeitszeitkonto.designer.cs @@ -97,7 +97,6 @@ namespace ahaEV this.xrTableCell26 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell12 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell14 = new DevExpress.XtraReports.UI.XRTableCell(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.Title = new DevExpress.XtraReports.UI.XRControlStyle(); this.FieldCaption = new DevExpress.XtraReports.UI.XRControlStyle(); this.PageInfo = new DevExpress.XtraReports.UI.XRControlStyle(); @@ -115,6 +114,7 @@ namespace ahaEV this.fieldSumHoliday2 = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldIstArbeitszeit = new DevExpress.XtraReports.UI.CalculatedField(); this.fieldUeberstundenGesamt = new DevExpress.XtraReports.UI.CalculatedField(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); ((System.ComponentModel.ISupportInitialize)(this.xrTableDetail)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTableHeader)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); @@ -614,7 +614,7 @@ namespace ahaEV this.xrTableCell46.Name = "xrTableCell46"; this.xrTableCell46.StylePriority.UseBorders = false; this.xrTableCell46.StylePriority.UseTextAlignment = false; - this.xrTableCell46.Text = "Arbeitszeit:"; + this.xrTableCell46.Text = "Ist-Stunden"; this.xrTableCell46.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell46.Weight = 0.0899362101431268D; // @@ -622,15 +622,13 @@ namespace ahaEV // this.cellSumMinutesTotalDecimal2.Borders = DevExpress.XtraPrinting.BorderSide.Top; this.cellSumMinutesTotalDecimal2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { - new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Days.fieldHours")}); + new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeDetailList.Custom15", "{0:0.00}")}); this.cellSumMinutesTotalDecimal2.Name = "cellSumMinutesTotalDecimal2"; this.cellSumMinutesTotalDecimal2.StylePriority.UseBorders = false; this.cellSumMinutesTotalDecimal2.StylePriority.UseTextAlignment = false; xrSummary4.FormatString = "{0:0.00}"; xrSummary4.IgnoreNullValues = true; - xrSummary4.Running = DevExpress.XtraReports.UI.SummaryRunning.Group; this.cellSumMinutesTotalDecimal2.Summary = xrSummary4; - this.cellSumMinutesTotalDecimal2.Text = "cellSumMinutesTotalDecimal2"; this.cellSumMinutesTotalDecimal2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.cellSumMinutesTotalDecimal2.Weight = 0.071948964683863317D; // @@ -839,10 +837,6 @@ namespace ahaEV this.xrTableCell14.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; this.xrTableCell14.Weight = 0.080942614161178317D; // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO); - // // Title // this.Title.BackColor = System.Drawing.Color.White; @@ -972,6 +966,10 @@ namespace ahaEV this.fieldUeberstundenGesamt.FieldType = DevExpress.XtraReports.UI.FieldType.Decimal; this.fieldUeberstundenGesamt.Name = "fieldUeberstundenGesamt"; // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.MitarbeiterstundenkontoRO); + // // Mitarbeiterarbeitszeitkonto // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] {