From 7c24deb9b3108c060690805a058aab97d3a62bf3 Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Wed, 15 May 2024 10:49:31 +0200 Subject: [PATCH] Detail Fenster Bemerkung und Bezahlung editierbar --- BeWo/View/BeWoWindow.xaml | 2 +- BeWo/View/BeWoWindow.xaml.cs | 10 +++++++ .../Controls/GkvAbrechnungDetailControl.xaml | 4 +-- .../Accounting/GkvAbrechnungOverview.xaml.cs | 27 ++++++++++++++++++- Dakota/DakotaConfig.cs | 2 +- Dakota/Logic/DakotaInfoCreator.cs | 2 +- Dakota/Logic/DakotaManager.cs | 2 +- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/BeWo/View/BeWoWindow.xaml b/BeWo/View/BeWoWindow.xaml index 9bba6fd42..981fccac6 100644 --- a/BeWo/View/BeWoWindow.xaml +++ b/BeWo/View/BeWoWindow.xaml @@ -6,7 +6,7 @@ WindowStartupLocation="CenterOwner" AllowsTransparency="True" Background="Transparent" - ResizeMode="CanResizeWithGrip"> + ResizeMode="CanResizeWithGrip" Closing="Window_Closing" Closed="Window_Closed"> diff --git a/BeWo/View/BeWoWindow.xaml.cs b/BeWo/View/BeWoWindow.xaml.cs index 70049c5de..4d0518dc9 100644 --- a/BeWo/View/BeWoWindow.xaml.cs +++ b/BeWo/View/BeWoWindow.xaml.cs @@ -91,5 +91,15 @@ namespace BeWo.View WindowState = WindowState.Maximized; } } + + public void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + + } + + public void Window_Closed(object sender, EventArgs e) + { + + } } } diff --git a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml index 07f1abf77..29e3fe28a 100644 --- a/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml +++ b/BeWo/View/Controls/GkvAbrechnungDetailControl.xaml @@ -67,10 +67,10 @@ diff --git a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs index e94031e8d..7c5bbac71 100644 --- a/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs +++ b/BeWo/View/Detail/Accounting/GkvAbrechnungOverview.xaml.cs @@ -12,6 +12,7 @@ using System.Windows.Navigation; using System.Windows.Threading; using BeWo.Core; using BeWo.ServiceProxy; +using BeWo.View.Controls; using BeWo.ViewModel; using BeWo.ViewModel.ListViewModel; @@ -169,8 +170,32 @@ namespace BeWo.View.Detail.Accounting { var vm = this.datagrid_gkvAbrechnungen.GetCurrentValue(); - BeWoWindowBuilder.GetGkvAbrechnungDetailWindow(vm).ShowDialog(); + var window = BeWoWindowBuilder.GetGkvAbrechnungDetailWindow(vm); + + window.Closing += Detail_Window_Closing; + + window.ShowDialog(); } + + private void Detail_Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + var bewo_window = sender as BeWoWindow; + var detail_control = bewo_window.GroupBoxContent as GkvAbrechnungDetailControl; + + var vm = detail_control.DataContext as GkvAbrechnungVM; + + var checkbox_checked = detail_control.Checkbox_Bezahlt.IsChecked; + var textbox_text = detail_control.Textbox_Notice.Text; + + vm.Notice = textbox_text; + + if (vm.IsDirty) + { + var dc = ServiceFacade.DoAccountingServiceSync(x => x.UpdateGkvAbrechnung(vm.CommitToDataContract())); + vm.GkvAbrechnungVersion = dc.GkvAbrechnungVersion; + } + } + private void btn_send_Click(object sender, RoutedEventArgs e) { var vm = datagrid_gkvAbrechnungen.GetCurrentValue(); diff --git a/Dakota/DakotaConfig.cs b/Dakota/DakotaConfig.cs index 75829e92c..ae7b64268 100644 --- a/Dakota/DakotaConfig.cs +++ b/Dakota/DakotaConfig.cs @@ -21,7 +21,7 @@ namespace Dakota public static string Absenderklassifikation => "SL"; public static string Dateiidentifizierer => "S"; - public static string GetLogischerDateiname(int _month) => $"{Absenderklassifikation}{IKAbsender.Substring(2, 6)}{Dateiidentifizierer}{_month}"; + public static string GetLogischerDateiname(int _month) => $"{Absenderklassifikation}{IKAbsender.Substring(2, 6)}{Dateiidentifizierer}{_month:00}"; public static SchlüsselAbrechnungscodes Abrechnungscode => SchlüsselAbrechnungscodes.SoziotherapeutischerLeistungserbringer; diff --git a/Dakota/Logic/DakotaInfoCreator.cs b/Dakota/Logic/DakotaInfoCreator.cs index 4f689a09d..6ce14ce99 100644 --- a/Dakota/Logic/DakotaInfoCreator.cs +++ b/Dakota/Logic/DakotaInfoCreator.cs @@ -199,7 +199,7 @@ namespace Dakota.Logic info.Rechnungsnummer = infoParameter.InvoiceBase.InvoiceNumber; info.Rechnungsdatum = infoParameter.InvoiceBase.InvoiceDate.Value; - info.Rechnungsart = SchlüsselRechnungsart.AbrechnungÜberAbrechnungsstelleOhnInkassovollmacht; + info.Rechnungsart = SchlüsselRechnungsart.AbrechnungVonLeistungserbringer; info.Name1 = infoParameter.Mandator.Name; info.Name2 = "Rene Evertz"; diff --git a/Dakota/Logic/DakotaManager.cs b/Dakota/Logic/DakotaManager.cs index 35d61c584..0e5fc8f05 100644 --- a/Dakota/Logic/DakotaManager.cs +++ b/Dakota/Logic/DakotaManager.cs @@ -55,7 +55,7 @@ namespace Dakota.Logic // "T" - Testdaten var verfahrenkennung = "TSOL0"; - var logischer_dateiname = DakotaConfig.GetLogischerDateiname(Month); + var logischer_dateiname = DakotaConfig.GetLogischerDateiname(Month).Trim(); var info_nutz_add = DakotaInfoCreator.GetEmptyInfoNutzdatendatei(DakotaConfig.IKAbsender, organisation.IKDatenannahmestelle, logischer_dateiname, datenaustauschreferenz); var info_auf_add = DakotaInfoCreator.GetEmptyInfoAuftragsdatei(organisation.IKDatenannahmestelle, logischer_dateiname, verfahrenkennung, datenaustauschreferenz);