diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs
index 4c7898ff7..38755f7ae 100644
--- a/BeWo/BeWoApp.xaml.cs
+++ b/BeWo/BeWoApp.xaml.cs
@@ -778,9 +778,9 @@ namespace BeWo
//{
// url += "/service45";
//}
- if (url.IndexOf("/service") < 0)
+ if (url.IndexOf("/service_developer") < 0)
{
- url += "/service";
+ url += "/service_developer";
}
return new Uri(String.Format("https://{0}", url));
diff --git a/BeWo/Converter/ValidationConverter.cs b/BeWo/Converter/ValidationConverter.cs
index 6ee6613a2..37f55b2e2 100644
--- a/BeWo/Converter/ValidationConverter.cs
+++ b/BeWo/Converter/ValidationConverter.cs
@@ -18,7 +18,7 @@ namespace BeWo.Converter
{
if(value is string val_str && parameter is ValidationType val_type)
{
- return Validator.IsValid(val_type, val_str);
+ return GkvValidator.IsValid(val_type, val_str);
}
return null;
diff --git a/BeWo/Converter/ValidationToTooltipConverter.cs b/BeWo/Converter/ValidationToTooltipConverter.cs
index 1aa37ac78..50a9d77b4 100644
--- a/BeWo/Converter/ValidationToTooltipConverter.cs
+++ b/BeWo/Converter/ValidationToTooltipConverter.cs
@@ -22,7 +22,7 @@ namespace BeWo.Converter
if (value is bool val_bool && parameter is ValidationType val_type)
{
- return val_bool ? null : Validator.InvalidTooltipTxt(val_type);
+ return val_bool ? null : GkvValidator.InvalidTooltipTxt(val_type);
}
return "xxx";
diff --git a/BeWo/DebugConfig.cs b/BeWo/DebugConfig.cs
index 94d39cc51..86333065f 100644
--- a/BeWo/DebugConfig.cs
+++ b/BeWo/DebugConfig.cs
@@ -133,10 +133,10 @@ namespace BeWo
new DebugConfig()
{
DebugConfigMode = DebugConfigMode.FeatureDakota,
- AutoLogin = false,
- SelectView = UIContext.Organisation,
- SelectIndex = 8,
- DefaultLoginUsername = "m1",
+ AutoLogin = true,
+ //SelectView = UIContext.Organisation,
+ //SelectIndex = 8,
+ DefaultLoginUsername = "admin",
DefaultLoginPassword = "bewobewo",
DefaultProfilename = "5000000000",
EnableAutoRemoteDebugging = true
diff --git a/BeWo/ViewModel/InvoiceBaseVM.cs b/BeWo/ViewModel/InvoiceBaseVM.cs
index 2736480b9..e82a4aa2b 100644
--- a/BeWo/ViewModel/InvoiceBaseVM.cs
+++ b/BeWo/ViewModel/InvoiceBaseVM.cs
@@ -920,6 +920,7 @@ namespace BeWo.ViewModel
public StoredFileVM XRechnungStoredFileVM { get; set; }
public long? Oid => DataContract.InvoiceBaseOid;
+ public string InvoiceId => DataContract.InvoiceId;
public string SenderStreet => DataContract.SenderStreet;
public string SenderTown => DataContract.SenderTown;
public string SenderPostCode => DataContract.SenderPostCode;
diff --git a/BeWo/ViewModel/OrganisationVM.cs b/BeWo/ViewModel/OrganisationVM.cs
index bd5785db1..5289a71a8 100644
--- a/BeWo/ViewModel/OrganisationVM.cs
+++ b/BeWo/ViewModel/OrganisationVM.cs
@@ -713,8 +713,8 @@ namespace BeWo.ViewModel
}
public bool IsIKNumberValid
- => Validator.IsIKNumberValid(IKKrankenkasse)
- && Validator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
+ => GkvValidator.IsIKNumberValid(IKKrankenkasse)
+ && GkvValidator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
public string IKKrankenkasse
{
diff --git a/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml b/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
index e6caca011..4a1d65db3 100644
--- a/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
+++ b/BeWoPlanerMobil/Views/Main/SingleSignaturePopupPartial.cshtml
@@ -1,4 +1,5 @@
-@model BeWoPlanerMobil.Models.MainModel
+@using BeWoPlanerMobil.Util
+@model BeWoPlanerMobil.Models.MainModel
@@ -167,6 +189,8 @@ else
var info = $"{nameAndDateOfBirth} | {supportConceptTimeSpan}";
+
+
diff --git a/Dakota/Dakota.csproj b/Dakota/Dakota.csproj
index 597cc70c0..bd6ac875f 100644
--- a/Dakota/Dakota.csproj
+++ b/Dakota/Dakota.csproj
@@ -37,6 +37,21 @@
+
+ False
+ ..\Lib\System.Memory.dll
+
+
+
+ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ False
+ ..\Lib\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Text.Json.9.0.2\lib\net462\System.Text.Json.dll
+
@@ -49,6 +64,7 @@
+
@@ -149,6 +165,7 @@
+
@@ -171,10 +188,6 @@
-
- {b0d73e3d-4ae7-4024-93a6-db1f46d7ccee}
- Data
-
{2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}
Shared
diff --git a/Dakota/DakotaExtensions.cs b/Dakota/DakotaExtensions.cs
index 77670578b..039145b02 100644
--- a/Dakota/DakotaExtensions.cs
+++ b/Dakota/DakotaExtensions.cs
@@ -1,5 +1,5 @@
-using BeWo.Data.Entities;
-using BS.Shared.DataContracts;
+using BS.Shared.DataContracts;
+using BS.Shared.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -32,7 +32,7 @@ namespace Dakota
return false;
}
- public static bool IsSozioTherapie(this InvoiceBase invoiceBase)
+ public static bool IsSozioTherapie(this IInvoiceBase invoiceBase)
{
try
{
diff --git a/Dakota/DakotaUtils.cs b/Dakota/DakotaUtils.cs
index ae7cd19a0..229e1e857 100644
--- a/Dakota/DakotaUtils.cs
+++ b/Dakota/DakotaUtils.cs
@@ -1,5 +1,4 @@
-using BeWo.Data.Entities;
-using BS.Shared.Core;
+using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.Exceptions;
diff --git a/Dakota/Logic/DakotaInfoCreator.cs b/Dakota/Logic/DakotaInfoCreator.cs
index d53e881da..b93b9ace3 100644
--- a/Dakota/Logic/DakotaInfoCreator.cs
+++ b/Dakota/Logic/DakotaInfoCreator.cs
@@ -1,5 +1,4 @@
-using BeWo.Data.Entities;
-using BS.Shared;
+using BS.Shared;
using BS.Shared.DataContracts;
using Dakota.Models.Infos;
using Dakota.Models.Schlüssels;
diff --git a/Dakota/Logic/DakotaManager.cs b/Dakota/Logic/DakotaManager.cs
index 945ba52d7..98a842f93 100644
--- a/Dakota/Logic/DakotaManager.cs
+++ b/Dakota/Logic/DakotaManager.cs
@@ -1,5 +1,5 @@
-using BeWo.Data.Models;
-using BS.Shared.DataContracts;
+using BS.Shared.DataContracts;
+using BS.Shared.Models;
using Dakota.Models.Infos;
using System;
using System.Collections.Generic;
diff --git a/Dakota/Logic/DakotaNumberManager.cs b/Dakota/Logic/DakotaNumberManager.cs
new file mode 100644
index 000000000..6487ade7a
--- /dev/null
+++ b/Dakota/Logic/DakotaNumberManager.cs
@@ -0,0 +1,76 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using System.Threading.Tasks;
+
+namespace Dakota.Logic
+{
+ public class DakotaNumberManager
+ {
+ private readonly string _Filepath;
+ private readonly static object _LockObj = new object();
+ private Dictionary> _Numbers;
+
+ public DakotaNumberManager(string filePath)
+ {
+ _Filepath = filePath;
+ _Numbers = LoadNumbers();
+ }
+
+ private Dictionary> LoadNumbers()
+ {
+ if (!File.Exists(_Filepath))
+ {
+ return new Dictionary>
+ {
+
+ };
+ }
+
+ var json = File.ReadAllText(_Filepath);
+
+ return JsonSerializer.Deserialize>>(json) ?? new Dictionary>
+ {
+
+ };
+ }
+
+ private void SafeNumbers()
+ {
+ var json = JsonSerializer.Serialize(_Numbers, new JsonSerializerOptions()
+ {
+ WriteIndented = true
+ });
+ File.WriteAllText(_Filepath, json);
+ }
+
+ public Tuple GetNextNumber(string datenannahmestelle, bool newDatenaustauschreferenz)
+ {
+ lock (_LockObj)
+ {
+ if (_Numbers.ContainsKey(datenannahmestelle))
+ {
+ var (datenaustauschreferenz, transfernummer) = _Numbers[datenannahmestelle];
+
+ if (newDatenaustauschreferenz)
+ datenaustauschreferenz++;
+
+ transfernummer++;
+
+ _Numbers[datenannahmestelle] = new Tuple(datenaustauschreferenz, transfernummer);
+ }
+ else
+ {
+ _Numbers.Add(datenannahmestelle, new Tuple(1, 0));
+ }
+
+ SafeNumbers();
+
+ return _Numbers[datenannahmestelle];
+ }
+ }
+ }
+}
diff --git a/Dakota/Models/DakotaFile.cs b/Dakota/Models/DakotaFile.cs
index f338002f2..99be8e478 100644
--- a/Dakota/Models/DakotaFile.cs
+++ b/Dakota/Models/DakotaFile.cs
@@ -1,5 +1,4 @@
-using BeWo.Data.Entities;
-using BS.Shared.DataContracts;
+using BS.Shared.DataContracts;
using Dakota.Models;
using Dakota.Models.Auftragsdatei;
using Dakota.Models.Blocke;
diff --git a/Dakota/Models/Daten/Datenelement.cs b/Dakota/Models/Daten/Datenelement.cs
index 3e3d08ab4..6eee0014f 100644
--- a/Dakota/Models/Daten/Datenelement.cs
+++ b/Dakota/Models/Daten/Datenelement.cs
@@ -49,14 +49,7 @@ namespace Dakota.Models.Daten
if (!_IgnoreCheck)
{
- if (_Value.Length < MinStellen)
- {
- throw new GkvException($"Das Feld \"{Title}\" hat bei der Auswertung {_Value.Length} Stellen ergeben! Nach Vorgabe muss es jedoch mindestens {MinStellen} Stellen haben");
- }
- else if (_Value.Length > MaxStellen)
- {
- throw new GkvException($"Das Feld \"{Title}\" hat bei der Auswertung {_Value.Length} Stellen ergeben! Nach Vorgabe darf es jedoch maximal {MaxStellen} Stellen haben");
- }
+ CheckValue(_Value);
}
return _Value;
@@ -90,15 +83,7 @@ namespace Dakota.Models.Daten
value = value.Trim();
- if (value.Length < MinStellen)
- {
- throw new GkvException($"Das Feld \"{Title}\" hat bei der Erstellung {value.Length} Stellen ergeben! Nach Vorgabe muss es jedoch mindestens {MinStellen} Stellen haben");
- }
-
- if (value.Length > MaxStellen)
- {
- throw new GkvException($"Das Feld \"{Title}\" hat bei der Erstellung {value.Length} Stellen ergeben! Nach Vorgabe darf es jedoch maximal {MaxStellen} Stellen haben");
- }
+ CheckValue(value);
try
{
@@ -111,5 +96,23 @@ namespace Dakota.Models.Daten
throw new Exception($"Fehler bei Feld \'{Title}\' mit Wert \"{value}\"", e);
}
}
+
+ private void CheckValue(string value)
+ {
+ if (value.Length < MinStellen)
+ {
+ throw GetGkvException(value, true);
+ }
+
+ else if (value.Length > MaxStellen)
+ {
+ throw GetGkvException(value, false);
+ }
+ }
+
+ private GkvException GetGkvException(string value, bool isLess)
+ => new GkvException($"Das Feld \"{Title}\" hat bei der Erstellung {value.Length} Stellen ergeben! Nach Vorgabe " +
+ $"{(isLess ? $"muss es jedoch mindestens {MinStellen}" : $"darf es jedoch maximal {MaxStellen}")}" +
+ " Stellen haben");
}
}
diff --git a/Dakota/Models/Infos/InfoParameterInvoiceItem.cs b/Dakota/Models/Infos/InfoParameterInvoiceItem.cs
index 9b96aa75d..61ed616fd 100644
--- a/Dakota/Models/Infos/InfoParameterInvoiceItem.cs
+++ b/Dakota/Models/Infos/InfoParameterInvoiceItem.cs
@@ -1,6 +1,6 @@
-using BeWo.Data.Models;
-using BS.Shared.DataContracts;
+using BS.Shared.DataContracts;
using BS.Shared.Exceptions;
+using BS.Shared.Models;
using Dakota.Models.Schlüssels;
using System;
using System.Collections.Generic;
diff --git a/Dakota/app.config b/Dakota/app.config
index 902f2b5f0..b949327f8 100644
--- a/Dakota/app.config
+++ b/Dakota/app.config
@@ -18,13 +18,9 @@
-
-
-
-
-
+
@@ -52,7 +48,7 @@
-
+
@@ -62,6 +58,10 @@
+
+
+
+
\ No newline at end of file
diff --git a/Dakota/packages.config b/Dakota/packages.config
new file mode 100644
index 000000000..73a09538b
--- /dev/null
+++ b/Dakota/packages.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/DakotaSender/Program.cs b/DakotaSender/Program.cs
index ed486c9f4..53cb9e178 100644
--- a/DakotaSender/Program.cs
+++ b/DakotaSender/Program.cs
@@ -103,14 +103,14 @@ namespace DakotaSender
}
internal static void PrintFileInfo(DakotaSystemFile file)
{
- Print($"Verarbeite Datei: {file.SourceNutzdatendatei.Name}" );
+ Print($"Verarbeite Datei: {file.SourceNutzdatendatei.Name}");
PrintLine($"(T:{file.Tenant}, U:{file.ApplicationUserOid}, P:{file.ProtokollOid}, D:{file.Datenannahmestelle})");
}
- internal static void HandleException(Exception e, string tenant)
+ internal static void HandleException(Exception e, string tenant)
{
MailUtils.SendGkvModuleErrorMail("GkvSender Exception", e, tenant);
- PrintLine(e.ToString());
+ PrintLine(e.ToString());
}
static void CheckDakotaStatus(bool sub = false)
@@ -196,7 +196,7 @@ namespace DakotaSender
var test = DakotaSenderUtils.IsTenantTest(tenant);
var allow = DakotaSenderUtils.IsTenantAllowed(tenant);
- if(!test && !allow)
+ if (!test && !allow)
{
PrintLine($"{auft.FullName} wird ignoriert. Tenant \'{tenant}\' ungültig.");
return null;
@@ -216,7 +216,7 @@ namespace DakotaSender
return file;
}
- catch(Exception e)
+ catch (Exception e)
{
HandleException(e, tenant);
}
@@ -263,47 +263,32 @@ namespace DakotaSender
}
static void HandleQueueFiles(List files)
{
- bool error = false;
-
foreach (var file in files)
{
- if (!error)
+ var msg = HandleQueueFile(file, out bool success);
+
+ if (success)
{
- var msg = HandleQueueFile(file, out bool success);
+ PrintLine(msg);
- if (success)
- {
- PrintLine(msg);
+ Add2Results(file, GkvTransferResultType.Success);
- Add2Results(file, GkvTransferResultType.Success);
+ FileController.CopyFileToCopy(file);
- FileController.CopyFileToCopy(file);
-
- FileController.CopyFileToSuccesss(file);
- }
- else
- {
- error = true;
-
- PrintLine("Fehler gefunden. " + msg);
-
- Add2Results(file, GkvTransferResultType.FailSoft, msg, "DS:Fehler");
-
- FileController.CopyFileToCopy(file);
-
- FileController.CopyFileToFailed(file);
- }
+ FileController.CopyFileToSuccesss(file);
}
else
{
- PrintLine($"Folgefehler: {file.SourceNutzdatendatei.Name}");
+ PrintLine("Fehler gefunden. " + msg);
- Add2Results(file, GkvTransferResultType.FailFollowUp, "Wird neu erstellt und übertragen.", "DS:Folgefehler");
+ Add2Results(file, GkvTransferResultType.FailSoft, msg, "DS:Fehler");
+
+ FileController.CopyFileToCopy(file);
+
+ FileController.CopyFileToFailed(file);
}
FileController.DeleteQueueFile(file);
-
-
}
}
///
diff --git a/DakotaUnitTest/DakotaReaderUnitTest.cs b/DakotaUnitTest/DakotaReaderUnitTest.cs
index 3a83dd43e..f60739095 100644
--- a/DakotaUnitTest/DakotaReaderUnitTest.cs
+++ b/DakotaUnitTest/DakotaReaderUnitTest.cs
@@ -53,11 +53,11 @@ namespace DakotaUnitTest
Assert.IsNotNull(test);
- Assert.IsTrue(test.Item1 == "661430035");
+ Assert.IsTrue(test.IKKrankenkasse == "661430035");
- Assert.IsTrue(test.Item2 == "106492406");
+ Assert.IsTrue(test.IKKostentrager == "106492406");
- Assert.IsTrue(test.Item3 == "105328415");
+ Assert.IsTrue(test.IKDatenannahmestelle == "105328415");
}
[TestMethod]
@@ -67,11 +67,11 @@ namespace DakotaUnitTest
Assert.IsNotNull(test);
- Assert.IsTrue(test.Item1 == "104212516");
+ Assert.IsTrue(test.IKKrankenkasse == "104212516");
- Assert.IsTrue(test.Item2 == "104212505");
+ Assert.IsTrue(test.IKKostentrager == "104212505");
- Assert.IsTrue(test.Item3 == "104212505");
+ Assert.IsTrue(test.IKDatenannahmestelle == "104212505");
}
[TestMethod]
@@ -89,11 +89,11 @@ namespace DakotaUnitTest
Assert.IsNotNull(test);
- Assert.IsTrue(test.Item1 == "109905003");
+ Assert.IsTrue(test.IKKrankenkasse == "109905003");
- Assert.IsTrue(test.Item2 == "109905003");
+ Assert.IsTrue(test.IKKostentrager == "109905003");
- Assert.IsTrue(test.Item3 == "109905003");
+ Assert.IsTrue(test.IKDatenannahmestelle == "109905003");
}
}
}
diff --git a/Data/Data.csproj b/Data/Data.csproj
index c66407bb8..5d3b39fad 100644
--- a/Data/Data.csproj
+++ b/Data/Data.csproj
@@ -435,7 +435,6 @@
-
diff --git a/Host/GkvAbrechnungServer.aspx.cs b/Host/GkvAbrechnungServer.aspx.cs
index 92b75c054..340494250 100644
--- a/Host/GkvAbrechnungServer.aspx.cs
+++ b/Host/GkvAbrechnungServer.aspx.cs
@@ -36,7 +36,7 @@ namespace Host
private string ResultFolderPath { get; set; } = ConfigurationManager.AppSettings.Get("GkvAbrechnungResultFolderPath");
private string QueueFolderPath { get; set; } = ConfigurationManager.AppSettings.Get("GkvAbrechnungQueueFolderPath");
private string KostentragerdateiFolderPath { get; set; } = ConfigurationManager.AppSettings.Get("GkvKostentragerdateiFolderPath");
-
+
protected void Page_Load(object sender, EventArgs e)
{
try
@@ -67,6 +67,10 @@ namespace Host
GetStatus(GkvSender.DeserializeRequest(str, SendInvalidInputResponse));
return;
+ case RequestType.GkvServerGetNumber:
+ GetNumber(GkvSender.DeserializeRequest(str, SendInvalidInputResponse));
+ return;
+
default:
SendErrorResponse("RequestType unbekannt.");
return;
@@ -78,7 +82,18 @@ namespace Host
}
catch (Exception ex)
{
- var ex_text = ex.Message + "\n" + ex.StackTrace;
+ var ex_text = ex.Message + "\n\n" + ex.StackTrace;
+
+ if(ex.InnerException != null)
+ {
+ ex_text += "\n\n" + ex.InnerException.Message + "\n\n" + ex.InnerException.StackTrace;
+
+ if (ex.InnerException.InnerException != null)
+ {
+ ex_text += "\n\n" + ex.InnerException.InnerException.Message + "\n\n" + ex.InnerException.InnerException.StackTrace;
+ }
+ }
+
SendErrorResponse("Exception: " + ex_text);
}
@@ -110,7 +125,7 @@ namespace Host
if (string.IsNullOrEmpty(server))
return false;
- var loginurl = string.Format(LOGINSERVER_URL, $"https://{server}/service");
+ var loginurl = string.Format(LOGINSERVER_URL, $"https://{server}/service_developer");
#if DEBUG
if (server.IndexOf("localhost") >= 0)
@@ -245,6 +260,23 @@ namespace Host
return;
}
+ private void GetNumber(GkvServerGetNumberRequestDC req)
+ {
+ var response = new GkvServerGetNumberResponseDC(false);
+
+ var path = ConfigurationManager.AppSettings.Get("GkvAbrechnungRootPath");
+ var filePath = Path.Combine(path, "numbers.json");
+ var manager = new DakotaNumberManager(filePath);
+
+ (response.Datenaustauschreferenz, response.Transfernummer)
+ = manager.GetNextNumber(req.IKDatenannahmestelle, req.NewDatenaustauschRef);
+
+ response.Success = true;
+
+ SendResponse(response);
+
+ return;
+ }
private string SaveFileInQueue(GkvServerSendNewRequestDC req)
{
diff --git a/Host/Host.csproj b/Host/Host.csproj
index 7f31ffc91..b7da36ee3 100644
--- a/Host/Host.csproj
+++ b/Host/Host.csproj
@@ -58,6 +58,18 @@
x64
+
+ False
+ ..\Lib\Castle.Core.dll
+
+
+ False
+ ..\Lib\Castle.DynamicProxy.dll
+
+
+ False
+ ..\Lib\Castle.DynamicProxy2.dll
+
False
@@ -86,8 +98,8 @@
-
- ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.2\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.9.0.11\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
..\packages\Microsoft.CodeAnalysis.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll
@@ -110,6 +122,10 @@
..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll
+
+ False
+ ..\Lib\NHibernate.ByteCode.Castle.dll
+
..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
@@ -135,8 +151,12 @@
+
+ ..\packages\System.IO.Pipelines.9.0.11\lib\net462\System.IO.Pipelines.dll
+
- ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
+ False
+ ..\Lib\System.Memory.dll
@@ -153,8 +173,14 @@
..\packages\System.Text.Encoding.CodePages.9.0.2\lib\net462\System.Text.Encoding.CodePages.dll
-
- ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
+ ..\packages\System.Text.Encodings.Web.9.0.11\lib\net462\System.Text.Encodings.Web.dll
+
+
+ ..\packages\System.Text.Json.9.0.2\lib\net462\System.Text.Json.dll
+
+
+ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user
index 5ee749fcf..18dae3adc 100644
--- a/Host/Host.csproj.user
+++ b/Host/Host.csproj.user
@@ -19,7 +19,7 @@
- NoStartPage
+ CurrentPage
True
False
False
@@ -33,7 +33,7 @@
True
- True
+ False
diff --git a/Host/Web.Deploy.config b/Host/Web.Deploy.config
index b3d7e124c..e17f5e268 100644
--- a/Host/Web.Deploy.config
+++ b/Host/Web.Deploy.config
@@ -25,12 +25,64 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -324,6 +376,7 @@
+
diff --git a/Host/Web.config b/Host/Web.config
index 7bfc109eb..23f4cb096 100644
--- a/Host/Web.config
+++ b/Host/Web.config
@@ -25,11 +25,11 @@
-
+
-
+
@@ -41,7 +41,7 @@
-
+
@@ -75,6 +75,14 @@
+
+
+
+
+
+
+
+
@@ -287,7 +295,7 @@
-
+
@@ -339,7 +347,7 @@
-
+
@@ -377,6 +385,7 @@
+
@@ -388,7 +397,7 @@
-
+
diff --git a/Host/packages.config b/Host/packages.config
index 821401ba1..4fc24c980 100644
--- a/Host/packages.config
+++ b/Host/packages.config
@@ -3,7 +3,7 @@
-
+
@@ -21,10 +21,14 @@
+
+
+
+
\ No newline at end of file
diff --git a/Lib/System.Memory.dll b/Lib/System.Memory.dll
new file mode 100644
index 000000000..461719979
Binary files /dev/null and b/Lib/System.Memory.dll differ
diff --git a/Report/ReportObjects/GkvAbrechnungRO.cs b/Report/ReportObjects/GkvAbrechnungRO.cs
index 00deac181..59d293e1c 100644
--- a/Report/ReportObjects/GkvAbrechnungRO.cs
+++ b/Report/ReportObjects/GkvAbrechnungRO.cs
@@ -1,11 +1,11 @@
using BeWo.Data.Entities;
-using BeWo.Data.Models;
using BeWo.Service.Plugins;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.GkvAbrechnung;
using BS.Shared.Extensions;
+using BS.Shared.Models;
using DevExpress.XtraPrinting.Drawing;
using System;
using System.Collections.Generic;
diff --git a/Report/app.config b/Report/app.config
index 07ce74d83..0678b5bb0 100644
--- a/Report/app.config
+++ b/Report/app.config
@@ -70,6 +70,10 @@
+
+
+
+
diff --git a/ReportImp/BBIRheinSieg/BBIRheinSieg.csproj b/ReportImp/BBIRheinSieg/BBIRheinSieg.csproj
new file mode 100644
index 000000000..48fe90ed2
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/BBIRheinSieg.csproj
@@ -0,0 +1,100 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {A6D3E7D4-3AE7-475E-A1FD-D816F0A88043}
+ Library
+ Properties
+ BBIRheinSieg
+ 6652760522_Reports
+ v4.7.2
+ 512
+
+
+
+ true
+ full
+ false
+ ..\..\CustomerDlls\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ ..\..\CustomerDlls\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {B0D73E3D-4AE7-4024-93A6-DB1F46D7CCEE}
+ Data
+
+
+ {40d8b312-ea64-49e3-a31a-5e57ed4d5654}
+ Report
+
+
+ {094331c3-ecee-4c89-bbfd-4c9ded89f0ef}
+ Service
+
+
+ {2f50b83d-a3f0-4ec4-979a-3f9b7e3d8ed4}
+ Shared
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReportImp/BBIRheinSieg/Calculations/CustomGroupDurationCalculator.cs b/ReportImp/BBIRheinSieg/Calculations/CustomGroupDurationCalculator.cs
new file mode 100644
index 000000000..c12e4220d
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Calculations/CustomGroupDurationCalculator.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using BeWo.Service.Plugins;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Services;
+
+namespace TemplateNeuKunde.Calculations
+{
+ //public class CustomGroupDurationCalculator : GroupDurationCalculator
+ //{
+ // public override GroupDurationDC CalculateGroupDuration(int personCount, int employeeCount, decimal totalDuration)
+ // {
+ // return new GroupDurationDC()
+ // {
+ // SingleDuration = (totalDuration / personCount) * employeeCount,
+ // TotalDuration = totalDuration
+ // };
+ // }
+
+ //}
+}
diff --git a/ReportImp/BBIRheinSieg/Calculations/DefaultCalculations.cs b/ReportImp/BBIRheinSieg/Calculations/DefaultCalculations.cs
new file mode 100644
index 000000000..906e9d981
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Calculations/DefaultCalculations.cs
@@ -0,0 +1,25 @@
+using System;
+
+namespace TemplateNeuKunde.Calculations
+{
+
+ //public class DefaultCalculations : BS.Shared.Services.Calculations
+ //{
+ // public override int GetRoundedDuration(int minuteInterval, decimal durationInMinutes)
+ // {
+ // decimal lRoundedDuration = durationInMinutes;
+
+ // if (minuteInterval > 0 && durationInMinutes >= 5)
+ // {
+ // lRoundedDuration = durationInMinutes % minuteInterval != 0
+ // ? durationInMinutes + (minuteInterval - (durationInMinutes % minuteInterval))
+ // : durationInMinutes;
+ // }
+
+ // return (int)Math.Round(lRoundedDuration, 0, MidpointRounding.AwayFromZero);
+ // }
+
+
+
+ //}
+}
\ No newline at end of file
diff --git a/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceCreation.cs b/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceCreation.cs
new file mode 100644
index 000000000..7d5aee1ec
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceCreation.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Report.ReportObjects;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Invoicing;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using BS.Shared.Services;
+using Service.Invoicing;
+
+namespace TemplateNeuKunde.Invoicing
+{
+ // public class CustomInvoiceCreation : InvoiceCreation
+ //{
+ // //public override void SetInvoiceId(ServiceInvoice invoice)
+ // //{
+ // // //invoice.InvoiceBase.InvoiceId = "SBD";
+ // // //invoice.InvoiceBase.InvoiceTypeText = "";
+ // //}
+
+
+ // // //Setze für Selbstzahler die Adresse des Klienten
+ // // public override void SetRecipientInformation(ServiceInvoice serviceInvoice, CostBearer costBearer)
+ // // {
+ // // if (costBearer.Organisation.Name == "Selbstzahler")
+ // // {
+ // // serviceInvoice.InvoiceBase.RecipientOrganisationOid = costBearer.Organisation.Oid;
+
+ // // if (serviceInvoice.InvoiceBase.CostBearer2SupportConcept != null)
+ // // {
+ // // var cust = serviceInvoice.InvoiceBase.CostBearer2SupportConcept.SupportConcept.Customer;
+
+ // // if (cust.Person.InvoiceAddress != null)
+ // // {
+ // // serviceInvoice.InvoiceBase.RecipientAddress = cust.Person.InvoiceAddress.CopyToNew();
+ // // }
+ // // else if (cust.Person.Address != null)
+ // // {
+ // // serviceInvoice.InvoiceBase.RecipientAddress = cust.Person.Address.CopyToNew();
+ // // }
+
+ // // serviceInvoice.InvoiceBase.RecipientPersonFirstName = cust.Person.FirstName;
+ // // serviceInvoice.InvoiceBase.RecipientPersonLastName = cust.Person.LastName;
+ // // serviceInvoice.InvoiceBase.RecipientCustomerOid = cust.Oid;
+ // // }
+ // // }
+ // // }
+ // }
+}
diff --git a/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceFactory.cs b/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceFactory.cs
new file mode 100644
index 000000000..261ac0d43
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Invoicing/CustomInvoiceFactory.cs
@@ -0,0 +1,65 @@
+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 TemplateNeuKunde.Invoicing
+{
+ public class CustomInvoiceFactory : InvoiceFactory
+ {
+ // public override InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords)
+ // {
+ ////Hier einkommentieren, wenn die Rechnungserstellung von einer bestimmten Kategorie einer Bewilligung abhängt
+ //foreach (var item in supportConcepts2ServiceRecords)
+ //{
+ // var csc = item.Key;
+ // var cb2sc = DAOFactory.GenericDAO.LoadByID(csc.CostBearerRelOids[0]);
+
+ // foreach (var scap in cb2sc.ApprovalPeriodList)
+ // {
+ // if (scap.ServiceCategory != null)
+ // {
+ // var ic = GetInvoiceCreatorForCategory(scap.ServiceCategory.Name);
+ // if (ic != null)
+ // return ic;
+ // }
+ // }
+ //}
+
+ ////Hier einkommentieren, wenn die Rechnungserstellung von einer bestimmten Kategorie oder Organisation eines ServiceRecords abhängt
+ //foreach (var list in supportConcepts2ServiceRecords.Values)
+ // {
+ // foreach (var sr in list)
+ // {
+ // //Hier wird Kategorie geprüft
+ // var ic = GetInvoiceCreatorForCategory(sr.ServiceDescription.Category.Name);
+ // if (ic != null)
+ // return ic;
+
+ // //Hier wird Organisation geprüft
+ // if (sr.CostBearer.Name.ToLower().Contains("selbstzahler"))
+ // {
+ // return new CustomInvoiceCreation();
+ // }
+ // }
+ // }
+
+
+ // return base.CreateInvoiceCreator(specificId, tenant, supportConcepts2ServiceRecords);
+ // }
+
+ // private InvoiceCreation GetInvoiceCreatorForCategory(String catName)
+ // {
+ // if (!String.IsNullOrEmpty(catName))
+ // {
+ // String cat = catName.ToLower().Trim();
+ // if (cat.IndexOf("assistenz") >= 0)
+ // return new CustomInvoiceCreation();
+ // }
+ // return null;
+ // }
+ }
+}
diff --git a/ReportImp/BBIRheinSieg/Invoicing/CustomLWLDiggaBerechnung.cs b/ReportImp/BBIRheinSieg/Invoicing/CustomLWLDiggaBerechnung.cs
new file mode 100644
index 000000000..3d4dcc3af
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Invoicing/CustomLWLDiggaBerechnung.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Invoicing;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using BS.Shared.Services;
+
+namespace TemplateNeuKunde.Invoicing
+{
+ public class CustomLWLDiggaBerechnung : LWLDiggaBerechnung
+ {
+ public override void InitBerechnung()
+ {
+ //this.Umstellungsdatum = new DateTime(2025, 1, 1);
+ }
+ }
+}
diff --git a/ReportImp/BBIRheinSieg/Properties/AssemblyInfo.cs b/ReportImp/BBIRheinSieg/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..930888dd6
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Allgemeine Informationen über eine Assembly werden über die folgenden
+// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+// die einer Assembly zugeordnet sind.
+[assembly: AssemblyTitle("KundeXyz")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("KundeXyz")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
+// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
+// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
+[assembly: ComVisible(false)]
+
+// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
+[assembly: Guid("c1fed668-adb9-47e0-b589-1389618e1b6e")]
+
+// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+//
+// Hauptversion
+// Nebenversion
+// Buildnummer
+// Revision
+//
+// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+// indem Sie "*" wie unten gezeigt eingeben:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/ReportImp/BBIRheinSieg/Reporting/CustomMitarbeiterstundenkontoBerechnung.cs b/ReportImp/BBIRheinSieg/Reporting/CustomMitarbeiterstundenkontoBerechnung.cs
new file mode 100644
index 000000000..8b32a2d7b
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Reporting/CustomMitarbeiterstundenkontoBerechnung.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BeWo.Data.Entities;
+using BeWo.Report.ReportObjects;
+
+using BS.Shared.Extensions;
+
+
+namespace TemplateNeuKunde.Reporting
+{
+ public class CustomMitarbeiterstundenkontoBerechnung : MitarbeiterstundenkontoBerechnung
+ {
+ //Wenn halbe Feiertage konfiguriert werden sollen, muss diese Methode auch im VacationService einkommentiert werden
+ //public override decimal GetFeiertagsFaktor(DateTime start)
+ //{
+ // if (start.Month == 12)
+ // {
+ // if (start.Day == 24 || start.Day == 31)
+ // {
+ // return 0.5m;
+ // }
+ // }
+
+ // return base.GetFeiertagsFaktor(start);
+ //}
+ }
+}
diff --git a/ReportImp/BBIRheinSieg/Reporting/CustomReportCreator.cs b/ReportImp/BBIRheinSieg/Reporting/CustomReportCreator.cs
new file mode 100644
index 000000000..f89a7ed11
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Reporting/CustomReportCreator.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Report;
+using BeWo.Report.DefaultReports;
+using BeWo.Report.ReportObjects;
+using BeWo.Service.DCEntityMapper;
+using DevExpress.XtraReports.UI;
+
+namespace BBIRheinSieg.Reporting
+{
+ public class CustomReportCreator : DefaultReportCreator
+ {
+
+ public override XtraReport CreateServiceOverviewAllCustomersReport(int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay, bool nurFehlende)
+ {
+ List lROs = ServicesOverviewRO.Create(month, year, orgaOid, empOid, startDay, endDay, serviceCategoryOid, true, nurFehlende);
+
+ return CreateServiceOverviewReportForROs(lROs, orgaOid);
+ }
+
+ public override XtraReport CreateServiceOverviewSingleCustomerReport(long customerOid, int month, int year, long orgaOid, long empOid, long? serviceCategoryOid, int startDay, int endDay)
+ {
+ var ro = ServicesOverviewRO.Create(customerOid, month, year, false, orgaOid, empOid, startDay, endDay, serviceCategoryOid);
+
+ return CreateServiceOverviewReportForROs(new List { ro }, orgaOid);
+ }
+
+ }
+}
diff --git a/ReportImp/BBIRheinSieg/Service/CustomHomeContentGenerator.cs b/ReportImp/BBIRheinSieg/Service/CustomHomeContentGenerator.cs
new file mode 100644
index 000000000..d05aaae5b
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Service/CustomHomeContentGenerator.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.Compact;
+
+namespace TemplateNeuKunde.Service
+{
+ //public class CustomHomeContentGenerator : HomeContentGenerator
+ //{
+
+ //Einkommentieren um Geburtstage auszublenden
+ // public override List GetPersonsHavingBirthday(DateTime birthdayUntil)
+ // {
+// return new List();
+ // List alle = base.GetPersonsHavingBirthday(birthdayUntil);
+ // List nurMitarbeiter = new List();
+
+ // foreach (var compactPersonDc in alle)
+ // {
+ // if (compactPersonDc.PersonType == PersonType.Employee)
+ // {
+ // nurMitarbeiter.Add(compactPersonDc);
+ // }
+ // }
+ // return nurMitarbeiter;
+ // }
+ //}
+}
diff --git a/ReportImp/BBIRheinSieg/Service/CustomVacationService.cs b/ReportImp/BBIRheinSieg/Service/CustomVacationService.cs
new file mode 100644
index 000000000..46ee829e7
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Service/CustomVacationService.cs
@@ -0,0 +1,45 @@
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace TemplateNeuKunde.Service
+{
+ //public class CustomVacationService : VacationService
+ //{
+ // //public override string Bundesland { get => "Bayern"; }
+
+ // // public override List GetFeiertage(int year, String bundesland)
+ // // {
+ // // List list = base.GetFeiertage(year, bundesland);
+ // // list.Add(new FeiertagDC { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
+
+ // // return list;
+ // // }
+
+
+ // //Wenn halbe Feiertage konfiguriert werden sollen, muss diese Methode auch in CustomMitarbeiterstundenkontoBerechnung einkommentiert werden
+ // //public override decimal GetFeiertagsFaktor(DateTime start)
+ // //{
+ // // if (start.Month == 12)
+ // // {
+ // // if (start.Day == 24 || start.Day == 31)
+ // // {
+ // // return 0.5m;
+ // // }
+ // // }
+
+ // // return base.GetFeiertagsFaktor(start);
+ // //}
+ //}
+
+
+}
diff --git a/ReportImp/BBIRheinSieg/Service/CustomVertretungsManager.cs b/ReportImp/BBIRheinSieg/Service/CustomVertretungsManager.cs
new file mode 100644
index 000000000..ceef43f3b
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Service/CustomVertretungsManager.cs
@@ -0,0 +1,93 @@
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Plugins;
+using BeWo.Service.SBD;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.DataContracts.Compact;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+
+
+namespace BBIRheinSieg.Service
+{
+ public class CustomVertretungsManager : VertretungsManager
+ {
+
+ public override List SucheVertreter(VertreterSucheFilterDC filter)
+ {
+ var vertretungsListe = CreateVertretungsListe(filter.StartDate, filter.EndDate);
+
+ // EmployeeOids der Mitarbeiter, die einen abwesenden Mitarbeiter vertreten
+ var alleZugewiesenenVertreterEmpOids = vertretungsListe.Where(vertretungsItem => vertretungsItem.VertretungsStatus != VertretungsStatus.KlientKrank &&
+ vertretungsItem.Vertreter != null &&
+ vertretungsItem.Vertreter.ActivationType == ActivationTypeId.Active).Select(item => item.Vertreter.EmployeeOid).ToList();
+
+
+ // EmployeeOids von abwesenden Mitarbeitern
+ var abwesenendeEmployeeOids = vertretungsListe.Where(vertretungsItem => vertretungsItem.VertretungsStatus != VertretungsStatus.KlientKrank &&
+ vertretungsItem.Employee != null).Select(item => item.Employee.EmployeeOid);
+
+
+ var team = DAOFactory.GenericDAO.GetAllActive().Where(t => t.Name == "Vertretungsplanung").FirstOrDefault();
+ if (team != null)
+ {
+ var list = new List();
+
+ var allEmps = team.MemberList;
+ var empsInResult = new List();
+
+ foreach (var emp in allEmps)
+ {
+ if (!alleZugewiesenenVertreterEmpOids.Contains(emp.Oid.Value) && !abwesenendeEmployeeOids.Contains(emp.Oid.Value) && !IsAbwesend(emp, filter.StartDate, filter.EndDate))
+ {
+ empsInResult.Add(emp);
+
+ var dc = MapperFactory.CompactVertreterEmployeeDC_VertreterEmployee.MapToNewDC(emp);
+
+ list.Add(dc);
+ }
+ }
+
+
+ //Füge alle Employees zu, deren Kind krank sind
+ var schonVorhandeneEmps = empsInResult.Select(e => e.Oid.Value).ToList();
+
+ var employeeOids = vertretungsListe.Where(vertretungsItem => vertretungsItem.Employee != null &&
+ vertretungsItem.VertretungsStatus == VertretungsStatus.KlientKrank && !schonVorhandeneEmps.Contains(vertretungsItem.Employee.EmployeeOid)).Select(s => s.Employee.EmployeeOid).Distinct().ToList();
+
+ if (employeeOids.Count > 0)
+ {
+
+ var weitereEmps = DAOFactory.GenericDAO.LoadByIDs(employeeOids);
+ list.AddRange(MapperFactory.CompactVertreterEmployeeDC_VertreterEmployee.MapToNewDCs(weitereEmps));
+ }
+
+ return list;
+
+
+ }
+
+ return base.SucheVertreter(filter);
+ }
+
+ private bool IsAbwesend(Employee emp, DateTime startDate, DateTime endDate)
+ {
+ foreach (var at in emp.AbsenceTimes)
+ {
+ if (at.Start <= startDate && (!at.End.HasValue || at.End >= endDate))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ }
+}
diff --git a/ReportImp/BBIRheinSieg/Service/DefaultSaveInterceptor.cs b/ReportImp/BBIRheinSieg/Service/DefaultSaveInterceptor.cs
new file mode 100644
index 000000000..28d127934
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Service/DefaultSaveInterceptor.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using BeWo.Data.Access;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using BS.Shared.Services;
+
+namespace TemplateNeuKunde.Validation
+{
+
+ //public class DefaultSaveInterceptor : SaveInterceptor
+ // {
+ // public override string AllowSaveCustomer(CustomerDC c)
+ // {
+ // if (c.CustomerOid.HasValue)
+ // {
+ // return null;
+ // }
+
+ // if (!c.DateOfBirth.HasValue)
+ // {
+ // return "Bitte geben Sie ein Geburtsdatum an.";
+ // }
+
+ // if (!String.IsNullOrWhiteSpace(c.FirstName) && !String.IsNullOrWhiteSpace(c.LastName) && c.DateOfBirth.HasValue)
+ // {
+ // var duplicates = DAOFactory.SearchDAO.FindCustomer(c.FirstName, c.LastName, c.DateOfBirth.Value);
+ // if (duplicates != null && duplicates.Count > 0)
+ // {
+ // var dc = duplicates[0];
+ // String archiviert = "";
+
+
+ // if (dc.Person.Sex.HasValue && dc.Person.Sex.Value == Sex.Female)
+ // {
+ // if (dc.IsActive == ActivationTypeId.Archived)
+ // {
+ // archiviert = "archivierte ";
+ // }
+ // return String.Format(
+ // "Es gibt bereits eine {3}Klientin {0} {1}, geb. am {2:dd.MM.yyyy}.", dc.Person.FirstName, dc.Person.LastName, dc.Person.DateOfBirth, archiviert);
+ // }
+ // else
+ // {
+ // if (dc.IsActive == ActivationTypeId.Archived)
+ // {
+ // archiviert = "archivierten ";
+ // }
+ // return String.Format(
+ // "Es gibt bereits einen {3}Klienten {0} {1}, geb. am {2:dd.MM.yyyy}.", dc.Person.FirstName, dc.Person.LastName, dc.Person.DateOfBirth, archiviert);
+ // }
+ // }
+ // }
+ // return base.AllowSaveCustomer(c);
+ // }
+ // }
+}
\ No newline at end of file
diff --git a/ReportImp/BBIRheinSieg/Statistics/CustomServiceRecordStatisticFactory.cs b/ReportImp/BBIRheinSieg/Statistics/CustomServiceRecordStatisticFactory.cs
new file mode 100644
index 000000000..2267e43b3
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Statistics/CustomServiceRecordStatisticFactory.cs
@@ -0,0 +1,113 @@
+using System;
+using System.Collections.Generic;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.DataContracts;
+
+
+namespace TemplateNeuKunde.Statistics
+{
+ //public class CustomServiceRecordStatisticFactory : ServiceRecordStatisticFactory
+ // {
+
+ // public override ServiceRecordStatisticsInfoDC GetServiceRecordStatisticInfo(long costBearer2SupportConceptOid, DateTime statisticsDate)
+ // {
+ // var stats = CreateSupportConceptStatisticsImpl(costBearer2SupportConceptOid, statisticsDate);
+
+ // var dc = new ServiceRecordStatisticsInfoDC();
+
+
+
+ // dc.Header = new string[4];
+ // dc.Header[0] = "Bewilligungszeitraum:";
+ // dc.Header[1] = "Geleistet diesen Monat/Gesamt:";
+ // dc.Header[2] = "Bewilligt diesen Monat/Gesamt:";
+ // dc.Header[3] = "Frei diesen Monat/Gesamt:";
+
+ // dc.ForegroundColor = new string[4];
+ // dc.ForegroundColor[0] = "#FF2B508B";
+ // dc.ForegroundColor[1] = "#FF2B508B";
+ // dc.ForegroundColor[2] = "#FF2B508B";
+ // dc.ForegroundColor[3] = "#FF2B508B";
+
+ // dc.PeriodStatisticInfos = new List();
+
+
+ // if (stats != null)
+ // {
+ // if (stats.PeriodStatistics.Count > 1 && !TimeSpanIsEqual(stats))
+ // dc.PeriodStatisticInfos.Add(CreateTotalStatistics(stats, statisticsDate));
+
+ // foreach (var pdc in stats.PeriodStatistics)
+ // {
+ // dc.PeriodStatisticInfos.Add(CreateServiceRecordPeriodStatisticsInfo(stats, pdc, statisticsDate));
+ // }
+ // }
+
+ // return dc;
+ // }
+
+
+ // public ServiceRecordPeriodStatisticsInfoDC CreateTotalStatistics(SupportConceptStatisticsDC stats, DateTime statisticsDate)
+ // {
+ // var dc = CreateDefaultServiceRecordPeriodStatisticsInfo(4);
+ // dc.LeftValues[0] = "Gesamt";
+
+ // dc.LeftValues[1] = String.Format("{0:0.00}", stats.MinutesProvidedThisMonth / 60);
+ // dc.RightValues[1] = String.Format("{0:0.00}", stats.MinutesProvidedTotalRounded / 60);
+
+ // dc.LeftValues[2] = String.Format("{0:0.00}", stats.MinutesApprovedPerMonth / 60);
+ // dc.RightValues[2] = String.Format("{0:0.00}", stats.MinutesApprovedTotal / 60);
+
+ // dc.LeftValues[3] = String.Format("{0:0.00}", (stats.MinutesApprovedPerMonth - stats.MinutesProvidedThisMonth) / 60);
+ // dc.RightValues[3] = String.Format("{0:0.00}", (stats.MinutesApprovedTotal - stats.MinutesProvidedTotalRounded) / 60);
+
+ // return dc;
+ // }
+
+ // public ServiceRecordPeriodStatisticsInfoDC CreateServiceRecordPeriodStatisticsInfo(SupportConceptStatisticsDC stats, SupportConceptPeriodStatisticsDC periodStats, DateTime statisticsDate)
+ // {
+ // var dc = CreateDefaultServiceRecordPeriodStatisticsInfo(4);
+
+ // if (periodStats.SupportConceptApprovalPeriod != null)
+ // {
+ // if (periodStats.SupportConceptApprovalPeriod.ServiceCategory != null)
+ // {
+ // dc.LeftValues[0] = String.Format("{0}: {1:dd.MM.yy} - {2:dd.MM.yy}",
+ // periodStats.SupportConceptApprovalPeriod.ServiceCategory.Name,
+ // periodStats.SupportConceptApprovalPeriod.StartDate,
+ // periodStats.SupportConceptApprovalPeriod.EndDate);
+ // }
+ // else
+ // {
+ // dc.LeftValues[0] = String.Format("{0:dd.MM.yy} - {1:dd.MM.yy}",
+ // periodStats.SupportConceptApprovalPeriod.StartDate,
+ // periodStats.SupportConceptApprovalPeriod.EndDate);
+ // }
+ // }
+
+ // dc.LeftValues[1] = String.Format("{0:0.00}", periodStats.MinutesProvidedThisMonth / 60);
+ // dc.RightValues[1] = String.Format("{0:0.00}", periodStats.MinutesProvidedTotalRounded / 60);
+
+ // dc.LeftValues[2] = String.Format("{0:0.00}", periodStats.MinutesApprovedPerMonth / 60);
+ // dc.RightValues[2] = String.Format("{0:0.00}", periodStats.MinutesApprovedTotal / 60);
+
+ // dc.LeftValues[3] = String.Format("{0:0.00}", (periodStats.MinutesApprovedPerMonth - periodStats.MinutesProvidedThisMonth) / 60);
+ // dc.RightValues[3] = String.Format("{0:0.00}", (periodStats.MinutesApprovedTotal - periodStats.MinutesProvidedTotalRounded) / 60);
+
+ // return dc;
+ // }
+
+ // public override decimal GetApprovedMinutesPerMonth(SupportConceptPeriodStatisticsDC periodStats)
+ // {
+ // if (periodStats.SupportConceptApprovalPeriod != null && periodStats.SupportConceptApprovalPeriod.StartDate.HasValue && periodStats.SupportConceptApprovalPeriod.EndDate.HasValue)
+ // {
+ // if (periodStats.SupportConceptApprovalPeriod.ApprovedBEPerInterval.HasValue && periodStats.SupportConceptApprovalPeriod.ApprovedBEInterval.HasValue && periodStats.SupportConceptApprovalPeriod.ApprovedBEInterval.Value == SupportConceptApprovalInterval.Monthly)
+ // {
+ // return periodStats.SupportConceptApprovalPeriod.ApprovedBEPerInterval.Value * 60;
+ // }
+ // }
+ // return base.GetApprovedMinutesPerMonth(periodStats);
+ // }
+ // }
+}
diff --git a/ReportImp/BBIRheinSieg/Validation/ServiceRecordValidator.cs b/ReportImp/BBIRheinSieg/Validation/ServiceRecordValidator.cs
new file mode 100644
index 000000000..3e394fda6
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/Validation/ServiceRecordValidator.cs
@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using BeWo.Data;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+
+namespace TemplateNeuKunde.Validation
+{
+ //public class CustomServiceRecordValidator : ServiceRecordValidator
+ //{
+ // public override string[] GetIgnoreCategoriesForOverlappingCheck()
+ // {
+ // return new[] { "Arbeitszeiterfassung" };
+ // }
+
+
+ // public override List ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics,
+ // int maxDaysEditServiceRecordsAllowed, IList employeeOids, IList cb2scOids)
+ // {
+ // var list = base.ValidateServiceRecord(newServiceRecord, statistics, maxDaysEditServiceRecordsAllowed, employeeOids, cb2scOids);
+
+ // if (newServiceRecord.ServiceDescription.Category.IsBillable && newServiceRecord.RoundedDuration == 0)
+ // {
+
+ // list.Add(new ServiceRecordValidationResultDC
+ // {
+ // ResultType = ServiceRecordValidationResult.Custom,
+ // Message = "Die Dauer muss größer als 0 sein."
+ // });
+
+ // }
+
+ // var sd = newServiceRecord.ServiceDescription.Name.ToLower();
+ // var cat = newServiceRecord.ServiceDescription.Category.Name.ToLower();
+
+ // if (cat.Contains("arztbesuch") ||
+ // cat.Contains("krank") ||
+ // cat.Contains("fortbildung") ||
+ // cat.Contains("urlaub") ||
+ // cat.Contains("indirekte zeiten") ||
+ // (cat.Contains("betrieb") && cat.Contains("zeiten")))
+ // {
+ // if (sd.Contains("abwesend"))
+ // {
+
+ // list.Add(new ServiceRecordValidationResultDC
+ // {
+ // ResultType = ServiceRecordValidationResult.Custom,
+ // Message = "Dieser Eintrag kann nur von Fachleitungen oder Bereichsleitungen angelegt werden."
+ // });
+ // }
+ // }
+
+
+
+ // bool hasZukunftResult = false;
+
+ // foreach (var r in list)
+ // {
+ // if (r.ResultType == ServiceRecordValidationResult.Custom && r.Message.Contains("Zukunft"))
+ // {
+ // hasZukunftResult = true;
+ // }
+ // }
+ // if (!hasZukunftResult)
+ // {
+ // if (newServiceRecord.End.Value > DateTime.Now.AddMinutes(20))
+ // {
+ // list.Add(new ServiceRecordValidationResultDC
+ // {
+ // ResultType = ServiceRecordValidationResult.Custom,
+ // Message = "Das gewählte Datum darf nicht in der Zukunft liegen."
+ // });
+ // }
+ // }
+
+
+ // return list;
+ // }
+ // }
+}
\ No newline at end of file
diff --git a/ReportImp/BBIRheinSieg/app.config b/ReportImp/BBIRheinSieg/app.config
new file mode 100644
index 000000000..677131bde
--- /dev/null
+++ b/ReportImp/BBIRheinSieg/app.config
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ReportService/app.config b/ReportService/app.config
index 92ee995e1..bfb9007f5 100644
--- a/ReportService/app.config
+++ b/ReportService/app.config
@@ -62,6 +62,10 @@
+
+
+
+
diff --git a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
index f0339cd64..17caeee1e 100644
--- a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
+++ b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
@@ -34,10 +34,6 @@ namespace BeWo.Service.DCEntityMapper
isReady = false;
tooltip = "Fataler Fehler";
break;
- case GkvState.ErrorFolgefehler:
- isReady = false;
- tooltip = "Folgefehler";
- break;
case GkvState.Paid:
isReady = false;
tooltip = "Bereits bezahlt";
@@ -67,7 +63,7 @@ namespace BeWo.Service.DCEntityMapper
// Hole OrganisationLight
var orga = DAOFactory.GenericDAO.LoadByID(orga_oid);
- if (!Validator.IsOrganisationInformationValid(orga))
+ if (!GkvValidator.IsOrganisationInformationValid(orga))
{
isReady = false;
tooltip = "Organisation ist nicht Gkv Ready";
diff --git a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
index 524adb4b4..186ee1148 100644
--- a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
+++ b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
@@ -146,8 +146,12 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.CustomerOid = customer.Oid.Value;
pDataContract.CustomerFirstName = customer.Person.FirstName;
pDataContract.CustomerLastName = customer.Person.LastName;
- var error = Validator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus);
- pDataContract.IsGkvValidError = error;
+
+ var error = GkvValidator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus);
+ if (error is null)
+ error = GkvValidator.ValidateInvoiceBase(pDataContract);
+
+ pDataContract.IsGkvValidError = error;
pDataContract.IsGkvValid = error is null;
}
diff --git a/Service/Plugins/AccountingService.cs b/Service/Plugins/AccountingService.cs
index b8c8d1f7e..724c3d28a 100644
--- a/Service/Plugins/AccountingService.cs
+++ b/Service/Plugins/AccountingService.cs
@@ -4,7 +4,6 @@ using System.Linq;
using System.ServiceModel;
using BeWo.Data.Access;
using BeWo.Data.Entities;
-using BeWo.Data.Models;
using BeWo.Data.Security;
using BeWo.Service.Configuration;
using BeWo.Service.Core;
@@ -15,6 +14,7 @@ using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
+using BS.Shared.Models;
namespace BeWo.Service.Plugins
{
diff --git a/Service/ServiceContracts/IAccountingService.cs b/Service/ServiceContracts/IAccountingService.cs
index 73902a928..4bdc84838 100644
--- a/Service/ServiceContracts/IAccountingService.cs
+++ b/Service/ServiceContracts/IAccountingService.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
-using BeWo.Data.Models.XRechnung;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs
index 46018d1f8..149d3be3d 100644
--- a/Service/ServiceImplementations/AccountingServiceImp.cs
+++ b/Service/ServiceImplementations/AccountingServiceImp.cs
@@ -28,7 +28,6 @@ using BS.Shared.Extensions;
using BS.Shared.Exceptions;
using BS.Shared.AppSender;
using BeWo.Data.Security;
-using BeWo.Data.Models.XRechnung;
using BS.Shared.DataContracts.Invoicing.XRechnung;
using System.IO;
using BeWo.Service.ServiceUtils;
diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs
index 44e2e6bff..e9117921d 100644
--- a/Service/ServiceImplementations/CustomerServiceImp.cs
+++ b/Service/ServiceImplementations/CustomerServiceImp.cs
@@ -852,7 +852,7 @@ namespace BeWo.Service.ServiceImplementations
IList list = DAOFactory.GenericDAO.GetAllActiveAndArchived();
list = list.Where(x => !x.GkvAusblenden &&
- Validator.IsOrganisationInformationValid(x.IKDatenannahmestelle, x.IKKostentrager, x.IKKrankenkasse, x.BezDatenannahmestelle)).ToList();
+ GkvValidator.IsOrganisationInformationValid(x.IKDatenannahmestelle, x.IKKostentrager, x.IKKrankenkasse, x.BezDatenannahmestelle)).ToList();
return CreateCompactOrganisations(list);
}
diff --git a/Service/ServiceImplementations/Enhanced/AccountingEnhancedServiceImp.cs b/Service/ServiceImplementations/Enhanced/AccountingEnhancedServiceImp.cs
index e19eec014..15081c6b5 100644
--- a/Service/ServiceImplementations/Enhanced/AccountingEnhancedServiceImp.cs
+++ b/Service/ServiceImplementations/Enhanced/AccountingEnhancedServiceImp.cs
@@ -1,7 +1,6 @@
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
-using BeWo.Data.Models.XRechnung;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
diff --git a/Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs b/Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs
index 37722c448..3c859ee6b 100644
--- a/Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs
+++ b/Service/ServiceImplementations/Enhanced/OperationsEnhancedServiceImp.cs
@@ -1,7 +1,6 @@
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
-using BeWo.Data.Models.XRechnung;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
diff --git a/Service/ServiceImplementations/GkvAccountingServiceImp.cs b/Service/ServiceImplementations/GkvAccountingServiceImp.cs
index a0b18be3a..b04ab944c 100644
--- a/Service/ServiceImplementations/GkvAccountingServiceImp.cs
+++ b/Service/ServiceImplementations/GkvAccountingServiceImp.cs
@@ -329,11 +329,10 @@ namespace BeWo.Service.ServiceImplementations
Message = app8res.Message,
Success = app8res.Success,
Hausanschrift = app8res.Hausanschrift ?? new AddressDC(),
- Postfachanschrift=app8res.Postfachanschrift ?? new AddressDC(),
- Grosskundenanschrift =app8res.Grosskundenanschrift ?? new AddressDC()
+ Postfachanschrift = app8res.Postfachanschrift ?? new AddressDC(),
+ Grosskundenanschrift = app8res.Grosskundenanschrift ?? new AddressDC()
};
-
// Schaue, ob IK Krankenkassen bereits bei einer anderen Organisation hinterlegt ist
if (res.Gefunden)
{
@@ -378,12 +377,12 @@ namespace BeWo.Service.ServiceImplementations
var manager = new DakotaManager();
var mandatordc = new OperationsServiceImp().GetMandator();
- Validator.ValidateMandator(mandatordc);
+ GkvValidator.ValidateMandator(mandatordc);
var gkvAbrechnungDC = MapperFactory.GkvAbrechnungDC_GkvAbrechnung.MapToNewDC(gkvAbrechnung);
var orgadc = gkvAbrechnungDC.Organisation;
- Validator.ValidateOrganisation(orgadc);
+ GkvValidator.ValidateOrganisation(orgadc);
var datenannahmestelle = orgadc.IKDatenannahmestelle;
var (datenaustauschreferenz, transfernummer) = GetNextDatenaustauschreferenzTransfernummer(gkvAbrechnung, datenannahmestelle);
@@ -417,7 +416,7 @@ namespace BeWo.Service.ServiceImplementations
var servicedc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(service);
var customerdc = MapperFactory.CustomerDC_Customer.MapToNewDC(customer);
- Validator.ValidateCustomer(customerdc);
+ GkvValidator.ValidateCustomer(customerdc);
manager.Add(servicedc, orgadc, customerdc, addressInfo, dat_short, tra_short);
}
@@ -489,25 +488,23 @@ namespace BeWo.Service.ServiceImplementations
private Tuple GetNextDatenaustauschreferenzTransfernummer(GkvAbrechnung gkvAbrechnung, string datenannahmestelle)
{
- var datenaustauschref = DAOFactory.SearchDAO.GetNextDatenaustauschreferenz(datenannahmestelle);
- int transfernummer;
-
+ bool newDatenaustauschref;
var state = gkvAbrechnung.GetState();
if (state == GkvState.NoSend)
{
- transfernummer = DAOFactory.SearchDAO.GetNextTransfernummer(datenannahmestelle);
+ newDatenaustauschref = true;
}
- else if (state == GkvState.ErrorSoft || state == GkvState.ErrorFatal || state == GkvState.ErrorFolgefehler)
+ else if (state == GkvState.ErrorSoft || state == GkvState.ErrorFatal)
{
- transfernummer = gkvAbrechnung.GkvTransferProtokolle.Last().Transfernummer;
+ newDatenaustauschref = false;
}
else
{
throw new ArgumentException($"Versucht Transfernummer zu laden, invalid state: {state}", nameof(state));
}
- return new Tuple(datenaustauschref, transfernummer);
+ return SendApp8GetNumberRequest(datenannahmestelle, newDatenaustauschref, true);
}
private Tuple ClearDatenaustauschreferenzTransfernummer(int datenaustauschreferenz, int transfernummer)
{
@@ -603,6 +600,37 @@ namespace BeWo.Service.ServiceImplementations
return false;
}
+ private Tuple SendApp8GetNumberRequest(string ik_datenannahmestelle, bool newDatenaustauschref, bool newTransferNumber)
+ {
+ var request = new GkvServerGetNumberRequestDC();
+
+ request.IKDatenannahmestelle = ik_datenannahmestelle;
+ request.NewDatenaustauschRef = newDatenaustauschref;
+ request.NewTransferNumber = newTransferNumber;
+
+ GkvServerGetNumberResponseDC response_app8;
+
+ response_app8 = SendApp8Request(request);
+
+ if (!response_app8.Success)
+ throw new GkvException("Success false - " + response_app8.Message);
+
+ return new Tuple(response_app8.Datenaustauschreferenz, response_app8.Transfernummer);
+
+ // Kein Try-Catch, damit der Prozess oben abgebrochen wird
+
+ //try
+ //{
+
+ //}
+ //catch (Exception e)
+ //{
+ // MailUtils.SendGkvModuleErrorMail("GkvServerGetNumberRequest Error", e, Tenant);
+ //}
+
+ //return null;
+ }
+
public void HandleGkvServerResults(IEnumerable results)
{
var protokolls = new List();
@@ -626,9 +654,6 @@ namespace BeWo.Service.ServiceImplementations
case GkvTransferResultType.FailFatal:
protokoll.SentApp8Success = false;
break;
- case GkvTransferResultType.FailFollowUp:
- protokoll.SentApp8Success = false;
- break;
}
protokolls.Add(protokoll);
@@ -636,27 +661,6 @@ namespace BeWo.Service.ServiceImplementations
if (protokolls.Any())
DAOFactory.GenericDAO.Update(protokolls);
-
- var follows = results.Where(x => x.ResultType == GkvTransferResultType.FailFollowUp);
-
- if (follows.Any())
- {
- foreach (var follow in follows)
- {
- var protokoll_oid = follow.ProtokollOid;
- var abrechnung_oid = DAOFactory.FinanceDAO.GetGkvParentByProtokollOid(protokoll_oid);
-
- var new_req = new GkvAbrechnungSendRequestDC()
- {
- GkvAbrechnungOid = abrechnung_oid
- };
-
- var res = SendNewGkvAbrechnung(new_req);
-
- if (!res.Success)
- throw new GkvException("Success - " + res.Message);
- }
- }
}
private Res SendApp8Request(Req request) where Req : GkvServerRequestDC where Res : GkvResponseDC
diff --git a/Service/app.config b/Service/app.config
index 9c0be0903..e0d3afbb7 100644
--- a/Service/app.config
+++ b/Service/app.config
@@ -74,6 +74,10 @@
+
+
+
+
diff --git a/Shared/AppSender/GkvSender.cs b/Shared/AppSender/GkvSender.cs
index 413f397d3..e94a3d523 100644
--- a/Shared/AppSender/GkvSender.cs
+++ b/Shared/AppSender/GkvSender.cs
@@ -39,10 +39,10 @@ namespace BS.Shared.AppSender
public static Res SendApp8Request(Req request, string tenant) where Req : GkvServerRequestDC where Res : GkvResponseDC
{
- string url = "https://app8.bewoplaner.de/service/GkvAbrechnungServer.aspx";
+ string url = "https://app8.bewoplaner.de/service_developer/GkvAbrechnungServer.aspx";
#if DEBUG
- url = "http://localhost:3777/Host/GkvAbrechnungServer.aspx";
+ //url = "http://localhost:3777/Host/GkvAbrechnungServer.aspx";
#endif
Res app8_response;
@@ -69,7 +69,7 @@ namespace BS.Shared.AppSender
if (string.IsNullOrEmpty(server))
return null;
- var url = string.Format(GKVCLIENT_URL, $"https://{server}/service");
+ var url = string.Format(GKVCLIENT_URL, $"https://{server}/service_developer");
#if DEBUG
if (server.IndexOf("localhost") > 0)
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index 0df7a48c9..6d6c3cfbc 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -1300,8 +1300,9 @@ namespace BS.Shared
GkvServerGetIKNumber,
GkvServerGetStatus,
GkvClientResult,
- GkvClientSum
- }
+ GkvClientSum,
+ GkvServerGetNumber,
+ }
public enum GkvTransferResultType
{
@@ -1309,7 +1310,6 @@ namespace BS.Shared
Success = 0, // Kein Fehler
FailSoft = 1, // Kann erneut senden
FailFatal = 2, // Kann nicht erneut senden
- FailFollowUp = 3, // Muss neu berechnet werden
}
public enum GkvState
@@ -1317,7 +1317,6 @@ namespace BS.Shared
NoSend,
ErrorSoft,
ErrorFatal,
- ErrorFolgefehler,
Paid,
WaitingForDakota,
WaitingForKrankenkasse,
diff --git a/Shared/Core/Validator.cs b/Shared/Core/GkvValidator.cs
similarity index 85%
rename from Shared/Core/Validator.cs
rename to Shared/Core/GkvValidator.cs
index 24acd3b4a..71d09dd21 100644
--- a/Shared/Core/Validator.cs
+++ b/Shared/Core/GkvValidator.cs
@@ -6,11 +6,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace BS.Shared.Core
{
- public static class Validator
+ public static class GkvValidator
{
public static bool? IsValid(ValidationType val_type, string val_str)
{
@@ -73,7 +74,7 @@ namespace BS.Shared.Core
if (mandatordc == null)
throw new GkvException("Mandator ist null");
- if (!Validator.IsIKNumberValid(mandatordc.IKLeistungserbringer))
+ if (!IsIKNumberValid(mandatordc.IKLeistungserbringer))
throw new GkvException($"Die IK Nummer des Leistungserbringers \"{mandatordc.IKLeistungserbringer}\" ist ungültig.");
}
public static void ValidateCustomer(CustomerDC customerDC)
@@ -110,16 +111,35 @@ namespace BS.Shared.Core
if (error != null)
throw new GkvException(error);
}
- public static bool IsOrganisationInformationValid(IOrganisation orga)
+ public static string ValidateInvoiceBases(IEnumerable invoices)
+ {
+ foreach (var invoice in invoices)
+ {
+ if (ValidateInvoiceBase(invoice) is string error)
+ return error;
+ }
+
+ return null;
+ }
+ public static string ValidateInvoiceBase(IInvoiceBase invoice)
+ {
+ if (!IsInvoiceNumberValid(invoice.InvoiceNumber))
+ return $"Rechnungsnummer \"{invoice.InvoiceNumber}\" ist ungültig";
+
+ return null;
+ }
+
+ public static bool IsOrganisationInformationValid(IOrganisation orga)
{
return IsOrganisationInformationValid(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle);
- }
- public static bool IsOrganisationInformationValid(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
+ }
+ public static bool IsOrganisationInformationValid(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
=> IsIKNumberValid(ik_datenannahmestelle, ik_kostentrager, ik_krankenkasse) && IsBezDatenannahmestelleValid(bez_datenannahmestelle);
public static bool IsIKNumberValid(params string[] iks)
=> iks?.All(IsIKNumberValid) ?? false;
- public static bool IsBezDatenannahmestelleValid(string bez_datenannahmestelle)
+
+ public static bool IsBezDatenannahmestelleValid(string bez_datenannahmestelle)
{
return !string.IsNullOrWhiteSpace(bez_datenannahmestelle);
}
@@ -180,5 +200,11 @@ namespace BS.Shared.Core
return true;
}
+ public static bool IsInvoiceNumberValid(string invoiceNumber)
+ {
+ var pattern = @"^(?!.*[-/]{2})(?![-/])(?!.*[-/]$)[A-Za-z0-9]+(?:[/-][A-Za-z0-9]+)*$";
+
+ return Regex.IsMatch(invoiceNumber, pattern);
+ }
}
}
diff --git a/Shared/Core/ValidatorExtended.cs b/Shared/Core/ValidatorExtended.cs
index e8b008b28..868733164 100644
--- a/Shared/Core/ValidatorExtended.cs
+++ b/Shared/Core/ValidatorExtended.cs
@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace BS.Shared.Core
@@ -23,6 +24,8 @@ namespace BS.Shared.Core
error = "Unterschiedliche Rechnungspositionen";
else if (GetInvalidUnitDescription(invoiceBases) is IInvoiceItem invalid)
error = $"Ungültige Rechnungsposition: {invalid.ItemDescription}:{invalid.UnitDescription}";
+ else if (GkvValidator.ValidateInvoiceBases(invoiceBases) is string rtn_error)
+ error = rtn_error;
if(error is string)
throw new GkvException(error, "Validierung");
@@ -71,5 +74,7 @@ namespace BS.Shared.Core
return null;
}
+
+
}
}
diff --git a/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberRequestDC.cs b/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberRequestDC.cs
new file mode 100644
index 000000000..bf7ac4084
--- /dev/null
+++ b/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberRequestDC.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.DataContracts.GkvAbrechnung
+{
+ public class GkvServerGetNumberRequestDC : GkvServerRequestDC
+ {
+ public GkvServerGetNumberRequestDC()
+ : base(RequestType.GkvServerGetNumber) { }
+
+ public GkvServerGetNumberRequestDC(string tenant, string username, string password)
+ : base(RequestType.GkvServerGetNumber, tenant, username, password) { }
+
+ [DataMember] public string IKDatenannahmestelle { get; set; }
+ [DataMember] public bool NewDatenaustauschRef { get; set; }
+ [DataMember] public bool NewTransferNumber { get; set; }
+ }
+}
diff --git a/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberResponseDC.cs b/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberResponseDC.cs
new file mode 100644
index 000000000..0a9757965
--- /dev/null
+++ b/Shared/DataContracts/Invoicing/GkvAbrechnung/GkvServerGetNumberResponseDC.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BS.Shared.DataContracts.GkvAbrechnung
+{
+ public class GkvServerGetNumberResponseDC : GkvResponseDC
+ {
+ public GkvServerGetNumberResponseDC() : base() { }
+ public GkvServerGetNumberResponseDC(bool success) : base(success) { }
+ public GkvServerGetNumberResponseDC(bool success, string message) : base(success, message) { }
+
+ [DataMember] public int Datenaustauschreferenz { get; set; }
+ [DataMember] public int Transfernummer { get; set; }
+ }
+}
diff --git a/Shared/Extensions/GkvAbrechnungExtensions.cs b/Shared/Extensions/GkvAbrechnungExtensions.cs
index 21b967856..26f09cc84 100644
--- a/Shared/Extensions/GkvAbrechnungExtensions.cs
+++ b/Shared/Extensions/GkvAbrechnungExtensions.cs
@@ -24,9 +24,6 @@ namespace BS.Shared.Extensions
if (gkvAbrechnung.LastTransferProtokoll.ResultType == GkvTransferResultType.FailFatal)
return GkvState.ErrorFatal;
- if (gkvAbrechnung.LastTransferProtokoll.ResultType == GkvTransferResultType.FailFollowUp)
- return GkvState.ErrorFolgefehler;
-
if (gkvAbrechnung.LastTransferProtokoll.ResultType is null)
return GkvState.WaitingForDakota;
diff --git a/Shared/Interface/IInvoiceBase.cs b/Shared/Interface/IInvoiceBase.cs
index 52577d5d3..db3a0cc8e 100644
--- a/Shared/Interface/IInvoiceBase.cs
+++ b/Shared/Interface/IInvoiceBase.cs
@@ -9,6 +9,9 @@ namespace BS.Shared.Interface
public interface IInvoiceBase
{
long? Oid { get; }
+ string InvoiceNumber { get; }
+ string InvoiceTitle { get; }
+ string InvoiceId { get; }
string SenderStreet { get; }
string SenderTown { get; }
string SenderPostCode { get; }
diff --git a/Data/Models/AddressInformation.cs b/Shared/Models/AddressInformation.cs
similarity index 95%
rename from Data/Models/AddressInformation.cs
rename to Shared/Models/AddressInformation.cs
index 071b88ca4..1422e7111 100644
--- a/Data/Models/AddressInformation.cs
+++ b/Shared/Models/AddressInformation.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace BeWo.Data.Models
+namespace BS.Shared.Models
{
public class AddressInformation
{
diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj
index eea6d0941..00d94001b 100644
--- a/Shared/Shared.csproj
+++ b/Shared/Shared.csproj
@@ -151,7 +151,7 @@
-
+
@@ -187,6 +187,8 @@
+
+
@@ -416,6 +418,7 @@
+