diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 3ee8d1721..cf1c9e42d 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -106,6 +106,7 @@
+
@@ -155,6 +156,9 @@
AiConversationButton.xaml
+
+ AiPromptbausteinButton.xaml
+
AiPromptbausteinActionResultView.xaml
@@ -256,6 +260,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml
index 042c908b3..43aa8902a 100644
--- a/BeWo/BeWoApp.xaml
+++ b/BeWo/BeWoApp.xaml
@@ -86,6 +86,7 @@
+
diff --git a/BeWo/Converter/StringEmptyBoolConverter.cs b/BeWo/Converter/StringEmptyBoolConverter.cs
new file mode 100644
index 000000000..3bb495e3a
--- /dev/null
+++ b/BeWo/Converter/StringEmptyBoolConverter.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace BeWo.Converter
+{
+ public class StringEmptyBoolConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is string stringi)
+ {
+ return !string.IsNullOrEmpty(stringi);
+ }
+
+ return false;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/BeWo/Services/BeWoWindowService.cs b/BeWo/Services/BeWoWindowService.cs
index d2b01c7f3..d9eecc28a 100644
--- a/BeWo/Services/BeWoWindowService.cs
+++ b/BeWo/Services/BeWoWindowService.cs
@@ -54,19 +54,19 @@ namespace BeWo.Services
}
else if (windowViewModel is AiPromptbausteinFolderViewModel viewModel3)
{
- ShowAiPromptbausteinFolderPopup(viewModel3);
+ ShowAiPromptbausteinFolderWindow(viewModel3);
}
else if(windowViewModel is AiPromptbausteinPromptViewModel viewModel4)
{
- ShowAiPromptbausteinPromptPopup(viewModel4);
+ ShowAiPromptbausteinPromptWindow(viewModel4);
}
else if(windowViewModel is AiPromptbausteinActionResultViewModel viewModel5)
{
- ShowAiPromptbausteinActionResultPopup(viewModel5);
+ ShowAiPromptbausteinActionResultWindow(viewModel5);
}
else if(windowViewModel is AiPromptbausteinSelectionComplexViewModel viewModel6)
{
- ShowAiPromptbausteinSelectionComplexPopup(viewModel6);
+ ShowAiPromptbausteinSelectionComplexWindow(viewModel6);
}
else
{
@@ -85,7 +85,7 @@ namespace BeWo.Services
};
Show(title, control, viewModel, options);
}
- public void ShowAiPromptbausteinFolderPopup(AiPromptbausteinFolderViewModel viewModel)
+ public void ShowAiPromptbausteinFolderWindow(AiPromptbausteinFolderViewModel viewModel)
{
var control = new AiPromptbausteinFolderView(viewModel);
var options = new BeWoWindowOptions()
@@ -95,7 +95,7 @@ namespace BeWo.Services
};
Show("KI Promptbaustein Ordner", control, viewModel, options);
}
- public void ShowAiPromptbausteinPromptPopup(AiPromptbausteinPromptViewModel viewModel)
+ public void ShowAiPromptbausteinPromptWindow(AiPromptbausteinPromptViewModel viewModel)
{
var control = new AiPromptbausteinPromptView(viewModel);
var options = new BeWoWindowOptions()
@@ -105,7 +105,7 @@ namespace BeWo.Services
};
Show("KI Promptbaustein Prompt", control, viewModel, options);
}
- public void ShowAiPromptbausteinActionResultPopup(AiPromptbausteinActionResultViewModel viewModel)
+ public void ShowAiPromptbausteinActionResultWindow(AiPromptbausteinActionResultViewModel viewModel)
{
var control = new AiPromptbausteinActionResultView(viewModel);
var options = new BeWoWindowOptions()
@@ -116,7 +116,7 @@ namespace BeWo.Services
Show("KI Promptbaustein Ergebnis", control, viewModel, options);
}
- public void ShowAiPromptbausteinSelectionComplexPopup(AiPromptbausteinSelectionComplexViewModel viewModel)
+ public void ShowAiPromptbausteinSelectionComplexWindow(AiPromptbausteinSelectionComplexViewModel viewModel)
{
var control = new AiPromptbausteinComplexSelectionView(viewModel);
var options = new BeWoWindowOptions()
diff --git a/BeWo/View/Controls/AI/AiConversationButton.xaml.cs b/BeWo/View/Controls/AI/AiConversationButton.xaml.cs
index 4e6961f56..5ad874de0 100644
--- a/BeWo/View/Controls/AI/AiConversationButton.xaml.cs
+++ b/BeWo/View/Controls/AI/AiConversationButton.xaml.cs
@@ -170,13 +170,15 @@ namespace BeWo.View.Controls.AI
{
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
viewmodel.PromptAccepted += PromptAccepted;
+ popup_promptbaustein_all.Closed += (s, e) => viewmodel.ResetSelection();
var view = new AiPromptbausteinComplexSelectionView(viewmodel);
view.Padding = new Thickness(3);
view.Background = FindResource("ObjectEditBackgroundBrush") as System.Windows.Media.Brush;
border_promptbaustein_al.Child = view;
- var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
+ var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
viewmodel2.PromptAccepted += PromptAccepted;
+ popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
var view2 = new AiPromptbausteinComplexSelectionView(viewmodel2);
view2.ReduceSelection();
viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
diff --git a/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml
new file mode 100644
index 000000000..df37ce2af
--- /dev/null
+++ b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs
new file mode 100644
index 000000000..07ac2d2b6
--- /dev/null
+++ b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs
@@ -0,0 +1,183 @@
+using BeWo.ServiceProxy;
+using BeWo.View.Detail.AI;
+using BeWo.ViewModel;
+using BeWo.ViewModel.View.AI;
+using BS.Shared;
+using BS.Shared.DataContracts.Feature.AI;
+using DevExpress.Utils.Mdi;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.Remoting.Messaging;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace BeWo.View.Controls.AI
+{
+ public enum AiPromptbausteinButtonState
+ {
+ Hidden,
+ Normal,
+ Loading,
+ Disabled
+ }
+
+ ///
+ /// Interaktionslogik für AiPromptbausteinButton.xaml
+ ///
+ public partial class AiPromptbausteinButton : UserControl
+ {
+ public static readonly DependencyProperty CanExecuteProperty =
+ DependencyProperty.Register("CanExecute", typeof(bool), typeof(AiPromptbausteinButton), new PropertyMetadata(true, OnCanExecuteChanged));
+
+ public static readonly DependencyProperty StateProperty =
+ DependencyProperty.Register("State", typeof(AiPromptbausteinButtonState), typeof(AiPromptbausteinButton), new PropertyMetadata(AiPromptbausteinButtonState.Normal, OnStateChanged));
+
+ public static readonly DependencyProperty ActionTypeProperty =
+ DependencyProperty.Register("ActionType", typeof(AiActionType), typeof(AiPromptbausteinButton), new PropertyMetadata(AiActionType.ServiceRecord, OnActionTypeChanged));
+
+ public AiPromptbausteinButtonState State
+ {
+ get { return (AiPromptbausteinButtonState)GetValue(StateProperty); }
+ set { SetValue(StateProperty, value); }
+ }
+ public AiActionType ActionType
+ {
+ get { return (AiActionType)GetValue(ActionTypeProperty); }
+ set { SetValue(ActionTypeProperty, value); }
+ }
+
+ public bool CanExecute
+ {
+ get { return (bool)GetValue(CanExecuteProperty); }
+ set { SetValue(CanExecuteProperty, value); }
+ }
+
+ public event EventHandler PromptAccepted;
+
+ public AiPromptbausteinButton()
+ {
+ InitializeComponent();
+ }
+
+ private static void OnStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var control = (AiPromptbausteinButton)d;
+ var state = (AiPromptbausteinButtonState)e.NewValue;
+ control.UpdateState(state);
+ }
+ private static void OnActionTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var control = (AiPromptbausteinButton)d;
+ var actionType = (AiActionType)e.NewValue;
+ control.UpdateActionType(actionType);
+ }
+ private static void OnCanExecuteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var control = (AiPromptbausteinButton)d;
+ var canExecute = (bool)e.NewValue;
+ control.UpdateCanExecute(canExecute);
+ }
+
+ public void AiPromptOpenAll()
+ {
+ popup_promptbaustein_all.IsOpen = true;
+ }
+ public void AiPromptOpenFavorite()
+ {
+ popup_promptbaustein_favoriten.IsOpen = true;
+ }
+
+ private void btnOpenAi5_Click(object sender, RoutedEventArgs e)
+ {
+ AiPromptOpenAll();
+ }
+ private void btnOpenAi5_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ AiPromptOpenFavorite();
+ }
+
+ private void InitPromptbausteine(AiActionType actionType, List folders)
+ {
+ VMFactory.CreateAiPromptbausteinFolderListVM(folders, (listvm) =>
+ {
+ var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
+ viewmodel.PromptAccepted += PromptAccepted;
+ popup_promptbaustein_all.Closed += (s, e) => viewmodel.ResetSelection();
+ var view = new AiPromptbausteinComplexSelectionView(viewmodel);
+ view.Padding = new Thickness(3);
+ view.Background = FindResource("ObjectEditBackgroundBrush") as System.Windows.Media.Brush;
+ border_promptbaustein_al.Child = view;
+
+ var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
+ viewmodel2.PromptAccepted += PromptAccepted;
+ popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
+ var view2 = new AiPromptbausteinComplexSelectionView(viewmodel2);
+ view2.ReduceSelection();
+ viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
+ view2.Padding = new Thickness(3);
+ view2.Background = FindResource("ObjectEditBackgroundBrush") as System.Windows.Media.Brush;
+ border_promptbaustein_favoriten.Child = view2;
+ State = AiPromptbausteinButtonState.Normal;
+ });
+ }
+ private void UpdateState(AiPromptbausteinButtonState state)
+ {
+ switch (state)
+ {
+ case AiPromptbausteinButtonState.Hidden:
+ root.Visibility = Visibility.Collapsed;
+ root.IsEnabled = true;
+ btnOpenAi5.IsEnabled = true;
+ break;
+ case AiPromptbausteinButtonState.Normal:
+ root.Visibility = Visibility.Visible;
+ root.IsEnabled = true;
+ btnOpenAi5.IsEnabled = true;
+ break;
+ case AiPromptbausteinButtonState.Loading:
+ root.Visibility = Visibility.Visible;
+ root.IsEnabled = false;
+ btnOpenAi5.IsEnabled = false;
+ break;
+ case AiPromptbausteinButtonState.Disabled:
+ root.Visibility = Visibility.Visible;
+ root.IsEnabled = true;
+ btnOpenAi5.IsEnabled = false;
+ break;
+ default:
+ throw new NotImplementedException();
+ break;
+ }
+ }
+ private void UpdateActionType(AiActionType actionType)
+ {
+ ActionType = actionType;
+
+ if (!BeWoApp.AppSettings.ShowAI)
+ {
+ State = AiPromptbausteinButtonState.Hidden;
+ return;
+ }
+
+ State = AiPromptbausteinButtonState.Loading;
+ ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiPromptbausteinFolder(actionType), folders => InitPromptbausteine(actionType, folders));
+ }
+ private void UpdateCanExecute(bool canExecute)
+ {
+ if (canExecute)
+ State = AiPromptbausteinButtonState.Normal;
+ else
+ State = AiPromptbausteinButtonState.Disabled;
+ }
+ }
+}
diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml
index 24be48a9b..1fef54bc8 100644
--- a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml
+++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml
@@ -74,9 +74,9 @@
diff --git a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs
index 316a14706..712e31f42 100644
--- a/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs
+++ b/BeWo/View/Detail/AI/AiPromptbausteinComplexSelectionView.xaml.cs
@@ -31,7 +31,18 @@ namespace BeWo.View.Detail.AI
DataContext = ViewModel = viewModel;
- Loaded += (s, e) => ViewModel.InitVMList();
+ Loaded += (s, e) =>
+ {
+ ViewModel.InitVMList();
+
+ TreeViewItem item = treeView.ItemContainerGenerator.ContainerFromIndex(0) as TreeViewItem;
+ if (item != null)
+ {
+ item.IsSelected = true;
+
+ item.IsSelected = false;
+ }
+ };
}
public void ReduceSelection()
diff --git a/BeWo/View/Detail/AI/AiPromptbausteinPromptView.xaml b/BeWo/View/Detail/AI/AiPromptbausteinPromptView.xaml
index 6732d038a..d48de16f8 100644
--- a/BeWo/View/Detail/AI/AiPromptbausteinPromptView.xaml
+++ b/BeWo/View/Detail/AI/AiPromptbausteinPromptView.xaml
@@ -70,7 +70,6 @@
Grid.Row="2"
Grid.Column="2"
IsEnabled="{Binding ViewModel.CanEdit}"
- MaxLength="1024"
Style="{StaticResource TextBoxNoticeLarge}"
Text="{Binding ViewModel.Prompt, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
diff --git a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
index b9ee550e7..e40c2ceca 100644
--- a/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
+++ b/BeWo/View/Detail/Zeiterfassung/ServiceRecordView2.xaml
@@ -1718,12 +1718,11 @@
Style="{StaticResource ButtonRedoStyle}"
Visibility="{Binding IsRedoButtonVisible, Converter={StaticResource BoolVisibilityHiddenConverter}}" />
-
+
@@ -3328,8 +3327,8 @@
Margin="10,0,0,0"
ActionType="ServiceRecordConversation"
OpenAiWindowClick="AiConversationButton_OpenAiWindowClick"
- State="{Binding AiConversationButtonState}"
- PromptAccepted="PromptAccepted"/>
+ PromptAccepted="PromptAccepted"
+ State="{Binding AiConversationButtonState}" />
GetVisibleRecordVMs()
+ private IEnumerable GetVisibleRecordVMs()
{
var list = new List();
@@ -5146,6 +5146,11 @@ namespace BeWo.View.Detail.Zeiterfassung
return list;
}
+
+ private void btn_AiPromptbaustein2_PromptAccepted(object sender, AiPromptbausteinPromptVM e)
+ {
+ ViewModel.PromptAccepted(sender, e);
+ }
}
//public class RowBackgroundHelper
diff --git a/BeWo/ViewModel/AiPromptbausteinPromptVM.cs b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
index 96da4f4be..41c85ef53 100644
--- a/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
+++ b/BeWo/ViewModel/AiPromptbausteinPromptVM.cs
@@ -103,9 +103,10 @@ namespace BeWo.ViewModel
public bool IsFavorite
{
get => _IsFavorite;
- set {
- var success = SetProperty(ref _IsFavorite, value, nameof(IsFavorite), () => DataContract.IsFavorite);
- if(success)
+ set
+ {
+ var success = SetProperty(ref _IsFavorite, value, nameof(IsFavorite), () => DataContract.IsFavorite);
+ if (success)
FirePropertyChanged(nameof(FontWeight));
}
}
@@ -124,7 +125,12 @@ namespace BeWo.ViewModel
public bool IsSelected
{
get => _IsSelected;
- set => SetProperty(ref _IsSelected, value, nameof(IsInfoVisible));
+ set
+ {
+ var success = SetProperty(ref _IsSelected, value, nameof(IsSelected));
+ if (success)
+ FirePropertyChanged(nameof(IsInfoVisible));
+ }
}
public bool IsInfoVisible
@@ -190,13 +196,13 @@ namespace BeWo.ViewModel
ActionType = pDataContract.ActionType;
}
- public override bool IsDirty
+ public override bool IsDirty
{
get
{
if (!CanEdit)
return _DirtyProps.Contains(nameof(IsFavorite));
- return _DirtyProps.Count > 0;
+ return _DirtyProps.Count > 0;
}
}
}
diff --git a/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs b/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
index 9071f6bb1..c8cfbdcc4 100644
--- a/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
+++ b/BeWo/ViewModel/ListViewModel/ServiceRecordListVM.cs
@@ -103,14 +103,12 @@ namespace BeWo.ViewModel.ListViewModel
private int _AiActionHistoryIndex;
private AiConversationButtonState _AiConversationButtonState;
- public ICommand OpenAiPromptSelectionCommand { get; set; }
public ICommand UndoAiActionCommand { get; set; }
public ICommand RedoAiActionCommand { get; set; }
private List _EditAiActionHistory;
private int _EditAiActionHistoryIndex;
- public ICommand OpenEditAiPromptSelectionCommand { get; set; }
public ICommand UndoEditAiActionCommand { get; set; }
public ICommand RedoEditAiActionCommand { get; set; }
@@ -185,31 +183,31 @@ namespace BeWo.ViewModel.ListViewModel
private void InitAiStuff()
{
- var vm_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
+ //var vm_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
- vm_doku.PromptAccepted += PromptAccepted;
+ //vm_doku.PromptAccepted += PromptAccepted;
- OpenAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(
- () => BeWoApp.MainControl.WindowService.Show(vm_doku),
- null,
- () => !string.IsNullOrWhiteSpace(AktuellerDokutext));
+ //OpenAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(
+ // () => BeWoApp.MainControl.WindowService.Show(vm_doku),
+ // null,
+ // () => !string.IsNullOrWhiteSpace(AktuellerDokutext));
UndoAiActionCommand = new DelegateCommand(UndoAiAction);
RedoAiActionCommand = new DelegateCommand(RedoAiAction);
- var vm_edit_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
+ //var vm_edit_doku = new AiPromptbausteinSelectionComplexViewModel(AiActionType.ServiceRecordDocumentation);
- vm_edit_doku.PromptAccepted += EditPromptAccepted;
+ //vm_edit_doku.PromptAccepted += EditPromptAccepted;
- OpenEditAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(() =>
- {
- _EditAiActionHistory = new List();
- _EditAiActionHistory.Add(AktuellerEditDokutext);
- _EditAiActionHistoryIndex = 0;
- BeWoApp.MainControl.WindowService.Show(vm_edit_doku);
- },
- null,
- () => !string.IsNullOrWhiteSpace(AktuellerEditDokutext));
+ //OpenEditAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(() =>
+ //{
+ // _EditAiActionHistory = new List();
+ // _EditAiActionHistory.Add(AktuellerEditDokutext);
+ // _EditAiActionHistoryIndex = 0;
+ // BeWoApp.MainControl.WindowService.Show(vm_edit_doku);
+ //},
+ //null,
+ //() => !string.IsNullOrWhiteSpace(AktuellerEditDokutext));
UndoEditAiActionCommand = new DelegateCommand(UndoEditAiAction);
RedoEditAiActionCommand = new DelegateCommand(RedoEditAiAction);
@@ -232,6 +230,7 @@ namespace BeWo.ViewModel.ListViewModel
set
{
PrototypeVM.Notice = value;
+ FirePropertyChanged(nameof(IsAiDocuButtonCanExecute));
FirePropertyChanged(nameof(IsRedoButtonVisible));
FirePropertyChanged(nameof(IsUndoButtonVisible));
}
@@ -250,13 +249,14 @@ namespace BeWo.ViewModel.ListViewModel
public bool IsAiModuleEnabled => (BeWoApp.AppSettings.ShowAI || BeWoApp.AppSettings.ShowAIVoice);
public bool IsAiChatButtonVisible => SelectedCustomerNode is object && IsAiModuleEnabled && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleServiceRecordChat);
public bool IsAiDocuButtonVisible => SelectedCustomerNode is object && IsAiModuleEnabled && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleServiceRecordDocu);
+ public bool IsAiDocuButtonCanExecute => !string.IsNullOrWhiteSpace(AktuellerDokutext);
public bool IsUndoButtonVisible => _AiActionHistoryIndex > 0;
public bool IsRedoButtonVisible => _AiActionHistoryIndex < _AiActionHistory.Count - 1;
public bool IsEditUndoButtonVisible => _EditAiActionHistoryIndex > 0;
public bool IsEditRedoButtonVisible => _EditAiActionHistoryIndex < (_EditAiActionHistory?.Count ?? 0) - 1;
- private void PromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
+ public void PromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
{
if (prompt is null)
throw new NotImplementedException();
@@ -363,7 +363,7 @@ namespace BeWo.ViewModel.ListViewModel
);
}
- private void EditPromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
+ public void EditPromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
{
if (prompt is null)
throw new NotImplementedException();
diff --git a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
index 7f30a0cd7..b57f83cdc 100644
--- a/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
+++ b/BeWo/ViewModel/View/AI/AiPromptbausteinComplexSelectionViewModel.cs
@@ -19,6 +19,7 @@ namespace BeWo.ViewModel.View.AI
public event EventHandler PromptAccepted;
private AiPromptbausteinFolderVM _SelectedFolder;
+ private AiPromptbausteinPromptVM _SelectedPrompt;
public AiPromptbausteinSelectionComplexViewModel()
{
@@ -33,12 +34,15 @@ namespace BeWo.ViewModel.View.AI
{
AiActionType = aiActionType;
}
- public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel) : this(aiActionType)
+ public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false) : this(aiActionType)
{
LoadedActionType = aiActionType;
Folders = viewModel;
+ IsFavorite = isFavorite;
}
+ public bool IsFavorite { get; set; }
+
public ICommand SendCommand { get; set; }
public AiActionType AiActionType { get; set; }
@@ -52,10 +56,25 @@ namespace BeWo.ViewModel.View.AI
FirePropertyChanged(nameof(SelectedFolder));
}
}
- public AiPromptbausteinPromptVM SelectedPrompt { get; set; }
+ public AiPromptbausteinPromptVM SelectedPrompt
+ {
+ get => _SelectedPrompt;
+ set
+ {
+ _SelectedPrompt = value;
+ FirePropertyChanged(nameof(SelectedPrompt));
+ }
+ }
public AiPromptbausteinFolderListVM Folders { get; private set; }
public AiActionType LoadedActionType { get; set; }
+ public void ResetSelection()
+ {
+ if (!IsFavorite)
+ SelectedFolder = null;
+
+ SelectedPrompt = null;
+ }
public void Send()
{
CloseDialogCommand.Execute(null);
diff --git a/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj b/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj
index ae0620de4..c75ab761e 100644
--- a/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj
+++ b/ReportImp/AWOMuensterlandRecklinghausen/AWOMuensterlandRecklinghausen.csproj
@@ -116,6 +116,7 @@
SbdRechnung2024.cs
+
Component
diff --git a/ReportImp/AWOMuensterlandRecklinghausen/Service/CustomTranslationDictionary.cs b/ReportImp/AWOMuensterlandRecklinghausen/Service/CustomTranslationDictionary.cs
new file mode 100644
index 000000000..aef44e1d9
--- /dev/null
+++ b/ReportImp/AWOMuensterlandRecklinghausen/Service/CustomTranslationDictionary.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Plugins;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts.Compact;
+using BS.Shared.Extensions;
+
+namespace AutismusKoelnBonn.Translation
+{
+ public class CustomTranslationDictionary : TranslationDictionary
+ {
+ public override Dictionary GetTranslationDictionary()
+ {
+ var dict = base.GetTranslationDictionary();
+ AddOrReplaceTranslation(dict, "CustomerVarFieldsTitle", "Planungsdetails");
+ return dict;
+ }
+ }
+}
diff --git a/ReportImp/HshCologne/Invoicing/CustomInvoiceCreation.cs b/ReportImp/HshCologne/Invoicing/CustomInvoiceCreation.cs
index e6ff502ba..824f4c05a 100644
--- a/ReportImp/HshCologne/Invoicing/CustomInvoiceCreation.cs
+++ b/ReportImp/HshCologne/Invoicing/CustomInvoiceCreation.cs
@@ -247,7 +247,7 @@ namespace HshCologne.Invoicing
}
// Da diverse Kostenträger liegen deren Stundensätze unter Preise
- // Während Wesseling und Geilenkirchen für ALLES nur einen Stundensatz haben
+ // Während Wesseling und Geilenkirchen für (fast) ALLES nur einen Stundensatz haben
// Und Erftstadt macht sowieso ALLES anders :D
decimal stundensatz = 0;
if (iServiceRecord.ServiceDescription.CategoryName == "FAM")
@@ -262,6 +262,14 @@ namespace HshCologne.Invoicing
if (iServiceRecord.CostBearer.Name.Contains("Wesseling"))
{
stundensatz = GetStundensatz(scap.CostBearer2SupportConcept, null, iServiceRecord.Start);
+ // AB, 13.03.2026: bisher nur der Stundensatz unter Organisation, jetzt erste Ausnahme -> eigene Quali dafür
+ var qOid = iServiceRecord.Employee.ValueListEntries
+ .Where(i => i.Value == ValueListEntryType.StaffQualificationsType).Select(i => i.Key).OrderByDescending(q => q).ToList();
+ if (qOid.Any(q => q == 1477))
+ {
+ stundensatz = preisAK;
+ ii.UnitDescription = "Assistenzkraft";
+ }
}
// Erfstadt hat in der Familienhilfe teileweise noch den Sonderfall UMA, dort wird geringer bezahlt, Stundensatz nach Quali bei Organisation, sonst normal
// Erftstadt hat keine SB
diff --git a/ReportImp/IBAHSeV/IBAHSeV.csproj b/ReportImp/IBAHSeV/IBAHSeV.csproj
index 969de4adf..24b39a1de 100644
--- a/ReportImp/IBAHSeV/IBAHSeV.csproj
+++ b/ReportImp/IBAHSeV/IBAHSeV.csproj
@@ -65,6 +65,7 @@
+
@@ -139,7 +140,6 @@
-
diff --git a/ReportImp/IBAHSeV/Import/CustomDataImporter.cs b/ReportImp/IBAHSeV/Import/CustomDataImporter.cs
new file mode 100644
index 000000000..16d3dbe1b
--- /dev/null
+++ b/ReportImp/IBAHSeV/Import/CustomDataImporter.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.Core;
+using BeWo.Service.Import.AvisImport;
+using BeWo.Service.Plugins;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using Utils = BS.Shared.Core.Utils;
+
+namespace IBAHS.Import
+{
+ public class CustomLvrAviseImporter : LvrAviseImporter
+ {
+ public override String ImportCsvAvise(String csv)
+ {
+ var reader = new LvrAvisCsvReader();
+ var avise = LeseEinzelAviseLWL(csv);
+ var hilfeplaene = CreateHilfeplanInfos();
+
+ return ImportAvise(avise, hilfeplaene);
+ }
+
+ private List LeseEinzelAviseLWL(string importfile)
+ {
+ List liste = new List();
+ String[] lines = importfile.Split('\n');
+
+ for (int i = 0; i < lines.Count(); i++)
+ {
+ string line = lines[i];
+ var fields = line.Split(';');
+ if (fields.Length >= 10)
+ {
+ if (!String.IsNullOrEmpty(fields[4]) && !String.IsNullOrEmpty(fields[5]) && !String.IsNullOrEmpty(fields[8])
+ && (fields[5].ToString().Contains("Westfalen-Lippe") || fields[5].ToString().Contains("LWL")))
+ {
+ try
+ {
+ DateTime gueltigkeitsTag = DateTime.Now;
+ decimal betrag = 0m;
+
+ var neuerAvis = new Avis();
+ decimal.TryParse(fields[8], out betrag);
+ neuerAvis.Betrag = betrag;
+ fields[4] = fields[4].Trim();
+ if (!String.IsNullOrEmpty(fields[4]))
+ {
+ var zweck = fields[4];
+ string pattern = @"^(?:[^/]*/){5}([^/]*)"; // Sucht den gesamten Text nach dem 5. / -> also der Teil mit Aktenzeichen und Name
+ Match matchVerwendung = Regex.Match(zweck, pattern);
+ if (matchVerwendung.Success)
+ {
+ neuerAvis.Klient = matchVerwendung.Groups[1].Value.Substring(8).Trim();
+ neuerAvis.Klient = Regex.Replace(neuerAvis.Klient, @"\b([A-ZÄÖÜ][a-zäöüß]+)\s*\1\b", "$1"); // Der Nachname kommt fast immer doppelt vor, wird hier gefiltert
+ neuerAvis.Verwendungszweck = matchVerwendung.Groups[1].Value.Substring(8).Trim();
+ neuerAvis.Aktenzeichen = matchVerwendung.Groups[1].Value.Substring(0, 7);
+ }
+ else
+ {
+ neuerAvis.Klient = zweck;
+ neuerAvis.Verwendungszweck = zweck;
+ neuerAvis.Aktenzeichen = zweck;
+ }
+
+ var teilEins = zweck.Substring(0, 50).Replace(" ", "");
+ var date = teilEins.Substring(23, 10);
+ if (int.TryParse(date, out int resultMonat) && int.TryParse(date, out int resultJahr))
+ {
+ gueltigkeitsTag = new DateTime(resultJahr, resultMonat, 1);
+ }
+ else
+ {
+ if (DateTime.TryParse(date, out DateTime resultHp))
+ {
+ gueltigkeitsTag = resultHp;
+ }
+ else
+ {
+ var datumMonat = fields[1].Substring(fields[1].Length - 7, 2);
+ var datumJahr = fields[1].Substring(fields[1].Length - 4, 4);
+ if (int.TryParse(datumMonat, out int resultMonth) && int.TryParse(datumJahr, out int resultYear))
+ {
+ gueltigkeitsTag = new DateTime(resultYear, resultMonth, 1);
+ }
+ else
+ {
+ if (DateTime.TryParse(fields[4], out DateTime resultDate))
+ {
+ gueltigkeitsTag = resultDate;
+ }
+ }
+ }
+ }
+ neuerAvis.GueltigkeitsDatum = gueltigkeitsTag;
+ }
+ else
+ {
+ neuerAvis.Verwendungszweck = "kein Text";
+ neuerAvis.Aktenzeichen = "kein Text";
+ }
+ neuerAvis.BuchungsDatum = DateTime.Now;
+ //neuerAvis.Sachbearbeiter = fields[13] + ", " + fields[14];
+ if (neuerAvis.Betrag != 0)
+ {
+ liste.Add(neuerAvis);
+ }
+ }
+ catch (Exception e)
+ {
+ //ignore
+ }
+ }
+ }
+ }
+ return liste;
+ }
+
+ public override List CreateHilfeplanInfos()
+ {
+ List liste = new List();
+ var scList = DAOFactory.GenericDAO.GetAllActiveAndArchived();
+
+ foreach (var supportConcept in scList)
+ {
+ foreach (var cb2sc in supportConcept.CostBearer2SupportConceptList)
+ {
+ HilfeplanInfo hi = new HilfeplanInfo();
+ hi.Start = cb2sc.StartDate;
+ hi.Ende = cb2sc.EndDate;
+ var reference = cb2sc.CustomerReferenceNumber;
+ if (!String.IsNullOrEmpty(reference))
+ {
+ reference = reference.Replace("-", "");
+ reference = reference.Replace("/", "").Trim();
+ }
+ hi.Aktenzeichen = reference;
+ hi.CostBearer2SupportConcept = cb2sc;
+ hi.CustomerFirstName = cb2sc.SupportConcept.Customer.Person.FirstName;
+ hi.CustomerLastName = cb2sc.SupportConcept.Customer.Person.LastName;
+
+ if (hi.Start.HasValue && hi.Ende.HasValue && !String.IsNullOrEmpty(hi.Aktenzeichen))
+ {
+ liste.Add(hi);
+ }
+ }
+ }
+
+ return liste;
+ }
+ }
+}
diff --git a/ReportImp/LebenshilfeBadKreuznachFUD/Export/SageExporter.cs b/ReportImp/LebenshilfeBadKreuznachFUD/Export/SageExporter.cs
index 50c147b4e..657c262fd 100644
--- a/ReportImp/LebenshilfeBadKreuznachFUD/Export/SageExporter.cs
+++ b/ReportImp/LebenshilfeBadKreuznachFUD/Export/SageExporter.cs
@@ -35,6 +35,11 @@ namespace LebenshilfeBadKreuznachFUD.Export
query.FileName = String.Format("SageExportAutismus{0:yyyyMM}.csv", dt);
query.QueryResult = GetAbrechnungenString(dt, "Autismus");
}
+ else if (query.Oid == 103)
+ {
+ query.FileName = String.Format("SageExportKita{0:yyyyMM}.csv", dt);
+ query.QueryResult = GetAbrechnungenString(dt, "Kita");
+ }
return query;
}
@@ -95,7 +100,7 @@ ib.AccountingPeriodEnd,
String buchungstext = GetBuchungstext(row, teamname);
sb.Append(buchungstext);
sb.Append(";");
- if (teamname == "Integration")
+ if (teamname == "Integration"|| teamname == "Kita")
{
sb.Append(String.Format("{0}", row[7])); // Sollkonto - Kundennr. Kostenträger
}
@@ -113,12 +118,27 @@ ib.AccountingPeriodEnd,
String costCenter = GetKostenstelle(row[9], teamname);
sb.Append(costCenter + ";"); // Kostenstelle (String.Format("{0}", row[9]));
sb.Append(costCenter + ";"); // Kostenstelle Haben (String.Format("{0}", row[9]));
- sb.Append(";;;12"); // Buchungskreis
+ String buchungskreis = GetBuchungskreis(row[9], teamname);
+ sb.Append(String.Format(";;;{0}", buchungskreis)); // Buchungskreis
}
return sb.ToString();
}
+ private static string GetBuchungskreis(object v, string teamname)
+ {
+ string kreis = "12";
+ if (teamname == "Kita") // Kostenstelle ist bei Kind hinterlegt; Kostenstelle spezifisch für jede Kita, damit Buchungskreis ableitbar (ansonsten müsste man über Team des Kindes gehen)
+ {
+ kreis = "2";
+ if (v.ToString() != null && v.ToString().ToLower().Contains("t80600"))
+ {
+ kreis = "3";
+ }
+ }
+ return kreis;
+ }
+
private static string GetBuchungstext(DataRow row, string teamname)
{
String text = String.Format("{0:MM}/{0:yyyy} {1} - {2}", row[11], row[5], row[6]);
@@ -130,6 +150,10 @@ ib.AccountingPeriodEnd,
{
text = "AR-ENT " + text;
}
+ else if (teamname == "Kita")
+ {
+ text = "AR-PS " + text;
+ }
return text;
}
@@ -161,6 +185,14 @@ ib.AccountingPeriodEnd,
kto = "S82029";
}
}
+ else if (teamname == "Kita") // Kostenstelle ist bei Kind hinterlegt; Kostenstelle spezifisch für jede Kita, damit Konto ableitbar (ansonsten müsste man über Team des Kindes gehen)
+ {
+ kto = "S82002";
+ if (row[9].ToString() != null && row[9].ToString().ToLower().Contains("t80600"))
+ {
+ kto = "S82003";
+ }
+ }
return kto;
}
@@ -171,7 +203,7 @@ ib.AccountingPeriodEnd,
{
stelle = "T70400";
}
- else if (teamname == "Entlastung")
+ else if (teamname == "Entlastung" || teamname == "Kita")
{
stelle = String.Format("{0}", v);
}
@@ -209,7 +241,7 @@ inner join serviceinvoiceperiod sip on sip.serviceinvoiceoid = si.oid
inner join invoiceitem ii on ii.serviceinvoiceperiodoid = sip.oid
WHERE ib.`AccountingPeriodEnd` >= ':Monat_Start' AND ib.`AccountingPeriodEnd` < ':Monat_End' and ib.IsActive = 1
ORDER BY p.`LastName`, p.`FirstName`, cb2sc.`ApprovedStartDate`, ii.GrossAmountTotal desc) AS sqry
-WHERE Team = ':teamname'
+WHERE Team like ':teamname%'
";
return sql;
diff --git a/ReportImp/MalteserJohanniterJohanneshaus/CustomReportCreator.cs b/ReportImp/MalteserJohanniterJohanneshaus/CustomReportCreator.cs
index f2ac0289f..f0b23144d 100644
--- a/ReportImp/MalteserJohanniterJohanneshaus/CustomReportCreator.cs
+++ b/ReportImp/MalteserJohanniterJohanneshaus/CustomReportCreator.cs
@@ -235,5 +235,56 @@ namespace MalteserJohanniterJohanneshaus
return report as XtraReport;
}
+
+ public override XtraReport CreateSettlementReportMitQB(String dcId, long? invoiceBaseOid)
+ {
+ // Override nur für CreateBelegeForSpitzabrechnung - CreateBelegeForInvoice ist in der Basis schreibgeschützt - Auswahl QBs mit nur FLS (Oid = 1)
+ XtraReport report = null;
+ String reportId = null;
+ var lSettlementDC = GetSettlementDC(dcId, invoiceBaseOid);
+
+ if (lSettlementDC.CostBearer2SupportConceptOid.HasValue)
+ {
+ CostBearer2SupportConcept c2s = DAOFactory.GenericDAO.LoadByID(lSettlementDC.CostBearer2SupportConceptOid.Value);
+ reportId = c2s.CostBearer.ID;
+ }
+
+ if (lSettlementDC.DifferentHourlyRateCount > 0)
+ {
+
+ IBeWoReport lSettlementReport = FindReportImp(reportId);
+ var ro = SettlementRO.Create(lSettlementDC);
+ lSettlementReport.SetReportDataSource(ro);
+
+ report = lSettlementReport as XtraReport;
+ }
+ else
+ {
+ IBeWoReport lSettlementReport = FindReportImp(reportId);
+ lSettlementReport.SetReportDataSource(Settlement2RO.Create(lSettlementDC));
+ report = lSettlementReport as XtraReport;
+ }
+
+ if (lSettlementDC.InvoiceBaseOid.HasValue)
+ {
+ var sb = DAOFactory.GenericDAO.LoadByID(lSettlementDC.InvoiceBaseOid.Value);
+ var qb = CreateBelegeForSpitzabrechnung(sb);
+
+ AddReportPagesToMaster(report, qb);
+ }
+ return report;
+ }
+
+ protected virtual XtraReport CreateBelegeForSpitzabrechnung(InvoiceBase invoiceBase)
+ {
+ if (invoiceBase.CostBearer2SupportConcept != null)
+ {
+ var customerOid = invoiceBase.CostBearer2SupportConcept.SupportConcept.Customer.Oid.Value;
+ //Auswahl QBs mit nur FLS(Oid = 1)
+ return CreateServiceOverviewReportNew(QBFilterEnum.KlientenAuswahl, customerOid, null, null, null, 1, invoiceBase.AccountingPeriodStart.Value, invoiceBase.AccountingPeriodEnd.Value, false);
+ }
+
+ return null;
+ }
}
}
diff --git a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/AnwesenheitenZeiterfassungRO.cs b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/AnwesenheitenZeiterfassungRO.cs
index aa67351f7..d384fa15b 100644
--- a/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/AnwesenheitenZeiterfassungRO.cs
+++ b/ReportImp/MalteserJohanniterJohanneshaus/Invoicing/AnwesenheitenZeiterfassungRO.cs
@@ -60,7 +60,7 @@ namespace MalteserJohanniterJohanneshaus.Invoicing
foreach (var c2s in hpsTsh)
{
var allRecords = DAOFactory.SearchDAO.FindServiceRecordsInSpan(c2s.Oid.Value, newSpan);
- var records = allRecords.Where(r => r.ServiceDescription.ServiceCategory.Name.Contains("LT23") || r.ServiceDescription.ServiceCategory.Name.Contains("LT24")).ToList();
+ var records = allRecords.Where(r => r.RoundedDuration > 0 && (r.ServiceDescription.ServiceCategory.Name.Contains("LT23") || r.ServiceDescription.ServiceCategory.Name.Contains("LT24"))).ToList();
var daysWithRecords = records.GroupBy(r => r.Start.Value.Date).Select(g => g.Key).ToList();
foreach (var d in daysWithRecords)
{
diff --git a/ReportImp/PariMobil/Reporting/CustomReportCreator.cs b/ReportImp/PariMobil/Reporting/CustomReportCreator.cs
index 5632a7617..c156797ef 100644
--- a/ReportImp/PariMobil/Reporting/CustomReportCreator.cs
+++ b/ReportImp/PariMobil/Reporting/CustomReportCreator.cs
@@ -85,6 +85,7 @@ namespace PariMobil.Reporting
public override XtraReport CreateSettlementReportMitQB(String dcId, long? invoiceBaseOid)
{
+ // Override nur für CreateBelegeForSpitzabrechnung - CreateBelegeForInvoice ist in der Basis schreibgeschützt - Auswahl QBs mit nur FLS (Oid = 1)
XtraReport report = null;
String reportId = null;
var lSettlementDC = GetSettlementDC(dcId, invoiceBaseOid);
@@ -126,6 +127,7 @@ namespace PariMobil.Reporting
if (invoiceBase.CostBearer2SupportConcept != null)
{
var customerOid = invoiceBase.CostBearer2SupportConcept.SupportConcept.Customer.Oid.Value;
+ //Auswahl QBs mit nur FLS(Oid = 1)
return CreateServiceOverviewReportNew(QBFilterEnum.KlientenAuswahl, customerOid, null, null, null, 1, invoiceBase.AccountingPeriodStart.Value, invoiceBase.AccountingPeriodEnd.Value, false);
}
diff --git a/Service/Plugins/AiFunctionService.cs b/Service/Plugins/AiFunctionService.cs
index 93b6d1c45..22389a96e 100644
--- a/Service/Plugins/AiFunctionService.cs
+++ b/Service/Plugins/AiFunctionService.cs
@@ -75,6 +75,9 @@ namespace BeWo.Service.Plugins
if (model == null)
throw new NotImplementedException();
+ if (user_prompt == null)
+ user_prompt = string.Empty;
+
var messages = new List()
{
system, user_prompt