diff --git a/BeWo/MainControl.xaml.cs b/BeWo/MainControl.xaml.cs
index 305b70604..62539f6d8 100644
--- a/BeWo/MainControl.xaml.cs
+++ b/BeWo/MainControl.xaml.cs
@@ -176,7 +176,7 @@ namespace BeWo
}
- if (BeWoApp.LoggedOnUser != null && BeWoApp.LoggedOnUser.HasRight(UserRightType.DocumentsAllowViewAll) && BeWoApp.AppSettings.ShowVorlagen && (BeWoApp.LoggedOnUser.HasRight(UserRightType.VorlagenViewAll) || BeWoApp.LoggedOnUser.HasRight(UserRightType.VorlagenViewOwnTeams))
+ if (BeWoApp.LoggedOnUser != null && BeWoApp.LoggedOnUser.HasRight(UserRightType.DocumentsAllowViewAll) && BeWoApp.AppSettings.ShowVorlagen && (BeWoApp.LoggedOnUser.HasRight(UserRightType.VorlagenViewAll) || BeWoApp.LoggedOnUser.HasRight(UserRightType.VorlagenViewOwnTeams)))
{
this.button_Dokumente.Visibility = Visibility.Visible;
}
diff --git a/Host/Web.Secrets.config.template b/Host/Web.Secrets.config.template
index f71a7aaac..6f385fb10 100644
--- a/Host/Web.Secrets.config.template
+++ b/Host/Web.Secrets.config.template
@@ -13,4 +13,5 @@
+
\ No newline at end of file
diff --git a/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceCreationQA.cs b/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceCreationQA.cs
index c94d7f6d8..1bd5ef13d 100644
--- a/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceCreationQA.cs
+++ b/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceCreationQA.cs
@@ -18,10 +18,12 @@ using System.Text;
namespace SBBMainzReports.Invoicing
{
- public class CustomInvoiceCreationQA : InvoiceCreation
- {
+ public class CustomInvoiceCreationQA : InvoiceCreation
+ {
// Bei QA werden werden pauschal die bewilligten Stunden pro Woche abgerechnet
// nur wenn ein Kontingent bewilligt wurde, wird es nach Zeiterfassung abgerechnet
+
+ bool bienen_ = false;
public override void SetInvoiceItems(ServiceInvoice invoice,
ServiceInvoicePeriod serviceInvoicePeriod,
SupportConceptApprovalPeriodDC supportConceptApprovalPeriod,
@@ -41,12 +43,15 @@ namespace SBBMainzReports.Invoicing
i.ServiceDescription.Category.ServiceCategoryOid;
return valid;
}).ToList();
-
+ if (cb2sc.CustomerReferenceNumber.Trim().EndsWith("b") || cb2sc.AuswahlBezeichnung.Trim().ToLower().Contains("bienen"))
+ {
+ bienen_ = true;
+ }
if (ShouldCreateFixedAmounts(serviceInvoicePeriod, supportConceptApprovalPeriod, cb2sc))
{
CreateFixedAmounts(serviceInvoicePeriod, supportConceptApprovalPeriod, cb2sc);
// Erweiterung um Wegepauschale
- if (serviceRecordsInPeriod.Count > 0)
+ if (serviceRecordsInPeriod.Count > 0 && !bienen_)
{
InvoiceItem wg = null;
wg = CreateWegepauschale(serviceRecordsInPeriod, invoicePeriod, serviceInvoicePeriod.SupportConceptApprovalPeriod);
@@ -148,6 +153,7 @@ namespace SBBMainzReports.Invoicing
ItemPeriodStart = serviceInvoicePeriod.Start,
ItemPeriodEnd = serviceInvoicePeriod.End,
AmountPerUnit = hourlyRate.Value,
+ ItemDescription = "Fachleistungseinheiten/Woche",
UnitCount = approvedHours
});
}
@@ -158,7 +164,7 @@ namespace SBBMainzReports.Invoicing
{
var list = base.CreateInvoiceItems(serviceRecordsInPeriod, invoicePeriod, scap, calc);
InvoiceItem wg = null;
- if (list.Count > 0)
+ if (list.Count > 0 && !bienen_)
{
wg = CreateWegepauschale(serviceRecordsInPeriod, invoicePeriod, scap);
if (wg != null)
@@ -188,8 +194,7 @@ namespace SBBMainzReports.Invoicing
invoiceItem.ItemPeriodEnd = invoicePeriod.EndDate;
invoiceItem.RateFactor = null;
invoiceItem.GrossAmountTotal = invoiceItem.AmountTotal;
- invoiceItem.ItemDescription = "Wegepauschale";
- invoiceItem.UnitDescription = "Stk";
+ invoiceItem.ItemDescription = "Wegepauschale/Wocche";
if (scap != null)
{
invoiceItem.SupportConceptApprovalPeriodOid = scap.Oid;
@@ -199,5 +204,27 @@ namespace SBBMainzReports.Invoicing
}
return null;
}
+
+ public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer)
+ {
+ base.SetRecipientInformation(serviceInvoice, costBearer);
+ if (serviceInvoice.InvoiceBase.CostBearer2SupportConcept != null)
+ {
+ var refNumber = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.CustomerReferenceNumber;
+ if (!string.IsNullOrEmpty(refNumber))
+ {
+ var parts = refNumber.Split('.');
+ if (parts.Length == 3 && parts[0].Trim() == "50" && int.TryParse(parts[1].Trim(), out _))
+ {
+ string sachgebiet = parts[1].Trim();
+ string suffix = $"Sachgebiet {sachgebiet}";
+ if (string.IsNullOrEmpty(serviceInvoice.InvoiceBase.RecipientDivision))
+ serviceInvoice.InvoiceBase.RecipientDivision = suffix;
+ else if (!serviceInvoice.InvoiceBase.RecipientDivision.EndsWith(suffix))
+ serviceInvoice.InvoiceBase.RecipientDivision += $" {suffix}";
+ }
+ }
+ }
+ }
}
}
diff --git a/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceFactory.cs b/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceFactory.cs
index 8a5e73414..8ec4b3a04 100644
--- a/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceFactory.cs
+++ b/ReportImp/SBBMainzReports/Invoicing/CustomInvoiceFactory.cs
@@ -16,13 +16,17 @@ namespace SbbMainzReports.Invoicing
{
foreach (var sr in list)
{
- //if (sr.CostBearer != null)
- //{
- // if (sr.CostBearer.Name.Contains("besW"))
- // {
- // return new CollectiveInvoiceCreation();
- // }
- //}
+ if (sr.CostBearer != null && sr.CostBearer.Function != null)
+ {
+ if (sr.CostBearer.Function.ToLower().Contains("qa") || sr.CostBearer.Function.ToLower().Contains("bienen"))
+ {
+ return new CustomInvoiceCreationQA();
+ }
+ if (sr.CostBearer.Function.ToLower().Contains("ts") || sr.CostBearer.Function.ToLower().Contains("tagesstätte"))
+ {
+ return new CustomInvoiceCreationTS();
+ }
+ }
var sd = sr.ServiceDescription.Category;
var ic = GetInvoiceCreatorForCategory(sd);
if (ic != null)
diff --git a/ReportImp/SBBMainzReports/ServiceInvoiceReport.cs b/ReportImp/SBBMainzReports/ServiceInvoiceReport.cs
index 04475d165..a671bb283 100644
--- a/ReportImp/SBBMainzReports/ServiceInvoiceReport.cs
+++ b/ReportImp/SBBMainzReports/ServiceInvoiceReport.cs
@@ -60,6 +60,14 @@ namespace SBBMainzReports
{
lblUeberschrift.Text = "Hilfe zur Erziehung gemäß § 27 ff SGB VIII i.V. m. § 30 SGB VIII - \nErziehungsbeistandschaft";
}
+ if (sip.ServiceInvoiceItems.Any(i => i.ServiceDescription != null && i.ServiceDescription.Contains("QA")))
+ {
+ lblUeberschrift.Text = "Qualifizierte Assistenz im Rahmen der Eingliederungshilfe \ngem. § 99 i.V.m. §§ 113-116 SGB IX";
+ }
+ if (sip.ServiceInvoiceItems.Any(i => i.ServiceDescription != null && i.ServiceDescription.Contains("Tagesstätte")))
+ {
+ lblUeberschrift.Text = "Gewährung von Eingliederungshilfe für Menschen mit Behinderung nach SGB IX";
+ }
foreach (var ii in sip.ServiceInvoiceItems)
{
if (!ii.ServiceDescription.ToLower().Contains("handgeld") && !ii.ServiceDescription.ToLower().Contains("hangeld"))
diff --git a/Service/BeWoServiceEnums.cs b/Service/BeWoServiceEnums.cs
index 7c59f8f81..f39e51168 100644
--- a/Service/BeWoServiceEnums.cs
+++ b/Service/BeWoServiceEnums.cs
@@ -30,6 +30,7 @@ namespace BeWo.Service
OpenrouteServiceApiKey,
GoogleDistanceMatrixApiKey,
GkvSecretKey,
+ AppStatusApiKey
}
[DefaultValue(None)]
diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs
index 0a35c98fb..886b4892e 100644
--- a/Service/Plugins/PluginLoader.cs
+++ b/Service/Plugins/PluginLoader.cs
@@ -4,6 +4,7 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
+using BeWo.Data;
using BS.Shared.Core;
namespace BeWo.Service.Plugins
diff --git a/Service/ServiceContracts/Enhanced/IStatusService.cs b/Service/ServiceContracts/Enhanced/IStatusService.cs
index 343f981a6..317d6ad1a 100644
--- a/Service/ServiceContracts/Enhanced/IStatusService.cs
+++ b/Service/ServiceContracts/Enhanced/IStatusService.cs
@@ -15,6 +15,7 @@ namespace BeWo.Service.ServiceContracts.Enhanced
{
[OperationContract]
[WebGet(UriTemplate = "/Status", ResponseFormat = WebMessageFormat.Json)]
+ [RequireApiAuthorization(ApiKeyName = WebSecretConfigSetting.AppStatusApiKey)]
ServerStatusDC GetStatus();
}
}
diff --git a/Service/ServiceImplementations/Enhanced/StatusServiceImp.cs b/Service/ServiceImplementations/Enhanced/StatusServiceImp.cs
index 73e4e7081..7fae8d88e 100644
--- a/Service/ServiceImplementations/Enhanced/StatusServiceImp.cs
+++ b/Service/ServiceImplementations/Enhanced/StatusServiceImp.cs
@@ -8,6 +8,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Net;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Web;
@@ -38,6 +39,13 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
result.Services.Add(CheckService("AIModule", CheckAiModule()));
result.Services.Add(CheckService("Web.config", CheckWebConfig()));
+ var allHealthy = result.DatabaseOk && result.Services.All(x => x.IsOk);
+ if (!allHealthy)
+ {
+ WebOperationContext.Current.OutgoingResponse.StatusCode =
+ HttpStatusCode.InternalServerError;
+ }
+
return result;
}
@@ -98,7 +106,7 @@ namespace BeWo.Service.ServiceImplementations.Enhanced
{
// #1
var url = MergedConfig.GetSetting(WebConfigSetting.AiPromptsUrl);
- if (!string.IsNullOrWhiteSpace(url))
+ if (string.IsNullOrWhiteSpace(url))
return "AiPromptsUrl wurde nicht korrekt konfiguriert";
return null;