From 06cbee8893e3fdd280da438f6c64c3a23f8e03be Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Wed, 27 Mar 2024 18:25:18 +0100 Subject: [PATCH] =?UTF-8?q?MH:=20Negativbetr=C3=A4ge=20in=20Leistungen=20u?= =?UTF-8?q?nd=20Kategorien=20erlaubt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/ViewModel/PreisVM.cs | 2 +- BeWo/ViewModel/ServiceCategoryVM.cs | 2 +- BeWo/ViewModel/ServiceDescriptionVM.cs | 4 ++-- Service/Invoicing/SettlementInvoiceCreation.cs | 10 +++++----- Service/Plugins/AccountingService.cs | 9 +++++---- Shared/Services/Calculations.cs | 2 +- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/BeWo/ViewModel/PreisVM.cs b/BeWo/ViewModel/PreisVM.cs index 9d14f41af..7013fb39d 100644 --- a/BeWo/ViewModel/PreisVM.cs +++ b/BeWo/ViewModel/PreisVM.cs @@ -207,7 +207,7 @@ namespace BeWo.ViewModel List crpList = _CostRatePeriods.CopyToDCList(doCommit); foreach (var costRatePeriodDc in crpList) { - if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value > 0) + if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value != 0) bDataContract.CostRatePeriods.Add(costRatePeriodDc); } diff --git a/BeWo/ViewModel/ServiceCategoryVM.cs b/BeWo/ViewModel/ServiceCategoryVM.cs index 499194c2f..ab89d54af 100644 --- a/BeWo/ViewModel/ServiceCategoryVM.cs +++ b/BeWo/ViewModel/ServiceCategoryVM.cs @@ -377,7 +377,7 @@ namespace BeWo.ViewModel List crpList = this._CostRatePeriods.CopyToDCList(doCommit); foreach (var costRatePeriodDc in crpList) { - if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value > 0) + if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value != 0) pDataContract.CostRatePeriods.Add(costRatePeriodDc); } if (pDataContract.CostRatePeriods.Count == 0) diff --git a/BeWo/ViewModel/ServiceDescriptionVM.cs b/BeWo/ViewModel/ServiceDescriptionVM.cs index d68ec1eef..715bcd582 100644 --- a/BeWo/ViewModel/ServiceDescriptionVM.cs +++ b/BeWo/ViewModel/ServiceDescriptionVM.cs @@ -391,10 +391,10 @@ namespace BeWo.ViewModel pDataContract.CostRatePeriods = new List(); - List crpList = _CostRatePeriods.CopyToDCList(doCommit); + List crpList = _CostRatePeriods.CopyToDCList(doCommit); foreach (var costRatePeriodDc in crpList) { - if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value > 0) + if (costRatePeriodDc.CostRateValue.HasValue && costRatePeriodDc.CostRateValue.Value != 0) pDataContract.CostRatePeriods.Add(costRatePeriodDc); } diff --git a/Service/Invoicing/SettlementInvoiceCreation.cs b/Service/Invoicing/SettlementInvoiceCreation.cs index 371a74bae..3108995de 100644 --- a/Service/Invoicing/SettlementInvoiceCreation.cs +++ b/Service/Invoicing/SettlementInvoiceCreation.cs @@ -153,7 +153,7 @@ namespace BeWo.Service.Invoicing { foreach (var costRatePeriod in ap.ServiceCategory.CostRatePeriods) { - if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value > 0) + if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value != 0) return false; } } @@ -164,7 +164,7 @@ namespace BeWo.Service.Invoicing { foreach (var costRatePeriod in sd.CostRatePeriods) { - if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value > 0) + if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value != 0) return false; } } @@ -185,7 +185,7 @@ namespace BeWo.Service.Invoicing { foreach (var costRatePeriod in sr.ServiceDescription.CostRatePeriods) { - if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value > 0) + if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value != 0) return false; } } @@ -194,7 +194,7 @@ namespace BeWo.Service.Invoicing { foreach (var costRatePeriod in sr.ServiceDescription.ServiceCategory.CostRatePeriods) { - if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value > 0) + if (costRatePeriod.CostRateValue.HasValue && costRatePeriod.CostRateValue.Value != 0) return false; } } @@ -384,7 +384,7 @@ namespace BeWo.Service.Invoicing decimal tolerance = 100; if (tolerancesInSpanList.Count > 0) { - if (tolerancesInSpanList[0].Key.CostRateValue.HasValue && tolerancesInSpanList[0].Key.CostRateValue.Value > 0) + if (tolerancesInSpanList[0].Key.CostRateValue.HasValue && tolerancesInSpanList[0].Key.CostRateValue.Value != 0) { tolerance = tolerancesInSpanList[0].Key.CostRateValue ?? 100; } diff --git a/Service/Plugins/AccountingService.cs b/Service/Plugins/AccountingService.cs index 225ae03c4..084c9127a 100644 --- a/Service/Plugins/AccountingService.cs +++ b/Service/Plugins/AccountingService.cs @@ -61,11 +61,12 @@ namespace BeWo.Service.Plugins } var creator = factory.CreateInvoiceCreator(cb.ID, tenant, supportConcepts2ServiceRecords); - var newInvoices = creator.GenerateServiceInvoices(costBearerOid, invoicePeriod, supportConcepts2ServiceRecords); + var newInvoices = creator.GenerateServiceInvoices(costBearerOid, invoicePeriod, supportConcepts2ServiceRecords); + + //Prüfe ob Rechnungen neu sind oder Diff vorhanden + var differenzRechnungChecks = GetNewInvoices(newInvoices, invoicePeriod.StartDate, invoicePeriod.EndDate); + var resultList = ErstelleNeueRechnungen(differenzRechnungChecks); - //Prüfe ob Rechnungen neu sind oder Diff vorhanden - var differenzRechnungChecks = GetNewInvoices(newInvoices, invoicePeriod.StartDate, invoicePeriod.EndDate); - var resultList = ErstelleNeueRechnungen(differenzRechnungChecks); return resultList; } diff --git a/Shared/Services/Calculations.cs b/Shared/Services/Calculations.cs index e38754bf9..90bd69e5f 100644 --- a/Shared/Services/Calculations.cs +++ b/Shared/Services/Calculations.cs @@ -1216,7 +1216,7 @@ namespace BS.Shared.Services var duration = Convert.ToDecimal((iRecord.End - iRecord.Start).Value.TotalMinutes); //###CB 5min - if (minuteInterval != null && minuteInterval.CostRateValue.HasValue && minuteInterval.CostRateValue.Value > 0) + if (minuteInterval != null && minuteInterval.CostRateValue.HasValue && minuteInterval.CostRateValue.Value != 0) { iRecord.RoundedDuration = GetRoundedDuration((int)minuteInterval.CostRateValue.Value, duration); }