Alte GKV Abrechnung View deaktiviert, zum Löschen bereit
Versionen eingeführt, Sammelrechnung optional, standardhaft deaktiviert
This commit is contained in:
@@ -134,6 +134,24 @@ namespace BeWo.View.Master
|
||||
{
|
||||
tabitem_bargeldverwaltung.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
if (!BeWoApp.AppSettings.AllowGkvAbrechnung)
|
||||
{
|
||||
tabitem_gkvabrechnung.Visibility = Visibility.Collapsed;
|
||||
tabitem_gkvabrechnung_alt.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
if (BeWoApp.AppSettings.AllowGkvAbrechnung)
|
||||
{
|
||||
tabitem_gkvabrechnung.Visibility = Visibility.Visible;
|
||||
tabitem_gkvabrechnung_alt.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
tabitem_gkvabrechnung.Visibility = Visibility.Collapsed;
|
||||
tabitem_gkvabrechnung_alt.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
foreach (TabItem tabitem in root.Items)
|
||||
{
|
||||
if (tabitem.Visibility == Visibility.Visible)
|
||||
@@ -142,12 +160,6 @@ namespace BeWo.View.Master
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!BeWoApp.AppSettings.AllowGkvAbrechnung)
|
||||
{
|
||||
tabitem_gkvabrechnung.Visibility = Visibility.Collapsed;
|
||||
tabitem_gkvabrechnung_alt.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
private void tabitem_equityinvoice_Selected(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<Compile Include="Models\Segmente\SegmentUNT.cs" />
|
||||
<Compile Include="Models\Segmente\SegmentUNZ.cs" />
|
||||
<Compile Include="Models\Segmente\SLGA\SegmentSLGAUST.cs" />
|
||||
<Compile Include="Models\Blocke\BlockFile.cs" />
|
||||
<Compile Include="Models\Blocke\Nutzdatendatei.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Data\Data.csproj">
|
||||
|
||||
@@ -103,17 +103,17 @@ namespace Dakota.Logic
|
||||
return info;
|
||||
}
|
||||
|
||||
internal static void AddInfoParameter(this InfoDateiNutzdaten file, InfoParameterInvoiceItem infoParameter)
|
||||
internal static void AddInfoParameter(this InfoDateiNutzdaten file, InfoParameterInvoiceItem infoParameter, int version)
|
||||
{
|
||||
var blockkostentrager = file.GetDakotaInfoBlockKostentrager(infoParameter);
|
||||
var blockkvkarte = blockkostentrager.GetDakotaInfoBlockKvKarte(infoParameter);
|
||||
var blockkostentrager = file.GetDakotaInfoBlockKostentrager(infoParameter, version);
|
||||
var blockkvkarte = blockkostentrager.GetDakotaInfoBlockKvKarte(infoParameter, version);
|
||||
var abrechnungsfall = blockkvkarte.GetDakotaInfoAbrechnungsfall(infoParameter);
|
||||
var abrechnungsposition = abrechnungsfall.GetDakotaInfoAbrechnungsposition(infoParameter);
|
||||
|
||||
abrechnungsfall.InfosAbrechnungsposition.Add(abrechnungsposition);
|
||||
}
|
||||
|
||||
internal static InfoBlockKostentrager GetDakotaInfoBlockKostentrager(this InfoDateiNutzdaten file, InfoParameterInvoiceItem infoParameter)
|
||||
internal static InfoBlockKostentrager GetDakotaInfoBlockKostentrager(this InfoDateiNutzdaten file, InfoParameterInvoiceItem infoParameter, int version)
|
||||
{
|
||||
var ikkostentrager = infoParameter.IKKostentrager;
|
||||
var block = file.BlockKostentragers.FirstOrDefault(x => x.IKKostentrager == ikkostentrager);
|
||||
@@ -122,7 +122,7 @@ namespace Dakota.Logic
|
||||
{
|
||||
block = new InfoBlockKostentrager(ikkostentrager)
|
||||
{
|
||||
DakotaInfoSLGA = CreateDakotaInfoNachricht(true),
|
||||
DakotaInfoSLGA = CreateDakotaInfoNachricht(true, version),
|
||||
DakotaInfoNachrichtSLGA = CreateDakotaInfoNachrichtSLGA(infoParameter)
|
||||
};
|
||||
file.BlockKostentragers.Add(block);
|
||||
@@ -130,7 +130,7 @@ namespace Dakota.Logic
|
||||
|
||||
return block;
|
||||
}
|
||||
internal static InfoBlockKrankenkasse GetDakotaInfoBlockKvKarte(this InfoBlockKostentrager blockkostentrager, InfoParameterInvoiceItem infoParameter)
|
||||
internal static InfoBlockKrankenkasse GetDakotaInfoBlockKvKarte(this InfoBlockKostentrager blockkostentrager, InfoParameterInvoiceItem infoParameter, int version)
|
||||
{
|
||||
var ikkrankenkasse = infoParameter.IKKrankenkasse;
|
||||
var block = blockkostentrager.BlockKvKarte.FirstOrDefault(x => x.IKKrankenkasse == ikkrankenkasse);
|
||||
@@ -139,9 +139,9 @@ namespace Dakota.Logic
|
||||
{
|
||||
block = new InfoBlockKrankenkasse(ikkrankenkasse)
|
||||
{
|
||||
DakotaInfoSLGA = CreateDakotaInfoNachricht(true),
|
||||
DakotaInfoSLGA = CreateDakotaInfoNachricht(true, version),
|
||||
DakotaInfoNachrichtSLGA = CreateDakotaInfoNachrichtSLGA(infoParameter),
|
||||
DakotaInfoSLLA = CreateDakotaInfoNachricht(false),
|
||||
DakotaInfoSLLA = CreateDakotaInfoNachricht(false, version),
|
||||
DakotaInfoNachrichtSLLA = CreateDakotaInfoNachrichtSLLA(infoParameter)
|
||||
};
|
||||
blockkostentrager.BlockKvKarte.Add(block);
|
||||
@@ -173,14 +173,14 @@ namespace Dakota.Logic
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
private static InfoNachricht CreateDakotaInfoNachricht(bool isSLGA)
|
||||
private static InfoNachricht CreateDakotaInfoNachricht(bool isSLGA, int version)
|
||||
{
|
||||
var info = new InfoNachricht();
|
||||
var typ = isSLGA ? "SLGA" : "SLLA";
|
||||
|
||||
info.Nachrichtenreferenznummer = GetNextRefNumber();
|
||||
info.NachrichtenTypKennung = typ;
|
||||
info.NachrichtenVersionsnummer = "18";
|
||||
info.NachrichtenVersionsnummer = version.ToString();
|
||||
info.NachrichtenFreigabeNrTages = "0";
|
||||
info.NachrichtenVerwaltendeOrganisation = "0";
|
||||
|
||||
|
||||
@@ -12,15 +12,17 @@ namespace Dakota.Logic
|
||||
public class DakotaManager
|
||||
{
|
||||
public int Month { get; set; }
|
||||
public int Version { get; set; }
|
||||
|
||||
public Dictionary<string, DakotaFile> DakotaFileDict { get; set; }
|
||||
|
||||
public Dictionary<string, InfoDateiNutzdaten> DakotaInfoNutzDict { get; set; }
|
||||
public Dictionary<string, InfoDateiAuftrags> DakotaInfoAufDict { get; set; }
|
||||
|
||||
public DakotaManager(int _month)
|
||||
public DakotaManager(int month, DateTime dateTime)
|
||||
{
|
||||
Month = _month;
|
||||
Month = month;
|
||||
Version = GetVersion(dateTime);
|
||||
|
||||
DakotaFileDict = new Dictionary<string, DakotaFile>();
|
||||
|
||||
@@ -29,7 +31,6 @@ namespace Dakota.Logic
|
||||
}
|
||||
|
||||
public void Add(InfoParameterInvoiceItem info) => Add(info.ServiceInvoice, info.Organisation, info.Customer, info.Mandator);
|
||||
|
||||
public void Add(ServiceInvoiceDC serviceInvoice, OrganisationDC organisation, CustomerDC customer, MandatorDC mandator)
|
||||
{
|
||||
var ik_datenannahmestelle = organisation.IKDatenannahmestelle;
|
||||
@@ -52,7 +53,7 @@ namespace Dakota.Logic
|
||||
{
|
||||
var info_nutz_item = new InfoParameterInvoiceItem(serviceInvoice, invoice, organisation, customer, mandator);
|
||||
|
||||
nutzdaten.AddInfoParameter(info_nutz_item);
|
||||
nutzdaten.AddInfoParameter(info_nutz_item, Version);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +62,7 @@ namespace Dakota.Logic
|
||||
{
|
||||
foreach (var ik_datenannahmestelle in DakotaInfoNutzDict.Keys)
|
||||
{
|
||||
var file = new DakotaFile();
|
||||
var file = new DakotaFile(DateTime.Now);
|
||||
|
||||
var info_nutz = DakotaInfoNutzDict[ik_datenannahmestelle];
|
||||
var info_auf = DakotaInfoAufDict[ik_datenannahmestelle];
|
||||
@@ -101,5 +102,22 @@ namespace Dakota.Logic
|
||||
File.WriteAllBytes(pathauf, auftragsdatei2);
|
||||
}
|
||||
}
|
||||
|
||||
private int GetVersion(DateTime create4month)
|
||||
{
|
||||
if(create4month < new DateTime(2023, 7, 1))
|
||||
throw new NotImplementedException("Keine Unterstützung von Version 17 oder niedriger");
|
||||
|
||||
if (create4month < new DateTime(2024, 1, 1))
|
||||
return 18;
|
||||
|
||||
if (create4month < new DateTime(2024, 7, 1))
|
||||
return 19;
|
||||
|
||||
if (create4month < new DateTime(2025, 1, 1))
|
||||
return 20;
|
||||
|
||||
throw new NotImplementedException("Keine Unterstützung von Version 21 oder aufwärts");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,32 +16,37 @@ namespace Dakota.Models.Blocke
|
||||
/// </summary>
|
||||
internal class BlockKostenträger : Block
|
||||
{
|
||||
public bool IsSammelrechnung { get; private set; }
|
||||
|
||||
public SegmentUNH SegmentUNH { get; private set; }
|
||||
public NachrichtSLGA NachrichtSLGA { get; private set; }
|
||||
public NachrichtSLGA NachrichtSLGASammelrechnung { get; private set; }
|
||||
public SegmentUNT SegmentUNT { get; private set; }
|
||||
public List<BlockKrankenkasse> BlockKrankenkasse { get; private set; }
|
||||
|
||||
internal BlockKostenträger()
|
||||
internal BlockKostenträger(bool isSammelrechnung = false)
|
||||
{
|
||||
SegmentUNH = new SegmentUNH();
|
||||
NachrichtSLGA = new NachrichtSLGA();
|
||||
SegmentUNT = new SegmentUNT(NachrichtSLGA.GetSegmentLength);
|
||||
BlockKrankenkasse = new List<BlockKrankenkasse>();
|
||||
}
|
||||
IsSammelrechnung = isSammelrechnung;
|
||||
|
||||
public string IKKostenträger
|
||||
{
|
||||
get { return NachrichtSLGA.SegmentFKT.IKKostenträger.GetValue(); }
|
||||
set { NachrichtSLGA.SegmentFKT.IKKostenträger.SetValue(value); }
|
||||
if (isSammelrechnung)
|
||||
{
|
||||
SegmentUNH = new SegmentUNH();
|
||||
NachrichtSLGASammelrechnung = new NachrichtSLGA();
|
||||
SegmentUNT = new SegmentUNT(NachrichtSLGASammelrechnung.GetSegmentLength);
|
||||
}
|
||||
|
||||
BlockKrankenkasse = new List<BlockKrankenkasse>();
|
||||
}
|
||||
|
||||
public override List<Segment> GetAllSegments()
|
||||
{
|
||||
var list = new List<Segment>();
|
||||
|
||||
list.Add(SegmentUNH);
|
||||
list.AddRange(NachrichtSLGA.GetSegments());
|
||||
list.Add(SegmentUNT);
|
||||
if (IsSammelrechnung)
|
||||
{
|
||||
list.Add(SegmentUNH);
|
||||
list.AddRange(NachrichtSLGASammelrechnung.GetSegments());
|
||||
list.Add(SegmentUNT);
|
||||
}
|
||||
|
||||
foreach (var block in BlockKrankenkasse)
|
||||
{
|
||||
@@ -52,7 +57,10 @@ namespace Dakota.Models.Blocke
|
||||
}
|
||||
public override int GetUNHCount()
|
||||
{
|
||||
var i = 1;
|
||||
var i = 0;
|
||||
|
||||
if (SegmentUNH is object)
|
||||
i++;
|
||||
|
||||
foreach (var block in BlockKrankenkasse)
|
||||
{
|
||||
@@ -68,13 +76,16 @@ namespace Dakota.Models.Blocke
|
||||
}
|
||||
public void Apply(InfoBlockKostentrager info)
|
||||
{
|
||||
SegmentUNH.Nachrichtenreferenznummer.SetValue(info.DakotaInfoSLGA.Nachrichtenreferenznummer);
|
||||
SegmentUNH.NachrichtenTypKennung.SetValue(info.DakotaInfoSLGA.NachrichtenTypKennung);
|
||||
SegmentUNH.Nachrichtenverionsnummer.SetValue(info.DakotaInfoSLGA.NachrichtenVersionsnummer);
|
||||
SegmentUNH.NachrichtenFreigabeNrDesTypes.SetValue(info.DakotaInfoSLGA.NachrichtenFreigabeNrTages);
|
||||
SegmentUNH.NachrichtenVerwaltendeOrganisation.SetValue(info.DakotaInfoSLGA.NachrichtenVerwaltendeOrganisation);
|
||||
if (IsSammelrechnung)
|
||||
{
|
||||
SegmentUNH.Nachrichtenreferenznummer.SetValue(info.DakotaInfoSLGA.Nachrichtenreferenznummer);
|
||||
SegmentUNH.NachrichtenTypKennung.SetValue(info.DakotaInfoSLGA.NachrichtenTypKennung);
|
||||
SegmentUNH.Nachrichtenverionsnummer.SetValue(info.DakotaInfoSLGA.NachrichtenVersionsnummer);
|
||||
SegmentUNH.NachrichtenFreigabeNrDesTypes.SetValue(info.DakotaInfoSLGA.NachrichtenFreigabeNrTages);
|
||||
SegmentUNH.NachrichtenVerwaltendeOrganisation.SetValue(info.DakotaInfoSLGA.NachrichtenVerwaltendeOrganisation);
|
||||
|
||||
NachrichtSLGA.Apply(info.DakotaInfoNachrichtSLGA);
|
||||
NachrichtSLGASammelrechnung.Apply(info.DakotaInfoNachrichtSLGA);
|
||||
}
|
||||
|
||||
foreach (var infoblock in info.BlockKvKarte)
|
||||
{
|
||||
@@ -85,9 +96,12 @@ namespace Dakota.Models.Blocke
|
||||
Add(blockkvkarte);
|
||||
}
|
||||
|
||||
CalculateSLGA();
|
||||
if (IsSammelrechnung)
|
||||
{
|
||||
CalculateSLGA();
|
||||
|
||||
SegmentUNT.Nachrichtenreferenznummer.SetValue(info.DakotaInfoSLGA.Nachrichtenreferenznummer);
|
||||
SegmentUNT.Nachrichtenreferenznummer.SetValue(info.DakotaInfoSLGA.Nachrichtenreferenznummer);
|
||||
}
|
||||
}
|
||||
|
||||
private void CalculateSLGA()
|
||||
@@ -106,22 +120,25 @@ namespace Dakota.Models.Blocke
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var key in segments.Keys)
|
||||
if (IsSammelrechnung)
|
||||
{
|
||||
var array = segments[key];
|
||||
|
||||
if(key == SchlüsselSummenstatus.Gesamtsumme.Value)
|
||||
foreach (var key in segments.Keys)
|
||||
{
|
||||
NachrichtSLGA.SegmentGES00.Status.SetValue(SchlüsselSummenstatus.Gesamtsumme);
|
||||
NachrichtSLGA.SegmentGES00.Gesamtrechnungsbetrag.SetValue(array[0]);
|
||||
NachrichtSLGA.SegmentGES00.Gesamtbruttobetrag.SetValue(array[1]);
|
||||
NachrichtSLGA.SegmentGES00.GesamtbetragZuzahlung.SetValue(array[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var seg = new SegmentSLGAGES(key, array[0], array[1], array[2]);
|
||||
var array = segments[key];
|
||||
|
||||
NachrichtSLGA.ListSegmentGES.Add(seg);
|
||||
if (key == SchlüsselSummenstatus.Gesamtsumme.Value)
|
||||
{
|
||||
NachrichtSLGASammelrechnung.SegmentGES00.Status.SetValue(SchlüsselSummenstatus.Gesamtsumme);
|
||||
NachrichtSLGASammelrechnung.SegmentGES00.Gesamtrechnungsbetrag.SetValue(array[0]);
|
||||
NachrichtSLGASammelrechnung.SegmentGES00.Gesamtbruttobetrag.SetValue(array[1]);
|
||||
NachrichtSLGASammelrechnung.SegmentGES00.GesamtbetragZuzahlung.SetValue(array[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
var seg = new SegmentSLGAGES(key, array[0], array[1], array[2]);
|
||||
|
||||
NachrichtSLGASammelrechnung.ListSegmentGES.Add(seg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Dakota.Models.Blocke
|
||||
/// <summary>
|
||||
/// Nutzdatendatei ohne Logik
|
||||
/// </summary>
|
||||
internal class BlockFile : Block
|
||||
internal class Nutzdatendatei : Block
|
||||
{
|
||||
public DakotaFile Parent { get; set; }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Dakota.Models.Blocke
|
||||
public List<BlockKostenträger> BlockKostenträger { get; private set; }
|
||||
public SegmentUNZ SegmentUNZ { get; private set; }
|
||||
|
||||
internal BlockFile(DakotaFile parent)
|
||||
internal Nutzdatendatei(DakotaFile parent)
|
||||
{
|
||||
SegmentUNB = new SegmentUNB();
|
||||
BlockKostenträger = new List<BlockKostenträger>();
|
||||
@@ -17,7 +17,7 @@ namespace Dakota
|
||||
/// </summary>
|
||||
public class DakotaFile
|
||||
{
|
||||
internal BlockFile Nutzdatendatei { get; private set; }
|
||||
internal Nutzdatendatei Nutzdatendatei { get; private set; }
|
||||
internal Auftragsdatei Auftragsdatei { get; private set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
@@ -25,11 +25,11 @@ namespace Dakota
|
||||
internal string Verfahrenskennung => Auftragsdatei.AuftragssatzPart1.VerfahrenKennung.GetValue();
|
||||
internal string Transfernummer => Auftragsdatei.AuftragssatzPart1.TransferNummer.GetValue();
|
||||
|
||||
internal DakotaFile()
|
||||
internal DakotaFile(DateTime created)
|
||||
{
|
||||
Nutzdatendatei = new BlockFile(this);
|
||||
Nutzdatendatei = new Nutzdatendatei(this);
|
||||
Auftragsdatei = new Auftragsdatei(this);
|
||||
Created = DateTime.Now;
|
||||
Created = created;
|
||||
}
|
||||
|
||||
public string GetTransferName()
|
||||
|
||||
@@ -8734,9 +8734,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var test_oid = Convert.ToInt64(param);
|
||||
var test_invoicebase = DAOFactory.GenericDAO.GetByID<InvoiceBase>(test_oid);
|
||||
var test_month = test_invoicebase.InvoiceDate.Value.Month;
|
||||
var test_datetime = test_invoicebase.InvoiceDate.Value;
|
||||
|
||||
var manager = new DakotaManager(test_month);
|
||||
var manager = new DakotaManager(test_datetime.Month, DateTime.Now);
|
||||
var oids = new List<Int64>();
|
||||
|
||||
oids.Add(test_oid);
|
||||
|
||||
Reference in New Issue
Block a user