- Ungültige Customer vorher erkennen

- IsEnabled geht nicht, man braucht IsEnabledBinding https://supportcenter.devexpress.com/ticket/details/t1010082/gridcolumn-isenabled-false-has-no-effect
This commit is contained in:
2024-10-17 15:54:06 +02:00
parent bd66cb9795
commit 8d4802b3a2
14 changed files with 1557 additions and 1319 deletions

View File

@@ -994,6 +994,7 @@
<Compile Include="Converter\Rights2DefaultBooleanConverter.cs" />
<Compile Include="Converter\StringLengthVisibilityConverter.cs" />
<Compile Include="Converter\StringLengthVisibilityMultiConverter.cs" />
<Compile Include="Converter\TooltipTextConverter.cs" />
<Compile Include="Converter\UserRightType2BoolConverter.cs" />
<Compile Include="Converter\ValueConverterGroup.cs" />
<Compile Include="Core\AutoLockUI.cs" />

View File

@@ -95,6 +95,7 @@
<conv:AppSettingsConverter />
<conv:BoolVisibilityCollapsedConverter />
</conv:ValueConverterGroup>
<conv:TooltipTextConverter x:Key="TooltipTextConverter" />
<Style x:Key="SupportConceptDetailStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorLevel=1, AncestorType={x:Type ItemsControl}, Mode=FindAncestor}}" />

View File

@@ -1,4 +1,5 @@
using System;
using BeWo.ViewModel;
using System;
using System.Globalization;
using System.Windows.Data;
@@ -8,7 +9,15 @@ namespace BeWo.Converter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
if (value is null)
return null;
if (value is InvoiceBaseVM invoice)
{
return invoice.IsGkvValidError;
}
return "Test";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View File

@@ -0,0 +1,29 @@
using BeWo.ViewModel;
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 TooltipTextConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is InvoiceBaseVM invoice)
{
return invoice.IsGkvValidError;
}
return "xxx";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -290,7 +290,7 @@
AllowEditing="False"
FieldName="IsPaid"
Header="Bezahlt"
IsEnabled="False" />
IsEnabledBinding="{Binding Source=false}" />
</dxg:GridControl.Columns>
<dxg:GridControl.View>
<dxg:TableView
@@ -405,7 +405,7 @@
AllowEditing="False"
FieldName="SentSuccess"
Header="Dakota Übertragen"
IsEnabled="False" />
IsEnabledBinding="{Binding Source=false}" />
<dxg:GridColumn
AllowEditing="False"
FieldName="Fehlertitel"

View File

@@ -1,26 +1,48 @@
<localView:BeWoView x:Class="BeWo.View.Detail.Accounting.NewGkvAbrechnungPopUpView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View"
xmlns:localViewModel="clr-namespace:BeWo.ViewModel" xmlns:localViewDetail="clr-namespace:BeWo.View.Detail.Accounting"
xmlns:val="clr-namespace:BeWo.Validation" xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" Height="Auto" Width="Auto"
HorizontalAlignment="Stretch" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:r="clr-namespace:BeWo.Security"
VerticalAlignment="Stretch" Focusable="True"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" xmlns:localSearchView="clr-namespace:BeWo.View.Search">
<localView:BeWoView
x:Class="BeWo.View.Detail.Accounting.NewGkvAbrechnungPopUpView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:localSearchView="clr-namespace:BeWo.View.Search"
xmlns:localView="clr-namespace:BeWo.View"
xmlns:localViewDetail="clr-namespace:BeWo.View.Detail.Accounting"
xmlns:localViewModel="clr-namespace:BeWo.ViewModel"
xmlns:markup="clr-namespace:BeWo.MultiLanguage.Markup"
xmlns:r="clr-namespace:BeWo.Security"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
xmlns:val="clr-namespace:BeWo.Validation"
Width="Auto"
Height="Auto"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True">
<GroupBox Width="1100" Style="{StaticResource PopUpWindowStyle}">
<GroupBox.Header>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0,0,0,0">
<Image Source="..\..\..\Ressources\Icons\CoinsDisabled.png" Height="28" />
<TextBox Margin="10,4,0,0" Background="{x:Null}" Foreground="{DynamicResource MainGroupBoxForegroundBrush}"
FontSize="20" BorderBrush="{x:Null}" VerticalAlignment="Stretch" BorderThickness="0,0,0,0"
Padding="0,0,0,0" />
<StackPanel
Margin="0,0,0,0"
VerticalAlignment="Center"
Orientation="Horizontal">
<Image Height="28" Source="..\..\..\Ressources\Icons\CoinsDisabled.png" />
<TextBox
Margin="10,4,0,0"
Padding="0,0,0,0"
VerticalAlignment="Stretch"
Background="{x:Null}"
BorderBrush="{x:Null}"
BorderThickness="0,0,0,0"
FontSize="20"
Foreground="{DynamicResource MainGroupBoxForegroundBrush}" />
</StackPanel>
</GroupBox.Header>
<Grid Background="{StaticResource ObjectEditBackgroundBrush}">
<GroupBox Margin="10" Header="GKV-Abrechnung erstellen" Style="{StaticResource ObjectEditGroupBox}">
<GroupBox
Margin="10"
Header="GKV-Abrechnung erstellen"
Style="{StaticResource ObjectEditGroupBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@@ -52,68 +74,207 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="Rechnungszeitraum von" Grid.Row="0" Grid.Column="0" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" BorderThickness="1" Height="23" Margin="3" Grid.Row="0" Grid.Column="1" EditValue="{val:ValidationBinding Path=AbrechnungsZeitraumStart}" EditValueChanged="DateEdit_EditValueChanged"/>
<Label Content="Rechnungszeitraum bis" Grid.Row="1" Grid.Column="0" />
<dxe:DateEdit MaskType="DateTimeAdvancingCaret" BorderThickness="1" Height="23" Margin="3" Grid.Row="1" Grid.Column="1" EditValue="{val:ValidationBinding Path=AbrechnungsZeitraumEnde}" EditValueChanged="DateEdit2_EditValueChanged"/>
<Label
Grid.Row="0"
Grid.Column="0"
Content="Rechnungszeitraum von" />
<dxe:DateEdit
Grid.Row="0"
Grid.Column="1"
Height="23"
Margin="3"
BorderThickness="1"
EditValue="{val:ValidationBinding Path=AbrechnungsZeitraumStart}"
EditValueChanged="DateEdit_EditValueChanged"
MaskType="DateTimeAdvancingCaret" />
<Label
Grid.Row="1"
Grid.Column="0"
Content="Rechnungszeitraum bis" />
<dxe:DateEdit
Grid.Row="1"
Grid.Column="1"
Height="23"
Margin="3"
BorderThickness="1"
EditValue="{val:ValidationBinding Path=AbrechnungsZeitraumEnde}"
EditValueChanged="DateEdit2_EditValueChanged"
MaskType="DateTimeAdvancingCaret" />
<!--<Label Content="Annahmestelle" Grid.Row="0" Grid.Column="2" />
<uc:PopUpEdit IsReadOnly="True"
x:Name="popupedit_DatenannahmestelleSearch"
Grid.Column="3" Margin="3" Height="23" Grid.Row="0"
DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_DatenannahmestelleSearch_PopUpClick" />-->
<Label Content="Organisation" Grid.Row="0" Grid.Column="2" />
<uc:PopUpEdit IsReadOnly="True"
x:Name="popupedit_GkvSearch"
Grid.Column="3" Margin="3" Height="23" Grid.Row="0"
DeleteButtonVisibility="Collapsed"
PopUpClick="popupedit_GkvSearch_PopUpClick" />
<Label Content="Bemerkung" Grid.Row="0" Grid.Column="4" />
<TextBox Grid.Row="0" Grid.Column="5" Grid.RowSpan="2" Margin="3" AcceptsReturn="True" TextWrapping="Wrap" Height="50" Text="{Binding Notice}" />
<Label
Grid.Row="0"
Grid.Column="2"
Content="Organisation" />
<uc:PopUpEdit
x:Name="popupedit_GkvSearch"
Grid.Row="0"
Grid.Column="3"
Height="23"
Margin="3"
DeleteButtonVisibility="Collapsed"
IsReadOnly="True"
PopUpClick="popupedit_GkvSearch_PopUpClick" />
<Label
Grid.Row="0"
Grid.Column="4"
Content="Bemerkung" />
<TextBox
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="5"
Height="50"
Margin="3"
AcceptsReturn="True"
Text="{Binding Notice}"
TextWrapping="Wrap" />
</Grid>
<dxg:GridControl x:Name="grid_newInvoices" DataSource="{Binding InvoiceBases}" Margin="3" Grid.Row="1" Grid.ColumnSpan="2" MinHeight="200">
<dxg:GridControl
x:Name="grid_newInvoices"
Grid.Row="1"
Grid.ColumnSpan="2"
MinHeight="200"
Margin="3"
DataSource="{Binding InvoiceBases}">
<dxg:GridControl.Columns>
<dxg:GridColumn x:Name="ColumnChecked" FieldName="IsChecked" Header=" " MinWidth="30"></dxg:GridColumn>
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="TypeString" Header="Art der Rechnung" Width="150" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="InvoiceNumber" Header="Nummer" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="InvoiceDate" Header="Datum" EditSettings="{dxe:DateSettings DisplayFormat=d}" MinWidth="70" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="CustomerName" Header="{markup:Translate Klient/in}" Width="100" />
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="AccountingPeriodString" SortFieldName="AccountingPeriodStart" Header="Zeitraum" Width="100" />
<dxg:GridColumn
x:Name="ColumnChecked"
MinWidth="30"
CellToolTipBinding="{Binding Converter={StaticResource TooltipTextConverter}}"
FieldName="IsChecked"
Header=" "
IsEnabledBinding="{Binding IsGkvValid}">
<dxg:GridColumn.CellStyle>
<Style TargetType="{x:Type dxg:LightweightCellEditor}">
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
</Style>
</dxg:GridColumn.CellStyle>
</dxg:GridColumn>
<dxg:GridColumn
Width="150"
AllowEditing="False"
FieldName="TypeString"
Header="Art der Rechnung"
ReadOnly="True" />
<dxg:GridColumn
AllowEditing="False"
FieldName="InvoiceNumber"
Header="Nummer"
ReadOnly="True" />
<dxg:GridColumn
MinWidth="70"
AllowEditing="False"
EditSettings="{dxe:DateSettings DisplayFormat=d}"
FieldName="InvoiceDate"
Header="Datum"
ReadOnly="True" />
<dxg:GridColumn
Width="100"
AllowEditing="False"
FieldName="CustomerName"
Header="{markup:Translate Klient/in}"
ReadOnly="True" />
<dxg:GridColumn
Width="100"
AllowEditing="False"
FieldName="AccountingPeriodString"
Header="Zeitraum"
ReadOnly="True"
SortFieldName="AccountingPeriodStart" />
<!--<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="RecipientString" Header="{markup:Translate EmpfängerSingular}" />-->
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="TotalAmount" Header="Betrag" MinWidth="70">
<dxg:GridColumn
MinWidth="70"
AllowEditing="False"
FieldName="TotalAmount"
Header="Betrag"
ReadOnly="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings DisplayFormat="c" Mask="c" MaskType="Numeric"></dxe:TextEditSettings>
<dxe:TextEditSettings
DisplayFormat="c"
Mask="c"
MaskType="Numeric" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn ReadOnly="True" AllowEditing="False" FieldName="Notice" Header="Bemerkung" MinWidth="200" >
<dxg:GridColumn
MinWidth="200"
AllowEditing="False"
FieldName="Notice"
Header="Bemerkung"
ReadOnly="True">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings TextWrapping="Wrap" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn x:Name="PaidColumn" FieldName="IsPaid" Header="Bezahlt" ReadOnly="True"></dxg:GridColumn>
<dxg:GridColumn
x:Name="PaidColumn"
FieldName="IsPaid"
Header="Bezahlt"
IsEnabledBinding="{Binding Source=false}" />
</dxg:GridControl.Columns>
<dxg:GridControl.View >
<dxg:TableView x:Name="gridView" ShowGroupPanel="False" CellValueChanging="TableView_CellValueChanging"/>
<dxg:GridControl.View>
<dxg:TableView
x:Name="gridView"
CellValueChanging="TableView_CellValueChanging"
ShowGroupPanel="False" />
</dxg:GridControl.View>
</dxg:GridControl>
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2">
<Button Margin="10 3 0 0"
Name="button_checkAllLeistungen" Click="button_checkAll_Click"
HorizontalAlignment="Left">Alle auswählen</Button>
<Button Margin="10 3 0 0"
Name="button_uncheckAllLeistungen" Click="button_uncheckAll_Click"
HorizontalAlignment="Left">Alle abwählen</Button>
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Left"
Orientation="Horizontal">
<Button
Name="button_checkAllLeistungen"
Margin="10,3,0,0"
HorizontalAlignment="Left"
Click="button_checkAll_Click">
Alle auswählen
</Button>
<Button
Name="button_uncheckAllLeistungen"
Margin="10,3,0,0"
HorizontalAlignment="Left"
Click="button_uncheckAll_Click">
Alle abwählen
</Button>
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2">
<Button Content="Erstellen" x:Name="btn_create" Click="btn_create_Click" Padding="5 0" Margin="3" />
<Button Content="Abbrechen" x:Name="btn_cancel" Click="btn_cancel_Click" Margin="3" Padding="5 0" />
<StackPanel
Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button
x:Name="btn_create"
Margin="3"
Padding="5,0"
Click="btn_create_Click"
Content="Erstellen" />
<Button
x:Name="btn_cancel"
Margin="3"
Padding="5,0"
Click="btn_cancel_Click"
Content="Abbrechen" />
</StackPanel>
</Grid>
</GroupBox>
<Popup Margin="10" x:Name="popup_organisation" StaysOpen="False" Placement="MousePoint" Width="370" Height="250" Closed="popup_Closed" Opened="popup_Opened">
<localSearchView:OrganisationSearchView SearchMode="All" x:Name="gkvsearchview" />
<Popup
x:Name="popup_organisation"
Width="370"
Height="250"
Margin="10"
Closed="popup_Closed"
Opened="popup_Opened"
Placement="MousePoint"
StaysOpen="False">
<localSearchView:OrganisationSearchView x:Name="gkvsearchview" SearchMode="All" />
</Popup>
</Grid>
</GroupBox>

View File

@@ -16,268 +16,271 @@ using DevExpress.Xpf.Grid;
namespace BeWo.View.Detail.Accounting
{
public partial class NewGkvAbrechnungPopUpView : BeWoView
{
private long? _LoadedInvoiceBaseOid;
public partial class NewGkvAbrechnungPopUpView : BeWoView
{
private long? _LoadedInvoiceBaseOid;
private List<InvoiceBaseDC> _InvoiceBaseDCs;
private List<InvoiceBaseDC> _InvoiceBaseDCs;
private List<string> _InvoiceNumbers;
private List<string> _InvoiceNumbers;
private GkvAbrechnungVM _Viewmodel;
private GkvAbrechnungVM _Viewmodel;
public event EventHandler<EventArgs<GkvAbrechnungDC>> CreateButtonClicked;
public event EventHandler<EventArgs<GkvAbrechnungDC>> CreateButtonClicked;
public event EventHandler CancelButtonClicked;
public event EventHandler CancelButtonClicked;
public NewGkvAbrechnungPopUpView()
{
this.InitializeComponent();
public NewGkvAbrechnungPopUpView()
{
this.InitializeComponent();
this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close,
(s, e) =>
{
this._InvoiceBaseDCs?.Clear();
if (CancelButtonClicked != null)
CancelButtonClicked.Invoke(s, e);
}));
this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close,
(s, e) =>
{
this._InvoiceBaseDCs?.Clear();
if (CancelButtonClicked != null)
CancelButtonClicked.Invoke(s, e);
}));
this.grid_newInvoices.View.Loaded += (s, e) => ((TableView)this.grid_newInvoices.View).BestFitColumns();
}
this.grid_newInvoices.View.Loaded += (s, e) => ((TableView)this.grid_newInvoices.View).BestFitColumns();
}
public GkvAbrechnungVM ViewModel
{
get
{
return this._Viewmodel;
}
public GkvAbrechnungVM ViewModel
{
get
{
return this._Viewmodel;
}
set
{
this.DataContext = value;
this._Viewmodel = value;
}
}
set
{
this.DataContext = value;
this._Viewmodel = value;
}
}
public DateTime FilterStart
{
get => ViewModel.AbrechnungsZeitraumStart.Value;
set => ViewModel.AbrechnungsZeitraumStart = value;
}
public DateTime FilterEnde
{
get => ViewModel.AbrechnungsZeitraumEnde.Value;
set => ViewModel.AbrechnungsZeitraumEnde = value;
}
public DateTime FilterStart
{
get => ViewModel.AbrechnungsZeitraumStart.Value;
set => ViewModel.AbrechnungsZeitraumStart = value;
}
public DateTime FilterEnde
{
get => ViewModel.AbrechnungsZeitraumEnde.Value;
set => ViewModel.AbrechnungsZeitraumEnde = value;
}
public List<InvoiceBaseDC> InvoiceBaseDcs
{
set
{
this._InvoiceNumbers = value.Select(i => i.InvoiceNumber).ToList();
this._InvoiceBaseDCs = new List<InvoiceBaseDC>(value);
this.grid_newInvoices.ItemsSource = this._InvoiceBaseDCs;
}
}
public List<InvoiceBaseDC> InvoiceBaseDcs
{
set
{
this._InvoiceNumbers = value.Select(i => i.InvoiceNumber).ToList();
this._InvoiceBaseDCs = new List<InvoiceBaseDC>(value);
this.grid_newInvoices.ItemsSource = this._InvoiceBaseDCs;
}
}
private void Fire()
{
if (this.CreateButtonClicked != null)
{
if (_InvoiceBaseDCs == null)
_InvoiceBaseDCs = new List<InvoiceBaseDC>();
private void Fire()
{
if (this.CreateButtonClicked != null)
{
if (_InvoiceBaseDCs == null)
_InvoiceBaseDCs = new List<InvoiceBaseDC>();
for (int i = 0; i < _InvoiceBaseDCs.Count; i++)
{
_InvoiceBaseDCs[i].InvoiceNumber = this._InvoiceNumbers[i];
}
for (int i = 0; i < _InvoiceBaseDCs.Count; i++)
{
_InvoiceBaseDCs[i].InvoiceNumber = this._InvoiceNumbers[i];
}
var gkvAbrechnung = ViewModel.CommitToDataContract();
var gkvAbrechnung = ViewModel.CommitToDataContract();
this.CreateButtonClicked(this, new EventArgs<GkvAbrechnungDC>(gkvAbrechnung));
}
}
public void Clear()
{
_LoadedInvoiceBaseOid = null;
popupedit_GkvSearch.Text = string.Empty;
popupedit_GkvSearch.Focus();
}
this.CreateButtonClicked(this, new EventArgs<GkvAbrechnungDC>(gkvAbrechnung));
}
}
public void Clear()
{
_LoadedInvoiceBaseOid = null;
popupedit_GkvSearch.Text = string.Empty;
popupedit_GkvSearch.Focus();
}
private void btn_cancel_Click(object sender, RoutedEventArgs e)
{
if (ViewModel.InvoiceBases != null)
ViewModel.InvoiceBases.Clear();
this.CancelButtonClicked(this, e);
}
private void btn_create_Click(object sender, RoutedEventArgs e)
{
this.Fire();
}
private void btn_cancel_Click(object sender, RoutedEventArgs e)
{
if (ViewModel.InvoiceBases != null)
ViewModel.InvoiceBases.Clear();
this.CancelButtonClicked(this, e);
}
private void btn_create_Click(object sender, RoutedEventArgs e)
{
this.Fire();
}
private void TableView_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
var si = e.Row as InvoiceBaseDC;
if (e.Column.FieldName.Contains("NeuErstellen") && ((bool)e.Value))
{
if (si.DiffErstellen)
{
si.DiffErstellen = false;
grid_newInvoices.RefreshData();
}
}
else if (e.Column.FieldName.Contains("DiffErstellen") && ((bool)e.Value))
{
if (si.NeuErstellen)
{
si.NeuErstellen = false;
grid_newInvoices.RefreshData();
}
}
}
private void popupedit_GkvSearch_PopUpClick(object sender, RoutedEventArgs e)
{
gkvsearchview.ItemSelected += gkvsearchview_OrganisationSelected;
popup_organisation.IsOpen = true;
}
private void gkvsearchview_OrganisationSelected(object sender, EventArgs<CompactOrganisationDC> e)
{
popup_organisation.IsOpen = false;
gkvsearchview.ItemSelected -= gkvsearchview_OrganisationSelected;
private void TableView_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
var si = e.Row as InvoiceBaseDC;
if (e.Column.FieldName.Contains("NeuErstellen") && ((bool)e.Value))
{
if (si.DiffErstellen)
{
si.DiffErstellen = false;
grid_newInvoices.RefreshData();
}
}
else if (e.Column.FieldName.Contains("DiffErstellen") && ((bool)e.Value))
{
if (si.NeuErstellen)
{
si.NeuErstellen = false;
grid_newInvoices.RefreshData();
}
}
}
popupedit_GkvSearch.Text = e.Data.ToString();
popupedit_GkvSearch.Focus();
private void popupedit_GkvSearch_PopUpClick(object sender, RoutedEventArgs e)
{
gkvsearchview.ItemSelected += gkvsearchview_OrganisationSelected;
popup_organisation.IsOpen = true;
}
private void gkvsearchview_OrganisationSelected(object sender, EventArgs<CompactOrganisationDC> e)
{
popup_organisation.IsOpen = false;
gkvsearchview.ItemSelected -= gkvsearchview_OrganisationSelected;
RefreshInvoiceBases(e.Data.OrganisationOid);
}
popupedit_GkvSearch.Text = e.Data.ToString();
popupedit_GkvSearch.Focus();
private void RefreshInvoiceBases() => RefreshInvoiceBases(_LoadedInvoiceBaseOid);
private void RefreshInvoiceBases(DateTime? start, DateTime? ende) => RefreshInvoiceBases(_LoadedInvoiceBaseOid, start ?? FilterStart, ende ?? FilterEnde);
private void RefreshInvoiceBases(long? costOid) => RefreshInvoiceBases(costOid, FilterStart, FilterEnde);
private void RefreshInvoiceBases(long? costOid, DateTime? start, DateTime? ende)
{
if (costOid != null && start != null && ende != null && ende >= start)
{
_LoadedInvoiceBaseOid = costOid;
RefreshInvoiceBases(e.Data.OrganisationOid);
}
ServiceFacade.DoAccountingServiceAsync(s => s.GetInvoiceBasesForCostBearerAndId(start, ende, (long)costOid, "RechnungSoziotherapie"), UpdateInvoiceList);
}
}
private void RefreshInvoiceBases() => RefreshInvoiceBases(_LoadedInvoiceBaseOid);
private void RefreshInvoiceBases(DateTime? start, DateTime? ende) => RefreshInvoiceBases(_LoadedInvoiceBaseOid, start ?? FilterStart, ende ?? FilterEnde);
private void RefreshInvoiceBases(long? costOid) => RefreshInvoiceBases(costOid, FilterStart, FilterEnde);
private void RefreshInvoiceBases(long? costOid, DateTime? start, DateTime? ende)
{
if (costOid != null && start != null && ende != null && ende >= start)
{
_LoadedInvoiceBaseOid = costOid;
private void UpdateInvoiceList(IList<InvoiceBaseDC> dcList)
{
this.Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
(Action)delegate
{
BindingList <InvoiceBaseVM> invoiceBaseVMs = new BindingList<InvoiceBaseVM>();
foreach (var invoiceBaseDC in dcList)
{
InvoiceBaseVM invoiceBaseVM = new InvoiceBaseVM(invoiceBaseDC);
invoiceBaseVM.IsChecked = false;
invoiceBaseVMs.Add(invoiceBaseVM);
}
ViewModel.InvoiceBases = invoiceBaseVMs;
grid_newInvoices.ItemsSource = ViewModel.InvoiceBases;
this.gridView.BestFitColumns();
});
}
ServiceFacade.DoAccountingServiceAsync(s => s.GetInvoiceBasesForCostBearerAndId(start, ende, (long)costOid, "RechnungSoziotherapie"), UpdateInvoiceList);
}
}
private void popupedit_DatenannahmestelleSearch_PopUpClick(object sender, RoutedEventArgs e)
{
// tbd
}
private void UpdateInvoiceList(IList<InvoiceBaseDC> dcList)
{
this.Dispatcher.BeginInvoke(
DispatcherPriority.Normal,
(Action)delegate
{
BindingList<InvoiceBaseVM> invoiceBaseVMs = new BindingList<InvoiceBaseVM>();
foreach (var invoiceBaseDC in dcList)
{
InvoiceBaseVM invoiceBaseVM = new InvoiceBaseVM(invoiceBaseDC);
invoiceBaseVM.IsChecked = false;
invoiceBaseVMs.Add(invoiceBaseVM);
}
ViewModel.InvoiceBases = invoiceBaseVMs;
grid_newInvoices.ItemsSource = ViewModel.InvoiceBases;
this.gridView.BestFitColumns();
});
}
private void button_checkAll_Click(object sender, RoutedEventArgs e)
{
var visible = GetVisibleVMs();
foreach (var item in visible)
{
item.IsChecked = true;
}
}
private void button_uncheckAll_Click(object sender, RoutedEventArgs e)
{
var visible = GetVisibleVMs();
foreach (var item in visible)
{
item.IsChecked = false;
}
}
private void popupedit_DatenannahmestelleSearch_PopUpClick(object sender, RoutedEventArgs e)
{
// tbd
}
private void button_checkAll_Click(object sender, RoutedEventArgs e)
{
var visible = GetVisibleAndValidVMs();
foreach (var item in visible)
{
item.IsChecked = true;
}
}
private void button_uncheckAll_Click(object sender, RoutedEventArgs e)
{
var visible = GetVisibleAndValidVMs();
foreach (var item in visible)
{
item.IsChecked = false;
}
}
private IList<InvoiceBaseVM> GetVisibleVMs()
{
var list = new List<InvoiceBaseVM>();
private IList<InvoiceBaseVM> GetVisibleAndValidVMs()
{
var list = new List<InvoiceBaseVM>();
var items = grid_newInvoices.ItemsSource as IList<InvoiceBaseVM>;
var items = grid_newInvoices.ItemsSource as IList<InvoiceBaseVM>;
if (items != null)
{
for (int i = 0; i < items.Count; i++)
{
if (grid_newInvoices.IsRowVisible(i))
{
var vm = grid_newInvoices.GetRow(i) as InvoiceBaseVM;
if (vm != null)
{
list.Add(vm);
}
}
}
}
if (items is null)
return list;
return list;
}
for (int i = 0; i < items.Count; i++)
{
if (!grid_newInvoices.IsRowVisible(i))
continue;
private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
if (_Viewmodel is null)
return;
var vm = grid_newInvoices.GetRow(i) as InvoiceBaseVM;
if (vm is null)
continue;
if (FilterStart == (DateTime)e.NewValue)
return;
if (!vm.IsGkvValid)
continue;
// Von
FilterStart = (DateTime)e.NewValue;
list.Add(vm);
}
if(FilterEnde < FilterStart)
{
FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
}
return list;
}
if(FilterEnde.Year != FilterStart.Year)
{
FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
}
private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
if (_Viewmodel is null)
return;
RefreshInvoiceBases();
}
if (FilterStart == (DateTime)e.NewValue)
return;
private void DateEdit2_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
if (_Viewmodel is null)
return;
// Von
FilterStart = (DateTime)e.NewValue;
if (FilterEnde == (DateTime)e.NewValue)
return;
if (FilterEnde < FilterStart)
{
FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
}
// Bis
FilterEnde = (DateTime)e.NewValue;
if (FilterEnde.Year != FilterStart.Year)
{
FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
}
if (FilterEnde < FilterStart)
{
FilterStart = new DateTime(FilterEnde.Year, 1, 1);
}
RefreshInvoiceBases();
}
if (FilterEnde.Year != FilterStart.Year)
{
FilterStart = new DateTime(FilterEnde.Year, FilterEnde.Month, 1);
}
private void DateEdit2_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
{
if (_Viewmodel is null)
return;
RefreshInvoiceBases();
}
}
if (FilterEnde == (DateTime)e.NewValue)
return;
// Bis
FilterEnde = (DateTime)e.NewValue;
if (FilterEnde < FilterStart)
{
FilterStart = new DateTime(FilterEnde.Year, 1, 1);
}
if (FilterEnde.Year != FilterStart.Year)
{
FilterStart = new DateTime(FilterEnde.Year, FilterEnde.Month, 1);
}
RefreshInvoiceBases();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -770,8 +770,8 @@ namespace BeWo.ViewModel
}
public bool IsIKNumberValid
=> DakotaValidator.ValidateIKNumber(IKKrankenkasse)
&& DakotaValidator.ValidateLeistungserbringergruppe(Leistungserbringergruppe);
=> DakotaValidator.IsIKNumberValid(IKKrankenkasse)
&& DakotaValidator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
public string IKKrankenkasse
{

View File

@@ -104,7 +104,7 @@ namespace Dakota
if (mandatordc == null)
throw new DakotaException("Mandator ist null");
if (!DakotaValidator.ValidateIKNumber(mandatordc.IKLeistungserbringer))
if (!DakotaValidator.IsIKNumberValid(mandatordc.IKLeistungserbringer))
throw new DakotaException($"Die IK Nummer des Leistungserbringers \"{mandatordc.IKLeistungserbringer}\" ist ungültig.");
}
@@ -117,7 +117,9 @@ namespace Dakota
if (customerDC == null)
error = "Customer ist null";
else if (!DakotaValidator.ValidateVersichertenstatus(customerDC.VersichertenStatus))
else if (!DakotaValidator.IsVersichertennummerValid(customerDC.InsuranceNumber))
error = $"Klient/in \"{customerDC.LastName}, {customerDC.FirstName}\" hat keine gültige Versichertennummer";
else if (!DakotaValidator.IsVersichertenstatusValid(customerDC.VersichertenStatus))
error = $"Klient/in \"{customerDC.LastName}, {customerDC.FirstName}\" hat keinen gültigen Versichertenstatus";
if (error != null)
@@ -130,13 +132,13 @@ namespace Dakota
if (orga == null)
error = "Organisation ist null";
else if (!DakotaValidator.ValidateLeistungserbringergruppe(orga.Leistungserbringergruppe))
else if (!DakotaValidator.IsLeistungserbringergruppeValid(orga.Leistungserbringergruppe))
error = $"Die Organisation \"{orga.Name}\" hat keine gültige Leistungserbringergruppe: \"{orga.Leistungserbringergruppe}\". Erwarten werden 5 Stellen für das Tarifkennzeichen alleine oder 7 Stellen für den Abrechnungscode und für das Tarifkennzeichen zusammen.";
else if (!DakotaValidator.ValidateIKNumber(orga.IKKrankenkasse))
else if (!DakotaValidator.IsIKNumberValid(orga.IKKrankenkasse))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Krankenkasse Kennzeichen: \"{orga.IKKrankenkasse}\".";
else if (!DakotaValidator.ValidateIKNumber(orga.IKKostentrager))
else if (!DakotaValidator.IsIKNumberValid(orga.IKKostentrager))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Kostenträger Kennzeichen: \"{orga.IKKostentrager}\".";
else if (!DakotaValidator.ValidateIKNumber(orga.IKDatenannahmestelle))
else if (!DakotaValidator.IsIKNumberValid(orga.IKDatenannahmestelle))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Datenannahmestelle Kennzeichen: \"{orga.IKDatenannahmestelle}\".";
if (error != null)

View File

@@ -124,12 +124,12 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.TotalAmount = pDataContract.InvoiceItems.Sum(i => i.AmountTotal);
}
Customer customer = null;
if(pEntity.CostBearer2SupportConcept!=null)
{
try
{
pDataContract.CustomerFirstName = pEntity.CostBearer2SupportConcept.SupportConcept.Customer.Person.FirstName;
pDataContract.CustomerLastName = pEntity.CostBearer2SupportConcept.SupportConcept.Customer.Person.LastName;
customer = pEntity.CostBearer2SupportConcept.SupportConcept.Customer;
}
catch (Exception)
{
@@ -140,8 +140,16 @@ namespace BeWo.Service.DCEntityMapper
else if (pEntity.SupportConceptOid.HasValue)
{
SupportConcept sc = DAOFactory.GenericDAO.LoadByID<SupportConcept>(pEntity.SupportConceptOid.Value);
pDataContract.CustomerFirstName = sc.Customer.Person.FirstName;
pDataContract.CustomerLastName = sc.Customer.Person.LastName;
customer = sc.Customer;
}
if(customer is object)
{
pDataContract.CustomerFirstName = customer.Person.FirstName;
pDataContract.CustomerLastName = customer.Person.LastName;
var error = DakotaValidator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus);
pDataContract.IsGkvValidError = error;
pDataContract.IsGkvValid = error is null;
}
return pDataContract;

View File

@@ -941,7 +941,7 @@ namespace BeWo.Service.ServiceImplementations
DakotaUtils.ValidateOrganisation(orga);
if (!DakotaValidator.ValidateOrganisationInformations(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
if (!DakotaValidator.IsOrganisationInformationValid(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
{
var res = SendApp8GetIKRequest(orga);
@@ -957,7 +957,7 @@ namespace BeWo.Service.ServiceImplementations
orga.IKKostentrager = res.IKKostentrager;
orga.BezDatenannahmestelle = res.BezDatenannahmestelle;
if (!DakotaValidator.ValidateOrganisationInformations(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
if (!DakotaValidator.IsOrganisationInformationValid(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
throw new DakotaException($"Für die Organisation \"{orga.Name}\" konnten die hinterlegten IKs nicht verifiziert werden: \"{orga.BezDatenannahmestelle}\", \"{orga.IKDatenannahmestelle}\", \"{orga.IKKostentrager}\", \"{orga.IKKrankenkasse}\"", "Interner Fehler");
DAOFactory.GenericDAO.Update(orga);

View File

@@ -10,14 +10,16 @@ namespace BS.Shared.Core
{
public static class DakotaValidator
{
public static bool ValidateMandator(string ik_leistungserbringer)
=> ValidateIKNumber(ik_leistungserbringer);
public static bool ValidateOrganisationInformations(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
=> ValidateIKNumber(ik_datenannahmestelle, ik_kostentrager, ik_krankenkasse) && !string.IsNullOrEmpty(bez_datenannahmestelle);
public static bool ValidateIKNumber(params string[] iks)
=> iks?.All(ValidateIKNumber) ?? false;
public static bool IsMandatorValid(string ik_leistungserbringer)
=> IsIKNumberValid(ik_leistungserbringer);
public static bool IsOrganisationInformationValid(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
=> IsIKNumberValid(ik_datenannahmestelle, ik_kostentrager, ik_krankenkasse) && !string.IsNullOrEmpty(bez_datenannahmestelle);
public static bool IsCustomerValid(string insurance_number, string insurance_status)
=> IsVersichertennummerValid(insurance_number) && IsVersichertenstatusValid(insurance_status);
public static bool IsIKNumberValid(params string[] iks)
=> iks?.All(IsIKNumberValid) ?? false;
public static bool ValidateIKNumber(string iknummer)
public static bool IsIKNumberValid(string iknummer)
{
if (iknummer == null)
return false;
@@ -28,7 +30,18 @@ namespace BS.Shared.Core
return int.TryParse(iknummer, out int x);
}
public static bool ValidateVersichertenstatus(string status)
public static bool IsVersichertennummerValid(string nummer)
{
if (nummer == null)
return false;
if (nummer.Length < 10)
return false;
return true;
}
public static bool IsVersichertenstatusValid(string status)
{
if (status == null)
return false;
@@ -39,7 +52,7 @@ namespace BS.Shared.Core
return true;
}
public static bool ValidateLeistungserbringergruppe(string code)
public static bool IsLeistungserbringergruppeValid(string code)
{
if (code == null)
return false;
@@ -49,5 +62,20 @@ namespace BS.Shared.Core
return true;
}
}
public static string ValidateCustomer(string insuranceNumber, string versichertenStatus)
{
bool valid_number = IsVersichertennummerValid(insuranceNumber);
bool valid_status = IsVersichertenstatusValid(versichertenStatus);
if (!valid_number && !valid_status)
return "Versichtertennummer & -status ungültig.";
else if (!valid_number)
return "Versichertennummer ungültig";
else if (!valid_status)
return "Versichertenstatus ungültig";
return null;
}
}
}

View File

@@ -25,6 +25,12 @@ namespace BS.Shared.DataContracts
[DataMember]
public string CreatorLastName { get; set; }
[DataMember]
public bool IsGkvValid { get; set; }
[DataMember]
public string IsGkvValidError { get; set; }
[DataMember]
public string CustomerFirstName { get; set; }