diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 2be9f4505..19ff28c1f 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -984,6 +984,7 @@
+
diff --git a/BeWo/BeWo.csproj.user b/BeWo/BeWo.csproj.user
index 060d57d23..3eff8c8d2 100644
--- a/BeWo/BeWo.csproj.user
+++ b/BeWo/BeWo.csproj.user
@@ -9,7 +9,7 @@
de-DE
false
- ShowAllFiles
+ ProjectFiles
false
diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml
index 238b75a16..18ebcba2b 100644
--- a/BeWo/BeWoApp.xaml
+++ b/BeWo/BeWoApp.xaml
@@ -88,6 +88,7 @@
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml
index 5193e2929..8aace39ea 100644
--- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml
+++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml
@@ -1,102 +1,293 @@
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
+
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
-
+
-
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
index 94441d6a5..7984bb7e3 100644
--- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
+++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs
@@ -34,7 +34,7 @@ namespace BeWo.View.Detail.Accounting
private readonly NewGkvAbrechnungPopUpView _NewGkvAbrechnungPopUpView;
private readonly GkvAbrechnungListVM _Viewmodel;
- public GkvAbrechnungOverview(GkvAbrechnungListVM vm)
+ public GkvAbrechnungOverview()
{
UpdateDataGridFilterCommand = new DelegateCommand(UpdateDataGridFilter);
@@ -42,9 +42,9 @@ namespace BeWo.View.Detail.Accounting
DownloadLinkEngine = new DownloadLinkEngine();
- _Viewmodel = vm;
+ _Viewmodel = new GkvAbrechnungListVM();
- DataContext = vm;
+ DataContext = _Viewmodel;
//datagrid_gkvAbrechnungen.FixedFilter = new BinaryOperator("Datenaustauschreferenz", 1);
@@ -66,10 +66,7 @@ namespace BeWo.View.Detail.Accounting
private void CheckRights()
{
- //if (!BeWoApp.AppSettings.AllowStorno)
- //{
- // ColumnButtons.MinWidth = 67;
- //}
+
}
private void RefreshGkvAbrechnungenList()
{
@@ -204,27 +201,6 @@ namespace BeWo.View.Detail.Accounting
}
}
- private void btn_force_send_Click(object sender, RoutedEventArgs e)
- {
-#if DEBUG
-
-#else
- return;
-#endif
-
- var vm = datagrid_gkvAbrechnungen.GetCurrentValue();
-
- if(vm.TransferProtokolle is object && vm.TransferProtokolle.Any())
- {
- vm.TransferProtokolle.Clear();
-
- var result_dc = ServiceFacade.DoAccountingServiceSync(x => x.UpdateGkvAbrechnung(vm.CommitToDataContract()));
-
- vm.TransferProtokolle = result_dc.TransferProtokolle?.ToList();
- vm.GkvAbrechnungVersion = result_dc.GkvAbrechnungVersion;
- }
- }
-
private void btn_send_Click(object sender, RoutedEventArgs e)
{
var vm = datagrid_gkvAbrechnungen.GetCurrentValue();
@@ -313,14 +289,24 @@ namespace BeWo.View.Detail.Accounting
((TextEdit)gridView.ActiveEditor).SetPropertyValue("MaxLength", tag);
}
}
- private void gridView_CellValueChanged(object sender, CellValueChangedEventArgs e)
+ private void gridView_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
- if (e.Column != null && e.Column.FieldName == "Bezahlt")
+ if (e.Column is null)
+ return;
+
+ if (e.Column.FieldName == nameof(GkvAbrechnungVM.Bezahlt))
{
if (e.Value is bool b && e.Row is GkvAbrechnungVM vm)
{
SaveBezahltChange(vm, b);
}
+ }
+ else if (e.Column.FieldName == nameof(GkvAbrechnungVM.UrbelegeGesendet))
+ {
+ if (e.Value is bool b && e.Row is GkvAbrechnungVM vm)
+ {
+ SaveUrbelegeGesendetChange(vm, b);
+ }
}
}
private void TableView_OnCustomRowAppearance(object sender, CustomRowAppearanceEventArgs e)
@@ -337,6 +323,11 @@ namespace BeWo.View.Detail.Accounting
e.Result = Brushes.Orange;
e.Handled = true;
}
+ else if (GkvAbrechnungVM.GetState(gkvAbrechnungVM) == GkvState.Waiting4Urbelege)
+ {
+ e.Result = Brushes.Green;
+ e.Handled = true;
+ }
}
}
@@ -351,10 +342,33 @@ namespace BeWo.View.Detail.Accounting
dc_in.Bezahlt = b;
- var dc = ServiceFacade.DoAccountingServiceSync(x => x.UpdateGkvAbrechnung(dc_in));
+ ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), cb =>
+ {
+ Dispatcher.Invoke(() => {
+ vm.GkvAbrechnungVersion = cb.GkvAbrechnungVersion;
+ vm.Bezahlt = cb.Bezahlt;
+ });
+ }, false);
+ }
- vm.GkvAbrechnungVersion = dc.GkvAbrechnungVersion;
- vm.Bezahlt = dc.Bezahlt;
+ private void SaveUrbelegeGesendetChange(GkvAbrechnungVM vm, bool b)
+ {
+ var dc_in = vm.CommitToDataContract();
+
+ dc_in.UrbelegeGesendet = b;
+
+ ServiceFacade.DoAccountingServiceAsync(x => x.UpdateGkvAbrechnung(dc_in), cb =>
+ {
+ Dispatcher.Invoke(() => {
+ vm.GkvAbrechnungVersion = cb.GkvAbrechnungVersion;
+ vm.UrbelegeGesendet = cb.UrbelegeGesendet;
+ });
+ }, false);
+
+ //var dc = ServiceFacade.DoAccountingServiceSync(x => x.UpdateGkvAbrechnung(dc_in));
+
+ //vm.GkvAbrechnungVersion = dc.GkvAbrechnungVersion;
+ //vm.UrbelegeGesendet = dc.UrbelegeGesendet;
}
private void SaveNoticeChange(GkvAbrechnungVM vm, string notice)
@@ -375,5 +389,5 @@ namespace BeWo.View.Detail.Accounting
}
}
}
- }
+ }
}
\ No newline at end of file
diff --git a/BeWo/View/Detail/OrganisationView.xaml b/BeWo/View/Detail/OrganisationView.xaml
index b6ea9cd47..1cd2b851a 100644
--- a/BeWo/View/Detail/OrganisationView.xaml
+++ b/BeWo/View/Detail/OrganisationView.xaml
@@ -1,59 +1,130 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
@@ -63,9 +134,15 @@
-
+
@@ -74,10 +151,18 @@
-
-
-
+
+
+
@@ -99,35 +184,89 @@
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
@@ -140,26 +279,79 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -172,26 +364,80 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -202,57 +448,184 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ Test
+ Erprobung
+ Echt
+
-
+
@@ -261,23 +634,34 @@
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -286,50 +670,74 @@
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
@@ -341,28 +749,40 @@
-
-
-
+
+
+
-
+
-
-
+
+
@@ -371,7 +791,7 @@
-
+
@@ -380,32 +800,47 @@
-
-
-
-
+
+
+
+
-
+
@@ -415,15 +850,20 @@
-
+
-
+
@@ -438,79 +878,138 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
-
-
+
-
+
-
+
-
+
-
-
+
+
@@ -523,49 +1022,131 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml
index 22fe49aa3..a867b3209 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungSchedulerView.xaml
@@ -240,10 +240,10 @@
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml
index dc56dffa9..5cc0ab893 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitBelegungTableView.xaml
@@ -136,6 +136,6 @@
-
+
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissControl.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissControl.xaml
index bd92a0cdc..ebfb54762 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissControl.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitGrundrissControl.xaml
@@ -22,11 +22,11 @@
Style="{StaticResource ObjectEditGroupBox}">
diff --git a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
index 9b6df1ae7..707fb419b 100644
--- a/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
+++ b/BeWo/View/Detail/Wohneinheit/WohneinheitVerwaltungViewV2.xaml
@@ -86,9 +86,9 @@
-
+
diff --git a/BeWo/View/Master/DokumenteView.xaml b/BeWo/View/Master/DokumenteView.xaml
index 373b48a6c..5df9795ee 100644
--- a/BeWo/View/Master/DokumenteView.xaml
+++ b/BeWo/View/Master/DokumenteView.xaml
@@ -1,17 +1,22 @@
-
+
-
-
-
-
+
+
-
-
+
+
@@ -89,34 +108,66 @@
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
@@ -242,46 +381,106 @@
-->
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
+
@@ -289,33 +488,57 @@
-
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+ -->
-
-
-
+ -->
+
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
@@ -418,9 +692,9 @@
-
+
-
+
\ No newline at end of file
diff --git a/BeWo/View/Master/FinanceView.xaml b/BeWo/View/Master/FinanceView.xaml
index 22ce49e99..da8b98378 100644
--- a/BeWo/View/Master/FinanceView.xaml
+++ b/BeWo/View/Master/FinanceView.xaml
@@ -1,4 +1,4 @@
-
+
@@ -40,7 +40,9 @@
Selector.Selected="tabitem_collectiveinvoice_Selected" />
-
+
+
+
diff --git a/BeWo/View/Master/FinanceView.xaml.cs b/BeWo/View/Master/FinanceView.xaml.cs
index 6df1c0ed4..c8cba0495 100644
--- a/BeWo/View/Master/FinanceView.xaml.cs
+++ b/BeWo/View/Master/FinanceView.xaml.cs
@@ -25,6 +25,13 @@ namespace BeWo.View.Master
InitializeComponent();
InitRights();
+
+#if DEBUG
+ if(DebugConfig.CurrentConfig is DebugConfig config && config.SelectView == UIContext.Finance)
+ {
+ root.SelectedIndex = config.SelectIndex ?? 0;
+ }
+#endif
}
public override bool IsDirty
@@ -146,14 +153,16 @@ namespace BeWo.View.Master
tabitem_gkvabrechnung_alt.Visibility = Visibility.Collapsed;
}
- foreach (TabItem tabitem in root.Items)
- {
- if (tabitem.Visibility == Visibility.Visible)
- {
- tabitem.IsSelected = true;
- break;
- }
- }
+ root.SelectedIndex = 0;
+
+ //foreach (TabItem tabitem in root.Items)
+ //{
+ // if (tabitem.Visibility == Visibility.Visible)
+ // {
+ // tabitem.IsSelected = true;
+ // break;
+ // }
+ //}
}
private void tabitem_equityinvoice_Selected(object sender, RoutedEventArgs e)
@@ -245,14 +254,6 @@ namespace BeWo.View.Master
}
}
- private void tabitem_gkvabrechnung_Selected(object sender, RoutedEventArgs e)
- {
- if (!_OpenViews.ContainsKey(tabitem_gkvabrechnung) || _SavePerformed)
- {
- AddView(tabitem_gkvabrechnung, new GkvAbrechnungOverview(new GkvAbrechnungListVM(null)));
- }
- }
-
private void tabitem_gkvabrechnung_alt_Selected(object sender, RoutedEventArgs e)
{
if (!_OpenViews.ContainsKey(tabitem_gkvabrechnung_alt) || _SavePerformed)
diff --git a/BeWo/ViewModel/GkvAbrechnungVM.cs b/BeWo/ViewModel/GkvAbrechnungVM.cs
index ed8da70cf..ff7f227e4 100644
--- a/BeWo/ViewModel/GkvAbrechnungVM.cs
+++ b/BeWo/ViewModel/GkvAbrechnungVM.cs
@@ -16,381 +16,433 @@ using DevExpress.Xpf.Core;
namespace BeWo.ViewModel
{
- public class GkvAbrechnungVM : AbstractDCMapperVM
- {
- public static string PropertyName_AbrechnungsZeitraumStart = "AbrechnungsZeitraumStart";
- public static string PropertyName_AbrechnungsZeitraumEnde = "AbrechnungsZeitraumEnde";
-
- public static string PropertyName_ErstelltAm = "ErstelltAm";
-
- private long? _GkvAbrechnungOid;
- private long? _GkvAbrechnungVersion;
- private string _Notice;
-
- private DateTime? _AbrechnungsZeitraumStart;
- private DateTime? _AbrechnungsZeitraumEnde;
-
- private DateTime _ErstelltAm;
-
- private decimal _Betrag;
- private bool _Bezahlt;
-
- internal bool _IsChecked;
-
- private List _InvoiceBases2;
- private BindingList _InvoiceBases;
- private OrganisationDC _Organisation;
-
- private List _TransferProtokolle;
-
- public GkvAbrechnungVM(GkvAbrechnungDC pDC) : base(pDC, !pDC.GkvAbrechnungOid.HasValue)
- {
- _InvoiceBases = new BindingList();
- }
-
- #region
-
- public string AbrechnungsZeitraum => $"{AbrechnungsZeitraumStart.Value.ToShortDateString()} - {AbrechnungsZeitraumEnde.Value.ToShortDateString()}";
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime? AbrechnungsZeitraumStart
- {
- get { return this._AbrechnungsZeitraumStart; }
-
- set
- {
- if (this.AreDifferent(this._AbrechnungsZeitraumStart, value))
- {
- this._AbrechnungsZeitraumStart = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AbrechnungsZeitraumStart, value), PropertyName_AbrechnungsZeitraumStart);
- this.FirePropertyChanged(PropertyName_AbrechnungsZeitraumStart);
-
- // RE893748923
- // var day = value.Value.Day;
- // AbrechnungsZeitraumEnde = value.Value.AddDays(1 - day).AddMonths(1).AddDays(-1);
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime? AbrechnungsZeitraumEnde
- {
- get { return this._AbrechnungsZeitraumEnde; }
-
- set
- {
- if (this.AreDifferent(this._AbrechnungsZeitraumEnde, value))
- {
- this._AbrechnungsZeitraumEnde = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AbrechnungsZeitraumEnde, value), PropertyName_AbrechnungsZeitraumEnde);
- this.FirePropertyChanged(PropertyName_AbrechnungsZeitraumEnde);
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime ErstelltAm
- {
- get { return this._ErstelltAm; }
-
- set
- {
- if (this.AreDifferent(this._ErstelltAm, value))
- {
- this._ErstelltAm = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.ErstelltAm, value), nameof(ErstelltAm));
- this.FirePropertyChanged(nameof(ErstelltAm));
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public long? GkvAbrechnungOid
- {
- get { return this._GkvAbrechnungOid; }
-
- set
- {
- if (this.AreDifferent(this._GkvAbrechnungOid, value))
- {
- this._GkvAbrechnungOid = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.GkvAbrechnungOid, value), nameof(GkvAbrechnungOid));
- this.FirePropertyChanged(nameof(GkvAbrechnungOid));
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public long? GkvAbrechnungVersion
- {
- get { return this._GkvAbrechnungOid; }
-
- set
- {
- if (this.AreDifferent(this._GkvAbrechnungVersion, value))
- {
- this._GkvAbrechnungVersion = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.GkvAbrechnungVersion, value), nameof(GkvAbrechnungVersion));
- this.FirePropertyChanged(nameof(GkvAbrechnungVersion));
- }
- }
- }
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public string Notice
- {
- get { return this._Notice; }
-
- set
- {
- if (this.AreDifferent(this._Notice, value))
- {
- this._Notice = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Notice, value), nameof(Notice));
- this.FirePropertyChanged(nameof(Notice));
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public decimal Betrag
- {
- get { return this._Betrag; }
-
- set
- {
- if (this.AreDifferent(this._Betrag, value))
- {
- this._Betrag = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Betrag, value), nameof(Betrag));
- this.FirePropertyChanged(nameof(Betrag));
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public bool Bezahlt
- {
- get { return _Bezahlt; }
-
- set
- {
- if (AreDifferent(this._Bezahlt, value))
- {
- _Bezahlt = value;
- StoreDirtyInformation(AreDifferent(DataContract.Bezahlt, value), nameof(Bezahlt));
- FirePropertyChanged(nameof(Bezahlt));
- FirePropertyChanged(nameof(GkvState));
- FirePropertyChanged(nameof(Fehlermeldung));
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public GkvState GkvState
- {
- get { return GetState(this); }
- }
-
- public bool IsChecked
- {
- get { return _IsChecked; }
-
- set
- {
- if (AreDifferent(_IsChecked, value))
- {
- _IsChecked = value;
- FirePropertyChanged("IsChecked");
- }
- }
- }
-
- public List InvoiceBases2
- {
- get { return _InvoiceBases2; }
- set { _InvoiceBases2 = value; }
- }
-
- public BindingList InvoiceBases
- {
- get { return _InvoiceBases; }
- set { _InvoiceBases = value; }
- }
-
- public List TransferProtokolle
- {
- get { return _TransferProtokolle; }
- set
- {
- _TransferProtokolle = value;
- FirePropertyChanged(nameof(TransferProtokolle));
- FirePropertyChanged(nameof(GkvState));
- FirePropertyChanged(nameof(Fehlermeldung));
- FirePropertyChanged(nameof(LastTransferDateTime));
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public OrganisationDC Organisation
- {
- get { return this._Organisation; }
-
- set
- {
- if (this.AreDifferent(this._Organisation, value))
- {
- this._Organisation = value;
- this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Organisation, value), nameof(Organisation));
- this.FirePropertyChanged(nameof(Organisation));
- }
- }
- }
- #endregion
-
- public string RecipientString
- {
- get
- {
- if (_InvoiceBases2 != null && _InvoiceBases2.Any())
- {
- return _InvoiceBases2.First().RecipientString;
- }
-
- return string.Empty;
- }
- }
-
- public string Fehlermeldung
- {
- get
- {
- var last = TransferProtokolle?.LastOrDefault();
-
- if (last is null || string.IsNullOrWhiteSpace(last.Fehlernachricht))
- return null;
-
- if (string.IsNullOrWhiteSpace(last.Fehlertitel))
- return last.Fehlernachricht;
-
- return $"{last.Fehlertitel}: {last.Fehlernachricht}";
- }
- }
-
- public DateTime? LastTransferDateTime
- {
- get
- {
- var last = TransferProtokolle?.LastOrDefault();
-
- if (last is null)
- return null;
-
- return last.ErstelltAm;
- }
- }
-
-
- public static GkvState GetState(GkvAbrechnungVM vm)
- {
- return GkvAbrechnungExtensions.GetState(
- vm,
- () => vm.Bezahlt,
- () => vm.TransferProtokolle,
- (x) => x.Fehlerdatum,
- (x) => x.Fehlerlevel,
- (x) => x.ErstelltAm.Value);
- }
-
- protected override void InitByDataContract(GkvAbrechnungDC pDataContract)
- {
- _AbrechnungsZeitraumStart = pDataContract.AbrechnungsZeitraumStart;
- _AbrechnungsZeitraumEnde = pDataContract.AbrechnungsZeitraumEnde;
-
- _ErstelltAm = pDataContract.ErstelltAm;
-
- _GkvAbrechnungOid = pDataContract.GkvAbrechnungOid;
- _GkvAbrechnungVersion = pDataContract.GkvAbrechnungVersion;
-
- _Notice = pDataContract.Notice;
-
- _Betrag = pDataContract.Betrag;
- _Bezahlt = pDataContract.Bezahlt;
-
- if (pDataContract.InvoiceBases != null)
- {
- _InvoiceBases2 = pDataContract.InvoiceBases.Select(x => new InvoiceBaseVM(x, true)).ToList();
- _InvoiceBases = new BindingList(_InvoiceBases2);
- }
-
- if (pDataContract.TransferProtokolle != null)
- {
- _TransferProtokolle = new List(pDataContract.TransferProtokolle);
- }
-
- _Organisation = pDataContract.Organisation;
- }
- protected override GkvAbrechnungDC MapToDataContract(GkvAbrechnungDC pDataContract, bool doCommit)
- {
- pDataContract.AbrechnungsZeitraumStart = _AbrechnungsZeitraumStart;
- pDataContract.AbrechnungsZeitraumEnde = _AbrechnungsZeitraumEnde;
-
- pDataContract.ErstelltAm = _ErstelltAm;
-
- pDataContract.GkvAbrechnungOid = _GkvAbrechnungOid;
- pDataContract.GkvAbrechnungVersion = _GkvAbrechnungVersion;
-
- pDataContract.Notice = _Notice;
- pDataContract.Betrag = _Betrag;
- pDataContract.Bezahlt = _Bezahlt;
-
- if (_InvoiceBases != null && _InvoiceBases.Any())
- pDataContract.InvoiceBases = _InvoiceBases.Where(x => x.IsChecked).Select(vm => vm.CommitToDataContract()).ToList();
- else if (_InvoiceBases2 != null && _InvoiceBases2.Any())
- pDataContract.InvoiceBases = _InvoiceBases2.Where(x => x.IsChecked).Select(vm => vm.CommitToDataContract()).ToList();
-
- pDataContract.Organisation = _Organisation;
- pDataContract.TransferProtokolle = _TransferProtokolle?.ToList();
-
- return pDataContract;
- }
-
- public void SendGkvAbrechnung()
- {
- var req = new GkvAbrechnungSendRequestDC();
-
- req.GkvAbrechnungOid = GkvAbrechnungOid.Value;
-
- ServiceFacade.DoAccountingServiceAsync(s => s.SendNewGkvAbrechnung(req),
- cb => Application.Current.Dispatch(() => Update(cb)), true);
- }
-
- public void Update(GkvAbrechnungSendResponseDC cb)
- {
- var dc = cb.GkvAbrechnungDC;
-
- if(dc is null)
- {
- MessageBox.Show(Application.Current.MainWindow, "Unerwarteter Übertragungsfehler");
- return;
- }
-
- GkvAbrechnungVersion = dc.GkvAbrechnungVersion;
- TransferProtokolle = dc.TransferProtokolle.ToList();
-
- var protokoll = cb.TransferProtokoll;
-
- if (protokoll.Fehlerlevel == GkvTransferFehlerlevel.Soft)
- {
- MessageBox.Show(Application.Current.MainWindow, protokoll.Fehlernachricht, protokoll.Fehlertitel);
- }
- else if (protokoll.Fehlerlevel == GkvTransferFehlerlevel.Fatal)
- {
- BeWoApp.ShowError(protokoll.Fehlertitel + ": " + protokoll.Fehlernachricht, null, false, false);
- }
- else
- {
- MessageBox.Show(Application.Current.MainWindow, "Ihre Sendung wurde korrekt übertragen");
- }
- }
- }
+ public class GkvAbrechnungVM : AbstractDCMapperVM
+ {
+ public static string PropertyName_AbrechnungsZeitraumStart = "AbrechnungsZeitraumStart";
+ public static string PropertyName_AbrechnungsZeitraumEnde = "AbrechnungsZeitraumEnde";
+
+ public static string PropertyName_ErstelltAm = "ErstelltAm";
+
+ private long? _GkvAbrechnungOid;
+ private long? _GkvAbrechnungVersion;
+ private string _Notice;
+
+ private DateTime? _AbrechnungsZeitraumStart;
+ private DateTime? _AbrechnungsZeitraumEnde;
+
+ private DateTime _ErstelltAm;
+
+ private decimal _Betrag;
+ private bool _Bezahlt;
+ private bool _UrbelegeGesendet;
+ private GkvVerfahrensstufe _Verfahrensstufe;
+
+ internal bool _IsChecked;
+
+ private List _InvoiceBases2;
+ private BindingList _InvoiceBases;
+ private OrganisationDC _Organisation;
+
+ private List _TransferProtokolle;
+
+ public GkvAbrechnungVM(GkvAbrechnungDC pDC) : base(pDC, !pDC.GkvAbrechnungOid.HasValue)
+ {
+ _InvoiceBases = new BindingList();
+ }
+
+ #region
+
+ public string AbrechnungsZeitraum => $"{AbrechnungsZeitraumStart.Value.ToShortDateString()} - {AbrechnungsZeitraumEnde.Value.ToShortDateString()}";
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime? AbrechnungsZeitraumStart
+ {
+ get { return this._AbrechnungsZeitraumStart; }
+
+ set
+ {
+ if (this.AreDifferent(this._AbrechnungsZeitraumStart, value))
+ {
+ this._AbrechnungsZeitraumStart = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AbrechnungsZeitraumStart, value), PropertyName_AbrechnungsZeitraumStart);
+ this.FirePropertyChanged(PropertyName_AbrechnungsZeitraumStart);
+
+ // RE893748923
+ // var day = value.Value.Day;
+ // AbrechnungsZeitraumEnde = value.Value.AddDays(1 - day).AddMonths(1).AddDays(-1);
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime? AbrechnungsZeitraumEnde
+ {
+ get { return this._AbrechnungsZeitraumEnde; }
+
+ set
+ {
+ if (this.AreDifferent(this._AbrechnungsZeitraumEnde, value))
+ {
+ this._AbrechnungsZeitraumEnde = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.AbrechnungsZeitraumEnde, value), PropertyName_AbrechnungsZeitraumEnde);
+ this.FirePropertyChanged(PropertyName_AbrechnungsZeitraumEnde);
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime ErstelltAm
+ {
+ get { return this._ErstelltAm; }
+
+ set
+ {
+ if (this.AreDifferent(this._ErstelltAm, value))
+ {
+ this._ErstelltAm = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.ErstelltAm, value), nameof(ErstelltAm));
+ this.FirePropertyChanged(nameof(ErstelltAm));
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public long? GkvAbrechnungOid
+ {
+ get { return this._GkvAbrechnungOid; }
+
+ set
+ {
+ if (this.AreDifferent(this._GkvAbrechnungOid, value))
+ {
+ this._GkvAbrechnungOid = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.GkvAbrechnungOid, value), nameof(GkvAbrechnungOid));
+ this.FirePropertyChanged(nameof(GkvAbrechnungOid));
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public long? GkvAbrechnungVersion
+ {
+ get { return this._GkvAbrechnungOid; }
+
+ set
+ {
+ if (this.AreDifferent(this._GkvAbrechnungVersion, value))
+ {
+ this._GkvAbrechnungVersion = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.GkvAbrechnungVersion, value), nameof(GkvAbrechnungVersion));
+ this.FirePropertyChanged(nameof(GkvAbrechnungVersion));
+ }
+ }
+ }
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public string Notice
+ {
+ get { return this._Notice; }
+
+ set
+ {
+ if (this.AreDifferent(this._Notice, value))
+ {
+ this._Notice = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Notice, value), nameof(Notice));
+ this.FirePropertyChanged(nameof(Notice));
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public decimal Betrag
+ {
+ get { return this._Betrag; }
+
+ set
+ {
+ if (this.AreDifferent(this._Betrag, value))
+ {
+ this._Betrag = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Betrag, value), nameof(Betrag));
+ this.FirePropertyChanged(nameof(Betrag));
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public bool Bezahlt
+ {
+ get { return _Bezahlt; }
+
+ set
+ {
+ if (AreDifferent(this._Bezahlt, value))
+ {
+ _Bezahlt = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Bezahlt, value), nameof(Bezahlt));
+ FirePropertyChanged(nameof(Bezahlt));
+ FirePropertyChanged(nameof(GkvState));
+ FirePropertyChanged(nameof(Fehlermeldung));
+ }
+ }
+ }
+
+ public bool UrbelegeGesendet
+ {
+ get { return _UrbelegeGesendet; }
+
+ set
+ {
+ if (!AreDifferent(_UrbelegeGesendet, value))
+ return;
+ _UrbelegeGesendet = value;
+ StoreDirtyInformation(AreDifferent(DataContract.UrbelegeGesendet, value), nameof(UrbelegeGesendet));
+ FirePropertyChanged(nameof(UrbelegeGesendet));
+ FirePropertyChanged(nameof(GkvState));
+ }
+ }
+
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public GkvState GkvState
+ {
+ get { return GetState(this); }
+ }
+
+ public bool IsChecked
+ {
+ get { return _IsChecked; }
+
+ set
+ {
+ if (AreDifferent(_IsChecked, value))
+ {
+ _IsChecked = value;
+ FirePropertyChanged("IsChecked");
+ }
+ }
+ }
+
+ public List InvoiceBases2
+ {
+ get { return _InvoiceBases2; }
+ set { _InvoiceBases2 = value; }
+ }
+
+ public BindingList InvoiceBases
+ {
+ get { return _InvoiceBases; }
+ set { _InvoiceBases = value; }
+ }
+
+ public List TransferProtokolle
+ {
+ get { return _TransferProtokolle; }
+ set
+ {
+ _TransferProtokolle = value;
+ FirePropertyChanged(nameof(TransferProtokolle));
+ FirePropertyChanged(nameof(GkvState));
+ FirePropertyChanged(nameof(Fehlermeldung));
+ FirePropertyChanged(nameof(LastTransferDateTime));
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public OrganisationDC Organisation
+ {
+ get { return this._Organisation; }
+
+ set
+ {
+ if (this.AreDifferent(this._Organisation, value))
+ {
+ this._Organisation = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Organisation, value), nameof(Organisation));
+ this.FirePropertyChanged(nameof(Organisation));
+ }
+ }
+ }
+
+ public GkvVerfahrensstufe Verfahrensstufe
+ {
+ get { return this._Verfahrensstufe; }
+
+ set
+ {
+ if (this.AreDifferent(this._Verfahrensstufe, value))
+ {
+ this._Verfahrensstufe = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Verfahrensstufe, value), nameof(Verfahrensstufe));
+ this.FirePropertyChanged(nameof(Verfahrensstufe));
+ }
+ }
+ }
+
+ public int VerfahrensstufeInt
+ {
+ get { return (int)Verfahrensstufe; }
+
+ set
+ {
+ if (!AreDifferent(this.VerfahrensstufeInt, value))
+ return;
+
+ Verfahrensstufe = (GkvVerfahrensstufe)value;
+ //FirePropertyChanged(nameof(VerfahrensstufeInt));
+ }
+ }
+ #endregion
+
+ public string RecipientString
+ {
+ get
+ {
+ if (_InvoiceBases2 != null && _InvoiceBases2.Any())
+ {
+ return _InvoiceBases2.First().RecipientString;
+ }
+
+ return string.Empty;
+ }
+ }
+
+ public string Fehlermeldung
+ {
+ get
+ {
+ var last = TransferProtokolle?.LastOrDefault();
+
+ if (last is null || string.IsNullOrWhiteSpace(last.Fehlernachricht))
+ return null;
+
+ if (string.IsNullOrWhiteSpace(last.Fehlertitel))
+ return last.Fehlernachricht;
+
+ return $"{last.Fehlertitel}: {last.Fehlernachricht}";
+ }
+ }
+
+ public DateTime? LastTransferDateTime
+ {
+ get
+ {
+ var last = TransferProtokolle?.LastOrDefault();
+
+ if (last is null)
+ return null;
+
+ return last.ErstelltAm;
+ }
+ }
+
+
+ public static GkvState GetState(GkvAbrechnungVM vm)
+ {
+ return GkvAbrechnungExtensions.GetState(
+ vm,
+ () => vm.Bezahlt,
+ () => vm.UrbelegeGesendet,
+ () => vm.TransferProtokolle,
+ (x) => x.Fehlerdatum,
+ (x) => x.Fehlerlevel,
+ (x) => x.ErstelltAm.Value);
+ }
+
+ protected override void InitByDataContract(GkvAbrechnungDC pDataContract)
+ {
+ _AbrechnungsZeitraumStart = pDataContract.AbrechnungsZeitraumStart;
+ _AbrechnungsZeitraumEnde = pDataContract.AbrechnungsZeitraumEnde;
+
+ _ErstelltAm = pDataContract.ErstelltAm;
+
+ _GkvAbrechnungOid = pDataContract.GkvAbrechnungOid;
+ _GkvAbrechnungVersion = pDataContract.GkvAbrechnungVersion;
+
+ _Notice = pDataContract.Notice;
+
+ _Betrag = pDataContract.Betrag;
+ _Bezahlt = pDataContract.Bezahlt;
+ _UrbelegeGesendet = pDataContract.UrbelegeGesendet;
+ _Verfahrensstufe = pDataContract.Verfahrensstufe;
+
+ if (pDataContract.InvoiceBases != null)
+ {
+ _InvoiceBases2 = pDataContract.InvoiceBases.Select(x => new InvoiceBaseVM(x, true)).ToList();
+ _InvoiceBases = new BindingList(_InvoiceBases2);
+ }
+
+ if (pDataContract.TransferProtokolle != null)
+ {
+ _TransferProtokolle = new List(pDataContract.TransferProtokolle);
+ }
+
+ _Organisation = pDataContract.Organisation;
+ }
+ protected override GkvAbrechnungDC MapToDataContract(GkvAbrechnungDC pDataContract, bool doCommit)
+ {
+ pDataContract.AbrechnungsZeitraumStart = _AbrechnungsZeitraumStart;
+ pDataContract.AbrechnungsZeitraumEnde = _AbrechnungsZeitraumEnde;
+
+ pDataContract.ErstelltAm = _ErstelltAm;
+
+ pDataContract.GkvAbrechnungOid = _GkvAbrechnungOid;
+ pDataContract.GkvAbrechnungVersion = _GkvAbrechnungVersion;
+
+ pDataContract.Notice = _Notice;
+ pDataContract.Betrag = _Betrag;
+ pDataContract.Bezahlt = _Bezahlt;
+ pDataContract.UrbelegeGesendet = _UrbelegeGesendet;
+ pDataContract.Verfahrensstufe = _Verfahrensstufe;
+
+ if (_InvoiceBases != null && _InvoiceBases.Any())
+ pDataContract.InvoiceBases = _InvoiceBases.Where(x => x.IsChecked).Select(vm => vm.CommitToDataContract()).ToList();
+ else if (_InvoiceBases2 != null && _InvoiceBases2.Any())
+ pDataContract.InvoiceBases = _InvoiceBases2.Where(x => x.IsChecked).Select(vm => vm.CommitToDataContract()).ToList();
+
+ pDataContract.Organisation = _Organisation;
+ pDataContract.TransferProtokolle = _TransferProtokolle?.ToList();
+
+ return pDataContract;
+ }
+
+ public void SendGkvAbrechnung()
+ {
+ var req = new GkvAbrechnungSendRequestDC();
+
+ req.GkvAbrechnungOid = GkvAbrechnungOid.Value;
+
+ ServiceFacade.DoAccountingServiceAsync(s => s.SendNewGkvAbrechnung(req),
+ cb => Application.Current.Dispatch(() => Update(cb)), true);
+ }
+
+ public void Update(GkvAbrechnungSendResponseDC cb)
+ {
+ var dc = cb.GkvAbrechnungDC;
+
+ if (dc is null)
+ {
+ MessageBox.Show(Application.Current.MainWindow, "Unerwarteter Übertragungsfehler");
+ return;
+ }
+
+ GkvAbrechnungVersion = dc.GkvAbrechnungVersion;
+ TransferProtokolle = dc.TransferProtokolle.ToList();
+
+ var protokoll = cb.TransferProtokoll;
+
+ if (protokoll.Fehlerlevel == GkvTransferFehlerlevel.Soft)
+ {
+ MessageBox.Show(Application.Current.MainWindow, protokoll.Fehlernachricht, protokoll.Fehlertitel);
+ }
+ else if (protokoll.Fehlerlevel == GkvTransferFehlerlevel.Fatal)
+ {
+ BeWoApp.ShowError(protokoll.Fehlertitel + ": " + protokoll.Fehlernachricht, null, false, false);
+ }
+ else
+ {
+ MessageBox.Show(Application.Current.MainWindow, "Ihre Sendung wurde korrekt übertragen");
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/ListViewModel/GkvAbrechnungListVM.cs b/BeWo/ViewModel/ListViewModel/GkvAbrechnungListVM.cs
index 813acfb7d..684aa512b 100644
--- a/BeWo/ViewModel/ListViewModel/GkvAbrechnungListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/GkvAbrechnungListVM.cs
@@ -19,6 +19,10 @@ namespace BeWo.ViewModel.ListViewModel
this.VMList.ListChanged += (s, e) => this.FirePropertyChanged(PropertyName_FilterResultAmountSum);
this.VMList.ListChanged += (s, e) => this.FirePropertyChanged(PropertyName_FilterResultAmountNotPaidSum);
}
+ public GkvAbrechnungListVM() : this(null)
+ {
+
+ }
public DateTimeSpan DateTimeSpanFilter
{
diff --git a/BeWo/ViewModel/OrganisationVM.cs b/BeWo/ViewModel/OrganisationVM.cs
index 04b93b74e..bec288711 100644
--- a/BeWo/ViewModel/OrganisationVM.cs
+++ b/BeWo/ViewModel/OrganisationVM.cs
@@ -84,13 +84,9 @@ namespace BeWo.ViewModel
public static string PropertyName_Feiertage = "Feiertage";
public static string PropertyName_IKKrankenkasse = nameof(IKKrankenkasse);
-
public static string PropertyName_IKKostentrager = nameof(IKKostentrager);
-
public static string PropertyName_IKDatenannahmestelle = nameof(IKDatenannahmestelle);
-
public static string PropertyName_Leistungserbringergruppe = nameof(Leistungserbringergruppe);
-
public static string PropertyName_BusinessPartnerId = nameof(BusinessPartnerId);
private readonly List _AllQualifications;
@@ -166,14 +162,11 @@ namespace BeWo.ViewModel
private FeiertagListVM _Feiertage;
private string _IKKrankenkasse;
-
private string _IKKostentrager;
-
private string _IKDatenannahmestelle;
-
private string _Leistungserbringergruppe;
-
private string _BusinessPartnerId;
+ private GkvVerfahrensstufe _Verfahrensstufe;
public OrganisationVM(OrganisationDC pDataContract, List pAllQualifications, List pPossibleFunctions, List pPossibleRoleInOrganisations)
: base(pDataContract, pDataContract.OrganisationOid == null)
@@ -850,6 +843,35 @@ namespace BeWo.ViewModel
}
}
+ public GkvVerfahrensstufe Verfahrensstufe
+ {
+ get { return this._Verfahrensstufe; }
+
+ set
+ {
+ if (this.AreDifferent(this._Verfahrensstufe, value))
+ {
+ this._Verfahrensstufe = value;
+ this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Verfahrensstufe, value), nameof(Verfahrensstufe));
+ this.FirePropertyChanged(nameof(Verfahrensstufe));
+ }
+ }
+ }
+
+ public int VerfahrensstufeInt
+ {
+ get { return (int)Verfahrensstufe; }
+
+ set
+ {
+ if (!AreDifferent(this.VerfahrensstufeInt, value))
+ return;
+
+ Verfahrensstufe = (GkvVerfahrensstufe)value;
+ //FirePropertyChanged(nameof(VerfahrensstufeInt));
+ }
+ }
+
protected void CommitContact(string pValue, ContactType pContactType)
{
List lOldContactDCs;
@@ -916,6 +938,7 @@ namespace BeWo.ViewModel
this._IKDatenannahmestelle = pDataContract.IKDatenannahmestelle;
_Leistungserbringergruppe = pDataContract.Leistungserbringergruppe;
_BusinessPartnerId = pDataContract.BusinessPartnerId;
+ _Verfahrensstufe = pDataContract.Verfahrensstufe;
_Function = pDataContract.Function;
@@ -1024,6 +1047,7 @@ namespace BeWo.ViewModel
pDataContract.IKKrankenkasse = this._IKKrankenkasse;
pDataContract.Leistungserbringergruppe = _Leistungserbringergruppe;
pDataContract.BusinessPartnerId = _BusinessPartnerId;
+ pDataContract.Verfahrensstufe = _Verfahrensstufe;
this.CommitContact(this._Phone, ContactType.business_Phone);
this.CommitContact(this._Website, ContactType.business_Homepage);
diff --git a/Dakota/DakotaValidator.cs b/Dakota/DakotaValidator.cs
index 622ba6b0b..abae6914b 100644
--- a/Dakota/DakotaValidator.cs
+++ b/Dakota/DakotaValidator.cs
@@ -12,12 +12,14 @@ namespace Dakota
{
public static class DakotaValidator
{
- public static void ClearTextString(string input)
+ public static string ClearTextString(string input)
{
foreach (var specialChar in DakotaConfig.SpecialCollection)
{
input = input.Replace(specialChar, DakotaConfig.Aufhebungszeichen + specialChar);
}
+
+ return input.Trim();
}
///
diff --git a/Dakota/Logic/DakotaInfoCreator.cs b/Dakota/Logic/DakotaInfoCreator.cs
index 2c8eb8c2e..433d0f333 100644
--- a/Dakota/Logic/DakotaInfoCreator.cs
+++ b/Dakota/Logic/DakotaInfoCreator.cs
@@ -1,4 +1,5 @@
using BeWo.Data.Entities;
+using BS.Shared;
using BS.Shared.DataContracts;
using Dakota.Models.Infos;
using Dakota.Models.Schlüssels;
@@ -46,7 +47,7 @@ namespace Dakota.Logic
// return info;
//}
- internal InfoDateiNutzdaten GetEmptyInfoNutzdatendatei(string absender, string empfang, string logischerDateiname, int datenaustauschreferenz)
+ internal InfoDateiNutzdaten GetEmptyInfoNutzdatendatei(string absender, string empfang, int verfahrensstufe, string logischerDateiname, int datenaustauschreferenz)
{
var info = new InfoDateiNutzdaten();
@@ -57,7 +58,7 @@ namespace Dakota.Logic
info.Datenaustauschreferenz = datenaustauschreferenz;
info.Leistungsbereich = SchlüsselLeistungserbringerSammelgruppenschlussel.SoziotherapeutischerLeistungserbringer;
info.Anwendungsreferenz = logischerDateiname;
- info.Testindikator = SchlüsselTestindikator.Testdatei;
+ info.Testindikator = SchlüsselTestindikator.GetSchlüsselTestindikator((GkvVerfahrensstufe)verfahrensstufe);
return info;
}
diff --git a/Dakota/Logic/DakotaManager.cs b/Dakota/Logic/DakotaManager.cs
index 11f22b913..02c0d729d 100644
--- a/Dakota/Logic/DakotaManager.cs
+++ b/Dakota/Logic/DakotaManager.cs
@@ -49,15 +49,18 @@ namespace Dakota.Logic
if (!success)
{
+ var verfahrensstufe = organisation.Verfahrensstufe;
+
// Verfahrenkennung
// Erste Stelle:
// "E" - Echtdaten
// "T" - Testdaten
-
- var verfahrenkennung = "TSOL0";
+ // Annahme: "E" auch für Erprobungsverfahrenstufe
+
+ var verfahrenkennung = verfahrensstufe == 0 ? "TSOL0" : "ESOL0";
var logischer_dateiname = DakotaConfig.GetLogischerDateiname(Month).Trim();
- var info_nutz_add = DakotaInfoCreator.GetEmptyInfoNutzdatendatei(DakotaConfig.IKAbsender, organisation.IKDatenannahmestelle, logischer_dateiname, datenaustauschreferenz);
+ var info_nutz_add = DakotaInfoCreator.GetEmptyInfoNutzdatendatei(DakotaConfig.IKAbsender, organisation.IKDatenannahmestelle, (int)verfahrensstufe, logischer_dateiname, datenaustauschreferenz);
var info_auf_add = DakotaInfoCreator.GetEmptyInfoAuftragsdatei(organisation.IKDatenannahmestelle, logischer_dateiname, verfahrenkennung, transfernummer);
DakotaInfoNutzDict.Add(ik_datenannahmestelle, info_nutz_add);
diff --git a/Dakota/Models/Daten/Datenelement.cs b/Dakota/Models/Daten/Datenelement.cs
index 7cc3e3dac..70c1818ab 100644
--- a/Dakota/Models/Daten/Datenelement.cs
+++ b/Dakota/Models/Daten/Datenelement.cs
@@ -97,9 +97,9 @@ namespace Dakota.Models.Daten
throw new DakotaException($"Das Feld \"{Title}\" hat bei der Erstellung {_Value.Length} Stellen ergeben! Nach Vorgabe darf es jedoch maximal {MaxStellen} Stellen haben");
}
- DakotaValidator.ClearTextString(value);
+ var mod_value = DakotaValidator.ClearTextString(value);
- _Value = value;
+ _Value = mod_value;
}
}
}
diff --git a/Dakota/Models/Schlüssels/SchlüsselTestindikator.cs b/Dakota/Models/Schlüssels/SchlüsselTestindikator.cs
index 1d841e8fa..1b77878f3 100644
--- a/Dakota/Models/Schlüssels/SchlüsselTestindikator.cs
+++ b/Dakota/Models/Schlüssels/SchlüsselTestindikator.cs
@@ -1,4 +1,5 @@
-using System;
+using BS.Shared;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -6,12 +7,24 @@ using System.Threading.Tasks;
namespace Dakota.Models.Schlüssels
{
- public class SchlüsselTestindikator : Schlüssel
- {
- public SchlüsselTestindikator(string val) : base(val) { }
+ public class SchlüsselTestindikator : Schlüssel
+ {
+ public SchlüsselTestindikator(string val) : base(val) { }
- public static SchlüsselTestindikator Testdatei => new SchlüsselTestindikator("0");
- public static SchlüsselTestindikator Erprobungsdatei => new SchlüsselTestindikator("1");
- public static SchlüsselTestindikator Echtdatei => new SchlüsselTestindikator("2");
- }
+ public static SchlüsselTestindikator Testdatei => new SchlüsselTestindikator("0");
+ public static SchlüsselTestindikator Erprobungsdatei => new SchlüsselTestindikator("1");
+ public static SchlüsselTestindikator Echtdatei => new SchlüsselTestindikator("2");
+
+ public static SchlüsselTestindikator GetSchlüsselTestindikator(GkvVerfahrensstufe verfahrensstufe)
+ {
+ switch (verfahrensstufe)
+ {
+ case GkvVerfahrensstufe.Test: return Testdatei;
+ case GkvVerfahrensstufe.Erprobung: return Erprobungsdatei;
+ case GkvVerfahrensstufe.Echt: return Echtdatei;
+ }
+
+ throw new ArgumentOutOfRangeException(nameof(verfahrensstufe));
+ }
+ }
}
diff --git a/DakotaSender/Program.cs b/DakotaSender/Program.cs
index f362a86ca..3562388a4 100644
--- a/DakotaSender/Program.cs
+++ b/DakotaSender/Program.cs
@@ -59,7 +59,8 @@ namespace DakotaSender
PrintLine("-------------------");
}
- static void PrintLine(string line = null)
+ static void PrintLine() => PrintLine(null);
+ static void PrintLine(string line)
{
PrintWithTime(line + "\n", !time_in_line);
@@ -78,6 +79,13 @@ namespace DakotaSender
else
Console.Write(line);
}
+ static void PrintFileInfo(DakotaSystemFile file)
+ {
+ PrintLine($"Verarbeite Datei: {file.SourceNutzdatendatei.Name}");
+ PrintLine($"- Tenant: {file.Tenant}");
+ PrintLine($"- Protokoll Oid: {file.ProtokollOid}");
+ PrintLine($"- Datenannahmestelle: {file.Datenannahmestelle}");
+ }
static void CheckDakotaStatus()
{
@@ -176,64 +184,65 @@ namespace DakotaSender
return toCheck.Any() ? toCheck : null;
}
+
static void TryProcessFile(DakotaSystemFile file)
{
+ string error;
bool copied = false;
try
{
- var protokoll_oid = file.ProtokollOid;
-
- PrintLine($"Verarbeite Datei: {file.SourceNutzdatendatei.Name}");
- PrintLine($"- Tenant: {file.Tenant}");
- PrintLine($"- Protokoll Oid: {protokoll_oid}");
- PrintLine($"- Datenannahmestelle: {file.Datenannahmestelle}");
-
- copied = true;
- CopyFileToDestination(file);
-
- Print("Sende via Dakota. ");
-
- var code = ExecuteDakota("-x");
-
- if (AcceptSendCodes.Contains(code))
- {
- PrintLine($"Ok.");
-
- DeleteQueueFile(file);
- }
- else
- {
- if(code == RC_DAKOTA_ALREADY_LOADED)
- {
- PrintLine($"Verarbeitung fehlgeschlagen. Dakota läuft bereits.");
-
- PrintLine("Ignoriere Verarbeitung aktuell. Versuche im nächsten Programm Aufruf erneut.");
-
- DeleteDakotaFile(file);
- }
- else
- {
- var error = $"Verarbeitung fehlgeschlagen. Statuscode {code} wird nicht akzeptiert.";
-
- PrintLine(error);
-
- MoveQueueToFailed(file);
-
- DeleteDakotaFile(file);
-
- CreateResultXmlFile(file, error);
- }
- }
+ error = ProcessFile(file, out copied);
}
catch (Exception e)
{
- PrintLine($"Verarbeitung fehlgeschlagen. Exception: {e}");
+ error = e.ToString();
+ }
+
+ if (error is string)
+ {
+ PrintLine(error);
+ MoveQueueToFailed(file);
if (copied)
DeleteDakotaFile(file);
+
+ CreateResultXmlFile(file, error);
}
}
+ static string ProcessFile(DakotaSystemFile file, out bool copied)
+ {
+ copied = false;
+ PrintFileInfo(file);
+
+ if (!IsDakotaFolderDatenannahmestelleValid(file.Datenannahmestelle))
+ return "Datenannahmestelle unbekannt.";
+
+ CopyFileToDestination(file);
+ copied = true;
+
+ Print("Sende via Dakota. ");
+
+ var code = ExecuteDakota("-x");
+
+ if (code == RC_DAKOTA_ALREADY_LOADED)
+ {
+ PrintLine($"Verarbeitung fehlgeschlagen. Dakota läuft bereits.");
+
+ PrintLine("Ignoriere Verarbeitung aktuell. Versuche im nächsten Programm Aufruf erneut.");
+
+ DeleteDakotaFile(file);
+
+ return null;
+ }
+
+ if (!AcceptSendCodes.Contains(code))
+ return $"Verarbeitung fehlgeschlagen. Statuscode {code} wird nicht akzeptiert.";
+
+ PrintLine($"Ok.");
+ DeleteQueueFile(file);
+ return null;
+ }
static void CreateResultXmlFile(DakotaSystemFile file, string error)
{
Print("Speichere Fehler als Xml. ");
@@ -338,6 +347,19 @@ namespace DakotaSender
}
}
+ static bool IsDakotaFolderDatenannahmestelleValid(string datenannahmestelle)
+ {
+ try
+ {
+ _ = GetDakotaFolderDatenannahmestelle(datenannahmestelle);
+
+ return true;
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ }
static DirectoryInfo GetDakotaFolderDatenannahmestelle(string datenannahmestelle)
{
var folder = new DirectoryInfo(Path.Combine(GetDakotaFolder().FullName, "TP5Daten", datenannahmestelle));
@@ -359,7 +381,7 @@ namespace DakotaSender
return dirinfo;
}
-
+
static string GetLogPath()
=> ConfigurationManager.AppSettings.Get("LogPath") ?? @"C:\GkvAbrechnung\Sender\log.txt";
static int GetProcessWaitForExitMs()
diff --git a/Data/Entities/GkvAbrechnung.cs b/Data/Entities/GkvAbrechnung.cs
index bcfff7ee6..99fcb7b86 100644
--- a/Data/Entities/GkvAbrechnung.cs
+++ b/Data/Entities/GkvAbrechnung.cs
@@ -19,6 +19,8 @@ namespace BeWo.Data.Entities
public virtual DateTime? AbrechnungsZeitraumEnde { get; set; }
public virtual decimal Betrag { get; set; }
public virtual bool Bezahlt { get; set; }
+ public virtual bool UrbelegeGesendet { get; set; }
+ public virtual GkvVerfahrensstufe Verfahrensstufe { get; set; }
public virtual IList InvoiceBases { get; set; }
public virtual IList GkvTransferProtokolle { get; set; }
@@ -27,6 +29,7 @@ namespace BeWo.Data.Entities
GkvAbrechnungExtensions.GetState(
entity,
() => entity.Bezahlt,
+ () => entity.UrbelegeGesendet,
() => entity.GkvTransferProtokolle,
(x) => x.Fehlerdatum,
(x) => x.Fehlerlevel,
diff --git a/Data/Entities/Organisation.cs b/Data/Entities/Organisation.cs
index 3e8d40d3c..5b96277a0 100644
--- a/Data/Entities/Organisation.cs
+++ b/Data/Entities/Organisation.cs
@@ -351,5 +351,7 @@ namespace BeWo.Data.Entities
}
}
}
+
+ public virtual GkvVerfahrensstufe Verfahrensstufe { get; set; }
}
}
\ No newline at end of file
diff --git a/Data/Mappings/GkvAbrechnung.hbm.xml b/Data/Mappings/GkvAbrechnung.hbm.xml
index 53add4154..3c0f904f0 100644
--- a/Data/Mappings/GkvAbrechnung.hbm.xml
+++ b/Data/Mappings/GkvAbrechnung.hbm.xml
@@ -20,8 +20,10 @@
+
+
diff --git a/Data/Mappings/Organisation.hbm.xml b/Data/Mappings/Organisation.hbm.xml
index b5457f4e0..02c6ff495 100644
--- a/Data/Mappings/Organisation.hbm.xml
+++ b/Data/Mappings/Organisation.hbm.xml
@@ -20,6 +20,7 @@
+
diff --git a/Model/Changes_2024_09_30 GkvAbrechnung UrbelegeGesendet.txt b/Model/Changes_2024_09_30 GkvAbrechnung UrbelegeGesendet.txt
new file mode 100644
index 000000000..f608bac9c
--- /dev/null
+++ b/Model/Changes_2024_09_30 GkvAbrechnung UrbelegeGesendet.txt
@@ -0,0 +1,2 @@
+ALTER TABLE `gkvabrechnung`
+ADD COLUMN `UrbelegeGesendet` TINYINT NULL DEFAULT NULL AFTER `Bezahlt`;
diff --git a/Model/Changes_2024_10_09 GkvAbrechnung Verfahrensstufe.txt b/Model/Changes_2024_10_09 GkvAbrechnung Verfahrensstufe.txt
new file mode 100644
index 000000000..d3b839674
--- /dev/null
+++ b/Model/Changes_2024_10_09 GkvAbrechnung Verfahrensstufe.txt
@@ -0,0 +1,5 @@
+ALTER TABLE `organisation`
+ADD COLUMN `Verfahrensstufe` INT NULL DEFAULT 0 AFTER `BusinessPartnerId`;
+
+ALTER TABLE `gkvabrechnung`
+ADD COLUMN `Verfahrensstufe` INT NULL DEFAULT 0 AFTER `ErstelltAm`;
diff --git a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
index ded8c603f..67e4c47a4 100644
--- a/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
+++ b/Service/DCEntityMapper/GkvAbrechnungDC_GkvAbrechnung.cs
@@ -28,7 +28,9 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.Betrag = pEntity.Betrag;
pDataContract.Bezahlt = pEntity.Bezahlt;
+ pDataContract.UrbelegeGesendet = pEntity.UrbelegeGesendet;
pDataContract.ErstelltAm = pEntity.ErstelltAm;
+ pDataContract.Verfahrensstufe = pEntity.Verfahrensstufe;
pDataContract.InvoiceBases = MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDCs(pEntity.InvoiceBases);
@@ -52,6 +54,8 @@ namespace BeWo.Service.DCEntityMapper
pEntity.Betrag = pDataContract.Betrag;
pEntity.Bezahlt = pDataContract.Bezahlt;
+ pEntity.UrbelegeGesendet = pDataContract.UrbelegeGesendet;
+ pEntity.Verfahrensstufe = pDataContract.Verfahrensstufe;
pEntity.ErstelltAm = pDataContract.ErstelltAm;
diff --git a/Service/DCEntityMapper/OrganisationDC_Organisation.cs b/Service/DCEntityMapper/OrganisationDC_Organisation.cs
index 69eb81bc5..aec5a9a9d 100644
--- a/Service/DCEntityMapper/OrganisationDC_Organisation.cs
+++ b/Service/DCEntityMapper/OrganisationDC_Organisation.cs
@@ -32,6 +32,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.IKKostentrager = pEntity.IKKostentrager;
pDataContract.IKDatenannahmestelle = pEntity.IKDatenannahmestelle;
pDataContract.Leistungserbringergruppe = pEntity.Leistungserbringergruppe;
+ pDataContract.Verfahrensstufe = pEntity.Verfahrensstufe;
pDataContract.BusinessPartnerId = pEntity.BusinessPartnerId;
@@ -109,6 +110,7 @@ namespace BeWo.Service.DCEntityMapper
pEntity.IKKostentrager = pDataContract.IKKostentrager;
pEntity.IKDatenannahmestelle = pDataContract.IKDatenannahmestelle;
pEntity.Leistungserbringergruppe = pDataContract.Leistungserbringergruppe;
+ pEntity.Verfahrensstufe = pDataContract.Verfahrensstufe;
pEntity.BusinessPartnerId = pDataContract.BusinessPartnerId;
diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs
index 26c5d0749..bf3a1c9a6 100644
--- a/Service/ServiceImplementations/AccountingServiceImp.cs
+++ b/Service/ServiceImplementations/AccountingServiceImp.cs
@@ -783,13 +783,15 @@ namespace BeWo.Service.ServiceImplementations
gkv_abrechnung.AbrechnungsZeitraumEnde = gkv_abrechnung.AbrechnungsZeitraumEnde.Value.Date.AddDays(1).AddMilliseconds(-1);
}
+ var orga = gkv_abrechnung.GetOrganisation();
+
+ gkv_abrechnung.Verfahrensstufe = orga.Verfahrensstufe;
+
decimal gesamt = 0;
foreach (var invoicebase_oid in request.SelectedInvoiceBases)
{
var service = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoicebase_oid);
var invoicebase = DAOFactory.GenericDAO.GetByID(invoicebase_oid);
- var orga = invoicebase.CostBearer2SupportConcept.CostBearer.Organisation;
- var customer = invoicebase.CostBearer2SupportConcept.SupportConcept.Customer;
var invoicebase_dc = MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDC(invoicebase);
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index 4326d07e0..b97a10fce 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -1274,9 +1274,17 @@ namespace BS.Shared
{
NoSend,
Waiting,
+ Waiting4Urbelege,
Error,
ErrorFatal,
Paid,
OldAndNoFeedback
}
+
+ public enum GkvVerfahrensstufe
+ {
+ Test,
+ Erprobung,
+ Echt
+ }
}
\ No newline at end of file
diff --git a/Shared/Core/EnumTranslations.cs b/Shared/Core/EnumTranslations.cs
index 9b7886db0..7d3133b67 100644
--- a/Shared/Core/EnumTranslations.cs
+++ b/Shared/Core/EnumTranslations.cs
@@ -31,6 +31,7 @@ namespace BS.Shared.Core
public static Dictionary UserRightType2Translations;
public static Dictionary Wohnhilfe2Translation;
+ public static Dictionary Gkv2Translation;
public static Dictionary ValueListEntryType2Header;
@@ -64,6 +65,8 @@ namespace BS.Shared.Core
InitWohnhilfeEnums();
+ InitGkvTranslation();
+
#region FamilyStatusTranslations
FamilyStatusTranslations = new Dictionary