Button Import Abschlagszahlungen. Bugfix Kette Bericht

This commit is contained in:
Christian
2024-02-21 16:53:55 +01:00
parent fbaa0154d4
commit 03ece0cd50
8 changed files with 136 additions and 21 deletions

View File

@@ -491,6 +491,10 @@ namespace BeWo
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.AllowGkvAbrechnung);
AppSettings.AllowGkvAbrechnung = val != null && val.Equals("1");
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.ShowImportAbschlagszahlungen);
AppSettings.ShowImportAbschlagszahlungen = val != null && val.Equals("1");
switch (_Mandator.BeWoClientType)
{
case 1:

View File

@@ -422,6 +422,8 @@ namespace BeWo.Core.Config
public bool AllowGkvAbrechnung { get; set; }
public bool ShowImportAbschlagszahlungen { get; set; }
private SchedulerViewType _SchedulerViewType;
public SchedulerViewType SchedulerViewType
{

View File

@@ -57,6 +57,11 @@
</localView:BeWoView.Resources>
<Grid>
<Grid x:Name="rootGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -64,7 +69,9 @@
</Grid.RowDefinitions>
<CheckBox Content="Buchungen für ausgewählten Hilfeplan" Grid.Row="0" IsChecked="True" Margin="0,3,0,0"
x:Name="chkWithClient" Checked="chkWithClient_Checked" Unchecked="chkWithClient_Unchecked" />
<Grid x:Name="customerInfoGrid" Grid.Row="1" Margin="0,3,0,0">
<uc:PopUpEdit IsReadOnly="True" Name="popupedit_file" Grid.Column="1" Margin="30,0,0,0" Height="23" Width="250" Grid.Row="0" HorizontalAlignment="Left" DeleteButtonVisibility="Collapsed" PopUpClick="popupedit_file_PopUpClick" />
<Button x:Name="ButtonImport" Grid.Column="2" Margin="5,0,0,0" Height="22" Content="Abschlagszahlungen importieren" Click="ButtonImport_Click" HorizontalAlignment="Left" VerticalAlignment="Center" Visibility="Visible" ></Button>
<Grid x:Name="customerInfoGrid" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,3,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition />
@@ -88,7 +95,7 @@
<TextBlock Text="{Binding Path=InformationString}" Foreground="#FF2B508B" FontSize="14" />
</Grid>
</Grid>
<Grid Grid.Row="2" x:Name="customerDetailGrid" Margin="0,5,0,0">
<Grid Grid.Row="2" x:Name="customerDetailGrid" Grid.Column="0" Grid.ColumnSpan="3" Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />

View File

@@ -23,12 +23,15 @@ using BS.Shared.Services;
using BS.Shared.Core;
using BS.Shared.Translation;
using Microsoft.Win32;
using BS.Shared.Extensions;
namespace BeWo.View.Detail
{
public partial class AccountingTransactionBookingView
{
private bool saveInProgress = false;
private String _UploadFileName;
public static Visibility InsertedOnAndByVisibility
{
get
@@ -56,6 +59,12 @@ namespace BeWo.View.Detail
DownloadLinkEngine = new DownloadLinkEngine();
linkExcelExport.NavigateUri = DownloadLinkEngine.GenerateNewExcelLink();
if (!BeWoApp.AppSettings.ShowImportAbschlagszahlungen)
{
popupedit_file.Visibility = Visibility.Collapsed;
ButtonImport.Visibility = Visibility.Collapsed;
}
Loaded += AccountingTransactionBookingView_Loaded;
}
@@ -650,5 +659,92 @@ namespace BeWo.View.Detail
}
}
private void popupedit_file_PopUpClick(object sender, RoutedEventArgs ev)
{
var dlg = new OpenFileDialog();
if (dlg.ShowDialog() == true)
{
try
{
_UploadFileName = dlg.FileName;
popupedit_file.Text = dlg.SafeFileName;
ButtonImport.IsEnabled = true;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
}
private void ButtonImport_Click(object sender, RoutedEventArgs pe)
{
if (!String.IsNullOrEmpty(popupedit_file.Text))
{
try
{
var upload = new ProgressStream(File.OpenRead(_UploadFileName));
//upload.ProgressChanged += (s, e) => Dispatcher.BeginInvoke(
// DispatcherPriority.Normal,
// (Action)(() =>
// {
// progressbar_upload.Value = e.Data;
// text_progress.Content = string.Format("Bitte warten... {0:00}%", e.Data * 100);
// }));
long oid = 0;
var lUlPackage = new UploadPackage(null, 0, _UploadFileName, null, 0, 0, upload);
ServiceFacade.DoStreamingServiceAsync(
s => s.UploadImportFile(lUlPackage),
r => this.Dispatch(
delegate
{
//_UploadFileName = null;
//button_uploadDocument.IsEnabled = false;
//popupedit_file.Text = string.Empty;
upload.Dispose();
if (r != null && !String.IsNullOrEmpty(r.ResultMessage))
{
if (r.Success)
{
MessageBox.Show(r.ResultMessage, "Import", MessageBoxButton.OK,
MessageBoxImage.Information);
ViewModel.RefreshAccountingTransactionsForSelectedTreeNode();
}
else
{
MessageBox.Show(r.ResultMessage, "Import", MessageBoxButton.OK,
MessageBoxImage.Exclamation);
}
}
}),
() => this.Dispatch(
delegate
{
upload.Dispose();
}));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
}
}
}

View File

@@ -145,14 +145,14 @@ namespace BeWoDatabaseTerminator
{
var contractStatus = contractStatusKeyValuePair.Value;
if (contractStatus.Tenant == "5564670353")
{
//if (contractStatus.Tenant == "5564670353")
//{
}
else
{
continue;
}
//}
//else
//{
// continue;
//}
if (contractStatus.Activate == 1)
{
@@ -163,8 +163,8 @@ namespace BeWoDatabaseTerminator
if(contractStatus.Deactivate == 1)
{
FileUtils.WriteLog($"Deaktiviere Datenbank `{contractStatus.Tenant}`.", _LogFilePath);
ToggleConfigActivation(contractStatus, false);
ToggleBackupConfigActivation(contractStatus, false);
//ToggleConfigActivation(contractStatus, false);
//ToggleBackupConfigActivation(contractStatus, false);
}
@@ -284,7 +284,7 @@ namespace BeWoDatabaseTerminator
//}
}
// Config-Datei ist deaktiviert
else if(File.Exists(Path.Combine(_MultitenancyPath, $"{tenant}.config.deactivated")))
else if (File.Exists(Path.Combine(_MultitenancyPath, $"{tenant}.config.deactivated")))
{
FileUtils.WriteLog($"Die Config-Datei '{tenant}.config.deactivated' existiert.", _LogFilePath);
//connectionString = isExisting ? ExtractConnectionString(configFilePath) : connectionString;
@@ -300,10 +300,11 @@ namespace BeWoDatabaseTerminator
else
{
FileUtils.WriteLog($"Die Config-Datei '{configFilePath}' existiert nicht.", _LogFilePath);
RunCreateScripts(tenant, connectionString);
await SendInitialPasswordToTool(contractStatus);
if (!isExisting)
{
RunCreateScripts(tenant, connectionString);
await SendInitialPasswordToTool(contractStatus);
}
}
}
@@ -415,7 +416,7 @@ namespace BeWoDatabaseTerminator
if (Directory.Exists(_CreateScriptsFolderPath) && Directory.Exists(_MultitenancyPath) && Directory.Exists(_BackupConfigFolderPath))
{
FileUtils.GenerateNewConfigFile(Path.Combine(_MultitenancyPath, $"{tenant}.config"), connectionString, tenant);
FileUtils.GenerateNewDBAdminFile(Path.Combine(_CreateAdminFolderPath, $"{tenant}.db2mail"), connectionString, tenant);
FileUtils.GenerateNewDBAdminFile(Path.Combine(_BackupConfigFolderPath, $"{tenant}.db2mail"), tenant, _ConnectionStringPort, _ConnectionStringUserID, _ConnectionStringPassword);
var createScriptPath = Path.Combine(_CreateScriptsFolderPath, _CreateScriptName);
var changesScriptPath = Path.Combine(_CreateScriptsFolderPath, _ChangesScriptName);

View File

@@ -453,7 +453,7 @@ namespace KetteReports
ro.GeleisteteFlsGesamt += serviceRecord.RoundedDuration / 60;
result.GeleisteteFlsGesamtCount += ro.GeleisteteFlsGesamt;
result.GeleisteteFlsGesamtCount += serviceRecord.RoundedDuration / 60;
}
}
//else
@@ -463,7 +463,7 @@ namespace KetteReports
}
ro.GeleisteteFlsOhneKlient /= 60;
//ro.GeleisteteFlsOhneKlient /= 60;

View File

@@ -453,6 +453,8 @@ namespace KetteReports
ro.GeleisteteFlsKlient += serviceRecord.RoundedDuration / 60;
ro.GeleisteteFlsGesamt += serviceRecord.RoundedDuration / 60;
result.GeleisteteFlsGesamtCount += serviceRecord.RoundedDuration / 60;
}
}
//else
@@ -462,9 +464,9 @@ namespace KetteReports
}
ro.GeleisteteFlsOhneKlient /= 60;
//ro.GeleisteteFlsOhneKlient /= 60;
result.GeleisteteFlsGesamtCount += ro.GeleisteteFlsGesamt;
var calc = PluginLoader.FindClass<Calculations>();

View File

@@ -85,5 +85,8 @@
public static string FilterGroupServiceCategories => "FilterGroupServiceCategories";
public static string AllowGkvAbrechnung => "AllowGkvAbrechnung";
public static string ShowImportAbschlagszahlungen => "ShowImportAbschlagszahlungen";
}
}