Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo

This commit is contained in:
2026-05-07 14:58:50 +02:00
9 changed files with 67 additions and 16 deletions

View File

@@ -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;
}

View File

@@ -13,4 +13,5 @@
<add key="OpenrouteServiceApiKey" value="" />
<add key="GoogleDistanceMatrixApiKey" value="" />
<add key="GkvSecretKey" value="" />
<add key="AppStatusApiKey" value="" />
</appSettings>

View File

@@ -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}";
}
}
}
}
}
}

View File

@@ -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)

View File

@@ -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"))

View File

@@ -30,6 +30,7 @@ namespace BeWo.Service
OpenrouteServiceApiKey,
GoogleDistanceMatrixApiKey,
GkvSecretKey,
AppStatusApiKey
}
[DefaultValue(None)]

View File

@@ -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

View File

@@ -15,6 +15,7 @@ namespace BeWo.Service.ServiceContracts.Enhanced
{
[OperationContract]
[WebGet(UriTemplate = "/Status", ResponseFormat = WebMessageFormat.Json)]
[RequireApiAuthorization(ApiKeyName = WebSecretConfigSetting.AppStatusApiKey)]
ServerStatusDC GetStatus();
}
}

View File

@@ -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;