Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo
This commit is contained in:
@@ -106,6 +106,7 @@
|
||||
<Compile Include="Converter\ComparisonConverter.cs" />
|
||||
<Compile Include="Converter\IconToImageSourceConverter.cs" />
|
||||
<Compile Include="Converter\NewlineConverter.cs" />
|
||||
<Compile Include="Converter\StringEmptyBoolConverter.cs" />
|
||||
<Compile Include="Core\BeWoAppVersion.cs" />
|
||||
<Compile Include="Core\Commands\CommandFactory.cs" />
|
||||
<Compile Include="Scheduling\View\AbsenceTimesCreationView.xaml.cs">
|
||||
@@ -155,6 +156,9 @@
|
||||
<Compile Include="View\Controls\AI\AiConversationButton.xaml.cs">
|
||||
<DependentUpon>AiConversationButton.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Controls\AI\AiPromptbausteinButton.xaml.cs">
|
||||
<DependentUpon>AiPromptbausteinButton.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Detail\AI\AiPromptbausteinActionResultView.xaml.cs">
|
||||
<DependentUpon>AiPromptbausteinActionResultView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -256,6 +260,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Controls\AI\AiPromptbausteinButton.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Detail\AI\AiPromptbausteinActionResultView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
<conv:AddressToStringConverter x:Key="AddressToStringConverter" />
|
||||
<conv:ComparisonConverter x:Key="ComparisonConverter" />
|
||||
<conv:IconToImageSourceConverter x:Key="IconToImageSourceConverter" />
|
||||
<conv:StringEmptyBoolConverter x:Key="StringEmptyBoolConverter" />
|
||||
|
||||
<conv:ValidationConverter x:Key="ValidationConverter" />
|
||||
<conv:ValueConverterGroup x:Key="Validation2BrushConverter">
|
||||
|
||||
28
BeWo/Converter/StringEmptyBoolConverter.cs
Normal file
28
BeWo/Converter/StringEmptyBoolConverter.cs
Normal file
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
@@ -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];
|
||||
|
||||
60
BeWo/View/Controls/AI/AiPromptbausteinButton.xaml
Normal file
60
BeWo/View/Controls/AI/AiPromptbausteinButton.xaml
Normal file
@@ -0,0 +1,60 @@
|
||||
<UserControl
|
||||
x:Class="BeWo.View.Controls.AI.AiPromptbausteinButton"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:draw="clr-namespace:System.Drawing;assembly=System.Drawing"
|
||||
xmlns:local="clr-namespace:BeWo.View.Controls.AI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ai="clr-namespace:BeWo.View.Detail.AI"
|
||||
x:Name="root"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<StackPanel
|
||||
Margin="0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</StackPanel.Resources>
|
||||
<Button
|
||||
x:Name="btnOpenAi5"
|
||||
Margin="3"
|
||||
Click="btnOpenAi5_Click"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
Content="{StaticResource AiDesignsIconKIFunktionWeissGruen}"
|
||||
MouseRightButtonUp="btnOpenAi5_MouseRightButtonUp"
|
||||
ToolTip="KI Chat mit Prompt-Baustein starten"
|
||||
ToolTipService.ShowOnDisabled="True">
|
||||
<!--<Button.InputBindings>
|
||||
<MouseBinding Command="{Binding AiPromptOpenFavoriteCommand, ElementName=root}" Gesture="RightClick" />
|
||||
<MouseBinding Command="{Binding AiPromptOpenAllCommand, ElementName=root}" Gesture="LeftClick" />
|
||||
</Button.InputBindings>-->
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Popup
|
||||
x:Name="popup_promptbaustein_all"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False"
|
||||
Width="600"
|
||||
Height="400">
|
||||
<Border BorderThickness="1" x:Name="border_promptbaustein_al">
|
||||
|
||||
</Border>
|
||||
</Popup>
|
||||
<Popup
|
||||
x:Name="popup_promptbaustein_favoriten"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False">
|
||||
<Border BorderThickness="1" x:Name="border_promptbaustein_favoriten">
|
||||
|
||||
</Border>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
183
BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs
Normal file
183
BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs
Normal file
@@ -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
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interaktionslogik für AiPromptbausteinButton.xaml
|
||||
/// </summary>
|
||||
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<AiPromptbausteinPromptVM> 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<AiPromptbausteinFolderDC> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,9 +74,9 @@
|
||||
<dxe:ListBoxEdit
|
||||
x:Name="listBoxEdit1"
|
||||
Padding="4,16,4,16"
|
||||
EditValue="{Binding SelectedPrompt, Mode=TwoWay}"
|
||||
ItemContainerStyle="{StaticResource PromptListBoxItem}"
|
||||
ItemsSource="{Binding SelectedFolder.Prompts, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelectedPrompt, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<dxe:ListBoxEdit.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -1718,12 +1718,11 @@
|
||||
Style="{StaticResource ButtonRedoStyle}"
|
||||
Visibility="{Binding IsRedoButtonVisible, Converter={StaticResource BoolVisibilityHiddenConverter}}" />
|
||||
|
||||
<Button
|
||||
x:Name="btn_AiPromptbaustein"
|
||||
Padding="0"
|
||||
Command="{Binding OpenAiPromptSelectionCommand}"
|
||||
Content="{StaticResource AiDesignsIconKIFunktionWeissGruen}"
|
||||
Style="{StaticResource PrimaryButton}" />
|
||||
<ai:AiPromptbausteinButton
|
||||
x:Name="btn_AiPromptbaustein2"
|
||||
ActionType="ServiceRecordDocumentation"
|
||||
CanExecute="{Binding PrototypeVM.Notice, Converter={StaticResource StringEmptyBoolConverter}}"
|
||||
PromptAccepted="btn_AiPromptbaustein2_PromptAccepted" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
@@ -3328,8 +3327,8 @@
|
||||
Margin="10,0,0,0"
|
||||
ActionType="ServiceRecordConversation"
|
||||
OpenAiWindowClick="AiConversationButton_OpenAiWindowClick"
|
||||
State="{Binding AiConversationButtonState}"
|
||||
PromptAccepted="PromptAccepted"/>
|
||||
PromptAccepted="PromptAccepted"
|
||||
State="{Binding AiConversationButtonState}" />
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Column="2"
|
||||
|
||||
@@ -5100,15 +5100,15 @@ namespace BeWo.View.Detail.Zeiterfassung
|
||||
MainControl.WindowService.ShowAiConversationWindow(getAiConversationChatViewModel());
|
||||
}
|
||||
|
||||
private void PromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
|
||||
{
|
||||
if (prompt is null)
|
||||
throw new NotImplementedException();
|
||||
private void PromptAccepted(object sender, AiPromptbausteinPromptVM prompt)
|
||||
{
|
||||
if (prompt is null)
|
||||
throw new NotImplementedException();
|
||||
|
||||
// 1. Information aufbereiten
|
||||
// 1.1 Prompt
|
||||
var prompt_oid = prompt.DataContract.Oid.Value;
|
||||
var prompt_version = prompt.DataContract.Version;
|
||||
// 1. Information aufbereiten
|
||||
// 1.1 Prompt
|
||||
var prompt_oid = prompt.DataContract.Oid.Value;
|
||||
var prompt_version = prompt.DataContract.Version;
|
||||
|
||||
// 1.2 Restliche Informationen
|
||||
var vm = getAiConversationChatViewModel();
|
||||
@@ -5117,12 +5117,12 @@ namespace BeWo.View.Detail.Zeiterfassung
|
||||
|
||||
// 3 Auswerten
|
||||
vm.MessageInput = prompt.Prompt;
|
||||
vm.SendAfterLoaded = true;
|
||||
vm.SendAfterLoaded = true;
|
||||
|
||||
MainControl.WindowService.ShowAiConversationWindow(vm);
|
||||
}
|
||||
MainControl.WindowService.ShowAiConversationWindow(vm);
|
||||
}
|
||||
|
||||
private IEnumerable<ServiceRecordVM> GetVisibleRecordVMs()
|
||||
private IEnumerable<ServiceRecordVM> GetVisibleRecordVMs()
|
||||
{
|
||||
var list = new List<ServiceRecordVM>();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<string> _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<string>();
|
||||
_EditAiActionHistory.Add(AktuellerEditDokutext);
|
||||
_EditAiActionHistoryIndex = 0;
|
||||
BeWoApp.MainControl.WindowService.Show(vm_edit_doku);
|
||||
},
|
||||
null,
|
||||
() => !string.IsNullOrWhiteSpace(AktuellerEditDokutext));
|
||||
//OpenEditAiPromptSelectionCommand = CommandFactory.GetAiViewCommand(() =>
|
||||
//{
|
||||
// _EditAiActionHistory = new List<string>();
|
||||
// _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();
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
public event EventHandler<AiPromptbausteinPromptVM> 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);
|
||||
|
||||
@@ -116,6 +116,7 @@
|
||||
<Compile Include="SbdRechnung2024.designer.cs">
|
||||
<DependentUpon>SbdRechnung2024.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Service\CustomTranslationDictionary.cs" />
|
||||
<Compile Include="StatusCheckAbrechnung.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -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<String, String> GetTranslationDictionary()
|
||||
{
|
||||
var dict = base.GetTranslationDictionary();
|
||||
AddOrReplaceTranslation(dict, "CustomerVarFieldsTitle", "Planungsdetails");
|
||||
return dict;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
</Compile>
|
||||
<Compile Include="Calculations\DefaultCalculations.cs" />
|
||||
<Compile Include="Calculations\CustomGroupDurationCalculator.cs" />
|
||||
<Compile Include="Import\CustomDataImporter.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceCreation.cs" />
|
||||
<Compile Include="Invoicing\CustomInvoiceFactory.cs" />
|
||||
<Compile Include="Invoicing\CustomLWLDiggaBerechnung.cs" />
|
||||
@@ -139,7 +140,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Export\" />
|
||||
<Folder Include="Import\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
|
||||
155
ReportImp/IBAHSeV/Import/CustomDataImporter.cs
Normal file
155
ReportImp/IBAHSeV/Import/CustomDataImporter.cs
Normal file
@@ -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<Avis> LeseEinzelAviseLWL(string importfile)
|
||||
{
|
||||
List<Avis> liste = new List<Avis>();
|
||||
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<HilfeplanInfo> CreateHilfeplanInfos()
|
||||
{
|
||||
List<HilfeplanInfo> liste = new List<HilfeplanInfo>();
|
||||
var scList = DAOFactory.GenericDAO.GetAllActiveAndArchived<SupportConcept>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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<CostBearer2SupportConcept>(lSettlementDC.CostBearer2SupportConceptOid.Value);
|
||||
reportId = c2s.CostBearer.ID;
|
||||
}
|
||||
|
||||
if (lSettlementDC.DifferentHourlyRateCount > 0)
|
||||
{
|
||||
|
||||
IBeWoReport<SettlementRO> lSettlementReport = FindReportImp<SettlementRO>(reportId);
|
||||
var ro = SettlementRO.Create(lSettlementDC);
|
||||
lSettlementReport.SetReportDataSource(ro);
|
||||
|
||||
report = lSettlementReport as XtraReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
IBeWoReport<Settlement2RO> lSettlementReport = FindReportImp<Settlement2RO>(reportId);
|
||||
lSettlementReport.SetReportDataSource(Settlement2RO.Create(lSettlementDC));
|
||||
report = lSettlementReport as XtraReport;
|
||||
}
|
||||
|
||||
if (lSettlementDC.InvoiceBaseOid.HasValue)
|
||||
{
|
||||
var sb = DAOFactory.GenericDAO.LoadByID<InvoiceBase>(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<string>()
|
||||
{
|
||||
system, user_prompt
|
||||
|
||||
Reference in New Issue
Block a user