Summe korrekt berechnet

This commit is contained in:
2024-11-14 16:46:59 +01:00
parent 1b1db0876f
commit 674b5b3fd9
2 changed files with 21 additions and 3 deletions

View File

@@ -102,11 +102,13 @@ namespace Dakota.Models.Blocke
{
var sumseg = new decimal[3];
Dictionary<int, decimal[]> segments = new Dictionary<int, decimal[]>();
Dictionary<string, decimal[]> segments = new Dictionary<string, decimal[]>();
foreach (var fall in NachrichtSLLA.BlockKlienten)
{
int status = 11;
var versicherten_status = fall.SegmentSLLAINV.Versichertenstatus.GetValue();
var schlüssel_summenstatus = SchlüsselSummenstatus.Parse(versicherten_status);
var status = schlüssel_summenstatus.Value;
if (!segments.ContainsKey(status))
{
@@ -133,7 +135,7 @@ namespace Dakota.Models.Blocke
NachrichtSLGA.SegmentGES00.Gesamtbruttobetrag.SetValue(sumseg[1]);
NachrichtSLGA.SegmentGES00.GesamtbetragZuzahlung.SetValue(sumseg[2]);
foreach (var key in segments.Keys)
foreach (var key in segments.Keys.OrderBy(x => x))
{
var segment = new SegmentSLGAGES();
var array = segments[key];

View File

@@ -15,5 +15,21 @@ namespace Dakota.Models.Schlüssels
public static SchlüsselSummenstatus Angehörige => new SchlüsselSummenstatus("31");
public static SchlüsselSummenstatus Rentner => new SchlüsselSummenstatus("51");
public static SchlüsselSummenstatus NichtZugehörigerStatus => new SchlüsselSummenstatus("99");
public static SchlüsselSummenstatus Parse(string versichtenstatus)
{
var status_key = versichtenstatus.FirstOrDefault();
if (status_key == '1')
return Mitglieder;
if (status_key == '3')
return Angehörige;
if (status_key == '5')
return Rentner;
return NichtZugehörigerStatus;
}
}
}