MoK:
Intervallfinder überarbeitet & Bug gefixt, der zu einem Fehler beim Suchen nach freien Intervallen über mehrere Tage geführt hatte, wenn die Enduhrzeit vor der Startuhrzeit lag. Berichte mit Parametern. Verbesserte Mitarbeiter-, Klienten-, Team-, und Organisationsdropdowns mit Suche. Quittierungsbelegresultate (zum Unterschreiben) wird wie die Zeiterfassung paginiert. FaC: neuer Kalender noch nicht fertig.
This commit is contained in:
@@ -32,6 +32,7 @@ using BS.Shared.Core;
|
||||
using ChatController.HauptKlassen;
|
||||
using DevExpress.Xpf.Core;
|
||||
using DevExpress.Xpf.Grid;
|
||||
using DevExpress.Xpf.Scheduling;
|
||||
using DevExpress.XtraScheduler;
|
||||
|
||||
namespace BeWo
|
||||
@@ -839,8 +840,9 @@ namespace BeWo
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LastKassenSortOrder, _AppSettings.LastKassenSortOrder.ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.LetzteZeiterfassungsDauer, ((int)_AppSettings.LetzteZeiterfassungsDauer).ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulerViewType, ((int) _AppSettings.SchedulerViewType).ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulerTimelineViewDayCount, (_AppSettings.SchedulerTimelineViewDayCount).ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulerTimelineViewDayCount, _AppSettings.SchedulerTimelineViewDayCount.ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulerDayViewDayCount, _AppSettings.SchedulerDayViewDayCount.ToString(), _LoggedOnUser.Settings);
|
||||
UserSettingsUtils.SetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulingViewType, ((int) _AppSettings.SchedulingViewType).ToString(), _LoggedOnUser.Settings);
|
||||
|
||||
string val = string.Empty;
|
||||
if (_AppSettings.StartupPanelOrder != null)
|
||||
@@ -1062,6 +1064,12 @@ namespace BeWo
|
||||
}
|
||||
}
|
||||
|
||||
val = UserSettingsUtils.GetSettingValue(SettingsType.ApplicationSettings, SettingsKeys.SchedulingViewType, settings);
|
||||
if(int.TryParse(val, out var schedulingViewTypeInt))
|
||||
{
|
||||
_AppSettings.SchedulingViewType = (ViewType)schedulingViewTypeInt;
|
||||
}
|
||||
|
||||
_AppSettings.IsDirty = false;
|
||||
}
|
||||
|
||||
@@ -1309,7 +1317,7 @@ namespace BeWo
|
||||
public static void LogMessage(string message)
|
||||
{
|
||||
#if DEBUG
|
||||
if(_DebugMessageLogView == null)
|
||||
if(_DebugMessageLogView is null)
|
||||
{
|
||||
_DebugMessageLogView = new DebugMessageLogView();
|
||||
}
|
||||
@@ -1324,7 +1332,7 @@ namespace BeWo
|
||||
public static void LogMessage(string message, Color customColor)
|
||||
{
|
||||
#if DEBUG
|
||||
if(_DebugMessageLogView == null)
|
||||
if(_DebugMessageLogView is null)
|
||||
{
|
||||
_DebugMessageLogView = new DebugMessageLogView();
|
||||
}
|
||||
|
||||
@@ -611,6 +611,25 @@ namespace BeWo.Core.Service
|
||||
callback(_FilteredCustomers);
|
||||
}
|
||||
}
|
||||
|
||||
private List<long> _TeamRelatedCustomerOids;
|
||||
|
||||
public void GetTeamRelatedCustomerOidsForEmployee(long employeeOid, bool forceReload, Action<List<long>> callback)
|
||||
{
|
||||
if(_TeamRelatedCustomerOids is null || forceReload)
|
||||
{
|
||||
ServiceFacade.DoEmployeeServiceAsync(s => s.LoadTeamsRelatedCustomerOids(employeeOid), customerOids =>
|
||||
{
|
||||
_TeamRelatedCustomerOids = customerOids;
|
||||
callback?.Invoke(_TeamRelatedCustomerOids);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
callback?.Invoke(_TeamRelatedCustomerOids);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearFilteredCustomers()
|
||||
{
|
||||
_FilteredCustomers = null;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace BeWo
|
||||
public static DebugConfig SimpleAutoLogin => new DebugConfig()
|
||||
{
|
||||
DebugConfigMode = DebugConfigMode.SimpleAutoLogin,
|
||||
AutoLogin = true
|
||||
AutoLogin = !Environment.MachineName.Equals("OWNSOFT-JETTEN")
|
||||
};
|
||||
|
||||
public static DebugConfig FeatureWohnhilfe => new DebugConfig()
|
||||
|
||||
@@ -45,8 +45,7 @@ namespace BeWo.Scheduler.ViewModel
|
||||
|
||||
public SchedulerSettings GetDefaultSchedulerSettings()
|
||||
{
|
||||
var settings = new SchedulerSettings(AppointmentKind.General, AppointmentViewType.WorkWeek);
|
||||
return settings;
|
||||
return new SchedulerSettings(AppointmentKind.General, AppointmentViewType.WorkWeek);
|
||||
}
|
||||
|
||||
private BindingList<IBeWoAppointment> _AppointmentList;
|
||||
|
||||
@@ -249,70 +249,51 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<Grid Margin="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<Grid Margin="5">
|
||||
<Grid.ColumnDefinitions> <!-- 5 Spalten -->
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<Grid.RowDefinitions> <!-- 19 Zeilen -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 0 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 1 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 2 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 3 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 4 -->
|
||||
<RowDefinition Height="Auto" /><!-- 5 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 5 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 6 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 7 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 8 -->
|
||||
<RowDefinition Height="Auto" /><!-- 10 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 9 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 10 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 11 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 12 -->
|
||||
<RowDefinition Height="Auto" /><!-- 15 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 13 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 14 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 15 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 16 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 17 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 18 -->
|
||||
<RowDefinition Height="Auto" />
|
||||
<!-- 19 -->
|
||||
<RowDefinition Height="Auto" /><!-- 19 -->
|
||||
</Grid.RowDefinitions>
|
||||
<!-- #region Betreff -->
|
||||
<Label Content="Betreff" Grid.Column="0" Grid.Row="0" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:TextEdit Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="4" Margin="3" Height="23" EditValue="{Binding ActualViewModel.Subject}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:TextEdit Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="5" Margin="3" Height="23" EditValue="{Binding ActualViewModel.Subject}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<!-- #endregion Betreff -->
|
||||
|
||||
<!-- #region Ort -->
|
||||
<Label Content="Ort" Grid.Column="0" Grid.Row="1" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:TextEdit Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="4" Margin="3" Height="23" EditValue="{Binding ActualViewModel.Location}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:TextEdit Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5" Margin="3" Height="23" EditValue="{Binding ActualViewModel.Location}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<!-- #endregion Ort -->
|
||||
|
||||
<!-- #region Start -->
|
||||
<Label Content="Start" Grid.Column="0" Grid.Row="2" Margin="3" />
|
||||
<dxe:DateEdit Grid.Column="1" Grid.Row="2" MinWidth="80" Margin="3" Height="23" MaskType="DateTimeAdvancingCaret" EditValue="{Binding ActualViewModel.Start}" Visibility="{Binding
|
||||
ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<Label Content="Start" Grid.Column="0" Grid.Row="2" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:DateEdit Grid.Column="1" Grid.Row="2" MinWidth="80" Margin="3" Height="23" MaskType="DateTimeAdvancingCaret" EditValue="{Binding ActualViewModel.Start}"
|
||||
Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="2" Margin="3" IsEnabled="{Binding ActualViewModel.AllDay, Converter={StaticResource BoolReverseConverter}}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}"
|
||||
MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" EditValue="{Binding ActualViewModel.Start}" Height="23" />
|
||||
<dxe:CheckEdit Grid.Column="3" Grid.ColumnSpan="2" Grid.Row="2" Content="Ganztägig" Margin="3" Height="23" EditValue="{Binding Appointment.AllDay}" HorizontalAlignment="Right" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
@@ -329,12 +310,12 @@
|
||||
<Label Content="Zu erledigen bis" Grid.Column="0" Grid.Row="4" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<dxe:DateEdit Grid.Column="1" Grid.Row="4" MinWidth="80" Margin="3" Height="23" MaskType="DateTimeAdvancingCaret" EditValue="{Binding ActualViewModel.DueDate}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="4" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}"
|
||||
MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" EditValue="{Binding ActualViewModel.DueDate}" Height="23" />
|
||||
Grid.ColumnSpan="4" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" EditValue="{Binding ActualViewModel.DueDate}" Height="23" />
|
||||
<!-- #endregion Zu erldedigen bis (Aufgabe) -->
|
||||
|
||||
<!-- #region Mitarbeiter -->
|
||||
<Label Content="Mitarbeiter" Grid.Column="0" Grid.Row="5" Margin="3" Visibility="{Binding EmployeeSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
|
||||
<Grid Grid.Column="1" Grid.Row="5" Height="23" Margin="3" Grid.ColumnSpan="3" Visibility="{Binding EmployeeSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid Grid.Column="1" Grid.Row="5" Height="23" Margin="3" Grid.ColumnSpan="4" Visibility="{Binding EmployeeSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -350,11 +331,11 @@
|
||||
<Popup Grid.Column="1" Grid.Row="5" Margin="10" Name="PopupEmployee" StaysOpen="False" Placement="MousePoint" Width="450" Height="0" >
|
||||
<search:MultiEmployeeSearch x:Name="MultiEmployeeSearch" SelectionChanged="MultiEmployeeSearch_OnSelectionChanged" ResultListBackground="{StaticResource EmployeeListBrush}" SelectedEmployees="{Binding ActualViewModel.EmployeeList, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
|
||||
</Popup>
|
||||
<Button x:Name="MitarbeiterPopUpOeffnenBtn" Grid.Column="4" Grid.Row="5" Width="20" Height="20" Margin="3" VerticalAlignment="Center" Click="EmployeePopupClick"
|
||||
<Button x:Name="MitarbeiterPopUpOeffnenBtn" Grid.Column="5" Grid.Row="5" Width="23" Height="23" Margin="3" VerticalAlignment="Center" Click="EmployeePopupClick"
|
||||
Visibility="{Binding EmployeeSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
<Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
<Line X1="4" Y1="8" X2="12" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
<Line X1="8" Y1="4" X2="8" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
</Grid>
|
||||
</Button>
|
||||
<ListBox Grid.Column="1" Grid.Row="6" Background="{StaticResource ObjectEditBackgroundBrush}" Margin="4,0,1,4" ItemsSource="{Binding Path=SelectedEmployees, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AppointmentEditView}}}"
|
||||
@@ -376,7 +357,7 @@
|
||||
|
||||
<!-- #region Klienten -->
|
||||
<Label Content="Klienten" Grid.Column="0" Grid.Row="7" Margin="3" Visibility="{Binding CustomerSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
|
||||
<Grid x:Name="CustomersGrid" Grid.Column="1" Grid.Row="7" Height="23" Margin="3" Grid.ColumnSpan="3"
|
||||
<Grid x:Name="CustomersGrid" Grid.Column="1" Grid.Row="7" Height="23" Margin="3" Grid.ColumnSpan="4"
|
||||
Visibility="{Binding CustomerSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -390,7 +371,7 @@
|
||||
</Border>
|
||||
<ToggleButton Grid.Column="1" x:Name="KlientenToggleButton" IsThreeState="False" Margin="0,0,2,0" Height="19" Width="19" ToolTip="Ausgewählte Klienten anzeigen" Style="{StaticResource ExpanderLookAlikeToggleBotton}" Visibility="{Binding CustomerSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}"/>
|
||||
</Grid>
|
||||
<Button x:Name="KlientenPopUpOeffnenBtn" Grid.Column="4" Grid.Row="7" Width="20" Height="20" Margin="3" VerticalAlignment="Center" Click="CustomerPopUpEditClick"
|
||||
<Button x:Name="KlientenPopUpOeffnenBtn" Grid.Column="5" Grid.Row="7" Width="23" Height="23" Margin="3" VerticalAlignment="Center" Click="CustomerPopUpEditClick"
|
||||
Visibility="{Binding CustomerSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
@@ -418,7 +399,7 @@
|
||||
|
||||
<!-- #region Ressourcen -->
|
||||
<Label Content="Ressourcen" Grid.Column="0" Grid.Row="9" Margin="3" Visibility="{Binding ResourceSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
|
||||
<Grid Grid.Column="1" Grid.Row="9" Height="23" Margin="3" Grid.ColumnSpan="3" x:Name="ResourceToggleButtonGrid"
|
||||
<Grid Grid.Column="1" Grid.Row="9" Height="25" Margin="3" Grid.ColumnSpan="4" x:Name="ResourceToggleButtonGrid"
|
||||
Visibility="{Binding ResourceSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -432,7 +413,7 @@
|
||||
</Border>
|
||||
<ToggleButton Grid.Column="1" x:Name="RessourcenToggleButton" IsThreeState="False" Margin="0,0,2,0" Height="19" Width="19" ToolTip="Ausgewählte Ressourcen anzeigen" Style="{StaticResource ExpanderLookAlikeToggleBotton}"/>
|
||||
</Grid>
|
||||
<Button x:Name="RessourcenPopUpOeffnenBtn" Grid.Column="4" Grid.Row="9" Width="20" Height="20" Margin="3" VerticalAlignment="Center" Click="ResourcePopUpClick"
|
||||
<Button x:Name="RessourcenPopUpOeffnenBtn" Grid.Column="5" Grid.Row="9" Width="23" Height="23" Margin="3" VerticalAlignment="Center" Click="ResourcePopUpClick"
|
||||
Visibility="{Binding ResourceSelectionVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}">
|
||||
<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
@@ -460,7 +441,7 @@
|
||||
|
||||
<!-- #region Hilfeplan (Aufgabe) -->
|
||||
<Label Content="Hilfeplan" Grid.Column="0" Grid.Row="11" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<Button x:Name="SupportConceptsPopUpOeffnenBtn" Grid.Column="4" Grid.Row="11" Width="20" Height="20" Margin="3" VerticalAlignment="Center" Click="SupportConceptsPopUpClick" Visibility="Collapsed">
|
||||
<Button x:Name="SupportConceptsPopUpOeffnenBtn" Grid.Column="5" Grid.Row="11" Width="20" Height="20" Margin="3" VerticalAlignment="Center" Click="SupportConceptsPopUpClick" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Grid Width="18" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<Line X1="4" X2="12" Y1="8" Y2="8" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
<Line X1="8" X2="8" Y1="4" Y2="12" Fill="{x:Null}" Stroke="#FFFFFFFF" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" />
|
||||
@@ -470,8 +451,8 @@
|
||||
<search:SupportConceptSearchView x:Name="SupportConceptsTreeSearchView" ItemSelected="SupportConceptSelectionControl_ItemSelected" ShowFilterPanel="True" />
|
||||
</Popup>
|
||||
<ListBox Grid.Column="1" Grid.Row="11" Background="White" Margin="4,0,1,4" ItemsSource="{Binding Path=SelectedSupportConcepts, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:AppointmentEditView}}}" IsSynchronizedWithCurrentItem="True"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Grid.ColumnSpan="3" Name="SelectedSupportConceptsListBox"
|
||||
ItemContainerStyle="{StaticResource MultiSupportConceptSelectionControlStyle}" MaxHeight="35" Height="35" Visibility="Collapsed">
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Grid.ColumnSpan="4" Name="SelectedSupportConceptsListBox"
|
||||
ItemContainerStyle="{StaticResource MultiSupportConceptSelectionControlStyle}" MaxHeight="35" Height="35" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<ListBox.Template>
|
||||
<ControlTemplate TargetType="{x:Type ListBox}">
|
||||
<Border x:Name="Bd" SnapsToDevicePixels="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
@@ -486,7 +467,7 @@
|
||||
|
||||
<!-- #region Beschreibung (Aufgabe) -->
|
||||
<Label Content="Beschreibung" Grid.Column="0" Grid.Row="13" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="13" Grid.ColumnSpan="4" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
|
||||
<TextBox Grid.Column="1" Grid.Row="13" Grid.ColumnSpan="5" AcceptsReturn="True" VerticalScrollBarVisibility="Auto"
|
||||
Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}"
|
||||
HorizontalScrollBarVisibility="Disabled" Height="45" Margin="3" TextWrapping="Wrap" x:Name="TaskDescription"
|
||||
Text="{Binding Path=ActualViewModel.TaskDescription, UpdateSourceTrigger=PropertyChanged}" MaxLength="1024" />
|
||||
@@ -495,36 +476,48 @@
|
||||
<!-- #region Erledigt am (Aufgabe) -->
|
||||
<Label Content="Erledigt am" Grid.Column="0" Grid.Row="14" Margin="3" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<dxe:DateEdit Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}"
|
||||
x:Name="CompletedDate" Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="14"
|
||||
x:Name="CompletedDate" Grid.Column="1" Grid.ColumnSpan="5" Grid.Row="14"
|
||||
MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding ActualViewModel.CompletedDate, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
|
||||
<!-- #endregion -->
|
||||
|
||||
<!-- #region Notiz -->
|
||||
<Label Margin="3" Content="Notiz" Grid.Column="0" Grid.Row="15" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="15" Grid.ColumnSpan="4" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}"
|
||||
<TextBox Grid.Column="1" Grid.Row="15" Grid.ColumnSpan="5" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}"
|
||||
HorizontalScrollBarVisibility="Disabled" Height="45" Margin="3" TextWrapping="Wrap"
|
||||
Text="{Binding Path=ActualViewModel.Description, UpdateSourceTrigger=PropertyChanged}" MaxLength="1024" />
|
||||
<!-- #endregion -->
|
||||
|
||||
<!-- #region Notiz (Aufgabe) -->
|
||||
<Label Margin="3" Content="Notiz" Grid.Column="0" Grid.Row="15" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="15" Grid.ColumnSpan="5" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}}"
|
||||
HorizontalScrollBarVisibility="Disabled" Height="45" Margin="3" TextWrapping="Wrap"
|
||||
Text="{Binding Path=ActualViewModel.CompletedNotice, UpdateSourceTrigger=PropertyChanged}" MaxLength="1024" />
|
||||
<!-- #endregion -->
|
||||
|
||||
<!-- #region Wiederholung nur wenn es keine Occurrence ist -->
|
||||
<Label Grid.Column="0" Grid.Row="16" Content="Wiederholung" Visibility="{Binding RecurrenceButtonVisibility, Mode=OneWay}" />
|
||||
<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="16" Margin="3" Grid.ColumnSpan="3"
|
||||
<Button Grid.Column="0" Grid.Row="16" Margin="3" Grid.ColumnSpan="5" Height="25"
|
||||
Visibility="{Binding RecurrenceButtonVisibility, Mode=OneWay}"
|
||||
Command="{Binding EditRecurrenceCommand}"
|
||||
Content="Wiederholung" />
|
||||
|
||||
|
||||
<!--<dxe:ComboBoxEdit Grid.Column="1" Grid.Row="16" Margin="3" Grid.ColumnSpan="3" Height="25"
|
||||
x:Name="RecurrenceTypeComboBoxEdit"
|
||||
Visibility="{Binding RecurrenceButtonVisibility, Mode=OneWay}"
|
||||
ItemsSource="{Binding AvailableAppointmentRecurrenceTypes, UpdateSourceTrigger=PropertyChanged}"
|
||||
EditValueChanged="RecurrenceTypeComboBoxEdit_OnChanged">
|
||||
</dxe:ComboBoxEdit>
|
||||
<Button Grid.Column="4" Grid.Row="16" Content="Bearbeiten"
|
||||
<Button Grid.Column="4" Grid.Row="16" Content="Bearbeiten" Grid.ColumnSpan="2" Margin="3"
|
||||
IsEnabled="{Binding Appointment.RecurrenceInfo, Converter={StaticResource BoolNullCheckConverter}}"
|
||||
Visibility="{Binding RecurrenceButtonVisibility, Mode=OneWay}"
|
||||
Click="EditRecurrenceButton_OnClick"
|
||||
/>
|
||||
/>-->
|
||||
<!-- #endregion -->
|
||||
|
||||
<CheckBox Grid.Column="0" Grid.Row="18" Margin="3" Content="Privater Termin" IsChecked="{Binding Path=ActualViewModel.IsPrivate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
<CheckBox Grid.Column="0" Grid.ColumnSpan="6" Grid.Row="18" Margin="3" Content="Privater Termin" IsChecked="{Binding Path=ActualViewModel.IsPrivate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding ActualViewModel.IsTask, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=Reverse}" />
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="19" Grid.ColumnSpan="5" VerticalAlignment="Bottom">
|
||||
<StackPanel VerticalAlignment="Bottom" Height="40" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5,0,5,0">
|
||||
<Grid Grid.Column="0" Grid.Row="19" Grid.ColumnSpan="6" VerticalAlignment="Bottom">
|
||||
<StackPanel VerticalAlignment="Bottom" Height="40" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Content="OK" Width="80" Height="25" Margin="3" Click="OkButton_Click" Visibility="{Binding Path=OkButtonVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
|
||||
<Button Content="Abbrechen" Width="80" Height="25" Margin="3" Click="CloseButton_OnClick" />
|
||||
<Button Content="Löschen" Width="80" Height="25" Margin="3" Click="DeleteButton_OnClick" Visibility="{Binding Path=DeleteButtonVisibility, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
@@ -28,6 +29,7 @@ namespace BeWo.Scheduling.View
|
||||
{
|
||||
public partial class AppointmentEditView : INotifyPropertyChanged
|
||||
{
|
||||
private AppointmentType _InitialAppointmentType;
|
||||
private AppointmentWindowVM ViewModel => DataContext as AppointmentWindowVM;
|
||||
|
||||
private ObservableCollection<Employee2SchedulerAppointmentDC> _SelectedEmployees;
|
||||
@@ -184,7 +186,6 @@ namespace BeWo.Scheduling.View
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
|
||||
public InformationView InformationView { get; set; }
|
||||
public CompactCustomerDC Customer { get; set; }
|
||||
|
||||
@@ -195,14 +196,14 @@ namespace BeWo.Scheduling.View
|
||||
|
||||
private void InitRights()
|
||||
{
|
||||
var hasRightToSeeEmployees = !ViewModel.ActualViewModel.IsTask && (BeWoUtils.HasRight(UserRightType.Employee_AllowViewOwnTeam) || BeWoUtils.HasRight(UserRightType.EmployeeView_View)) && BeWoUtils.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
|
||||
var hasRightToSeeCustomers = !ViewModel.ActualViewModel.IsTask && BeWoUtils.HasRight(UserRightType.CustomerView_View) || BeWoUtils.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoUtils.HasRight(UserRightType.Customer_ViewMyCustomers);
|
||||
var hasRightToSeeResources = !ViewModel.ActualViewModel.IsTask && BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAnlegen) || BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAendern);
|
||||
var hasRightToSeeEmployees = ViewModel.ActualViewModel.IsTask is false && (BeWoUtils.HasRight(UserRightType.Employee_AllowViewOwnTeam) || BeWoUtils.HasRight(UserRightType.EmployeeView_View)) && BeWoUtils.HasRight(UserRightType.KalenderMitarbeitertermineAnsehen);
|
||||
var hasRightToSeeCustomers = ViewModel.ActualViewModel.IsTask is false && BeWoUtils.HasRight(UserRightType.CustomerView_View) || BeWoUtils.HasRight(UserRightType.Customer_ViewMyTeams) || BeWoUtils.HasRight(UserRightType.Customer_ViewMyCustomers);
|
||||
var hasRightToSeeResources = ViewModel.ActualViewModel.IsTask is false && BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAnlegen) || BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAendern);
|
||||
var hasRightToSeeSupportConcepts = ViewModel.ActualViewModel.IsTask && (BeWoUtils.HasRight(UserRightType.SupportConceptView_View) || BeWoUtils.HasRight(UserRightType.ViewAll) || BeWoUtils.HasRight(UserRightType.SupportConcept_ViewMyTeams) || BeWoUtils.HasRight(UserRightType.SupportConcept_ViewAllSupportConcepts));
|
||||
|
||||
EmployeeSelectionVisibility = hasRightToSeeEmployees ? Visibility.Visible : Visibility.Collapsed;
|
||||
CustomerSelectionVisibility = hasRightToSeeCustomers ? Visibility.Visible : Visibility.Collapsed;
|
||||
ResourceSelectionVisibility = hasRightToSeeResources ? Visibility.Visible : Visibility.Collapsed;
|
||||
CustomerSelectionVisibility = ViewModel.ActualViewModel.IsTask is false && hasRightToSeeCustomers ? Visibility.Visible : Visibility.Collapsed;
|
||||
ResourceSelectionVisibility = ViewModel.ActualViewModel.IsTask is false && hasRightToSeeResources ? Visibility.Visible : Visibility.Collapsed;
|
||||
SupportConceptVisibility = hasRightToSeeSupportConcepts ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
@@ -346,13 +347,15 @@ namespace BeWo.Scheduling.View
|
||||
return;
|
||||
}
|
||||
|
||||
_InitialAppointmentType = ViewModel.Appointment.Type;
|
||||
|
||||
InitRights();
|
||||
|
||||
var selectedEmployees = new ObservableCollection<CompactEmployeeDC>();
|
||||
|
||||
foreach(var e2s in ViewModel.EmployeeList)
|
||||
foreach(var employee2Appointment in ViewModel.EmployeeList)
|
||||
{
|
||||
selectedEmployees.AddIfNotIn(e2s.Employee);
|
||||
selectedEmployees.AddIfNotIn(employee2Appointment.Employee);
|
||||
}
|
||||
|
||||
SelectedResources.CollectionChanged += SelectedResourcesCollectionChanged;
|
||||
@@ -384,25 +387,31 @@ namespace BeWo.Scheduling.View
|
||||
_IgnoreRecurrenceTypeChange = true;
|
||||
}
|
||||
|
||||
RecurrenceTypeComboBoxEdit.SelectedItem = ViewModel.RecurrenceTypeName;
|
||||
//RecurrenceTypeComboBoxEdit.SelectedItem = ViewModel.RecurrenceTypeName;
|
||||
}
|
||||
|
||||
private bool _IgnoreRecurrenceTypeChange;
|
||||
|
||||
public void SetRecurrenceInfo(string originalRecurrenceInfo)
|
||||
{
|
||||
if(!(originalRecurrenceInfo is null))
|
||||
if(originalRecurrenceInfo != null)
|
||||
{
|
||||
ViewModel.Appointment.RecurrenceInfo?.FromXml(originalRecurrenceInfo);
|
||||
ViewModel.ActualViewModel.RecurrenceInfo = originalRecurrenceInfo;
|
||||
//ViewModel.Appointment.RecurrenceInfo?.FromXml(originalRecurrenceInfo);
|
||||
//ViewModel.ActualViewModel.RecurrenceInfo = originalRecurrenceInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewModel.Appointment.RecurrenceInfo = null;
|
||||
ViewModel.ActualViewModel.RecurrenceInfo = null;
|
||||
// Bug: Verursacht NullPointerException!
|
||||
|
||||
//ViewModel.Appointment.RecurrenceInfo = null;
|
||||
|
||||
//ViewModel.Appointment.SetRecurrenceInfo(null);
|
||||
//ViewModel.ActualViewModel.RecurrenceInfo = null;
|
||||
|
||||
//ViewModel.Appointment.Type = AppointmentType.Normal;
|
||||
}
|
||||
|
||||
RecurrenceTypeComboBoxEdit.SelectedItem = ViewModel.RecurrenceTypeName;
|
||||
//RecurrenceTypeComboBoxEdit.SelectedItem = ViewModel.RecurrenceTypeName;
|
||||
}
|
||||
|
||||
private void OkButton_Click(object sender, RoutedEventArgs e)
|
||||
@@ -424,8 +433,6 @@ namespace BeWo.Scheduling.View
|
||||
var recurrenceId = dataContract.RecurrenceId;
|
||||
var recurrenceIndex = dataContract.RecurrenceIndex;
|
||||
|
||||
|
||||
|
||||
ServiceFacade.DoResourceServiceAsync(s => s.OverlappingAppointmentsExist(start, end, employeeOids, customerOids, resrouceOids, originatorOid, dataContract.SchedulerAppointmentOid, recurrenceId, recurrenceIndex), isOverlapping =>
|
||||
{
|
||||
Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action) (() =>
|
||||
@@ -571,7 +578,7 @@ namespace BeWo.Scheduling.View
|
||||
// TODO: Fertig machen
|
||||
private void EditRecurrenceButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(!(ViewModel.Appointment.RecurrenceInfo is null))
|
||||
if(ViewModel.Appointment.RecurrenceInfo != null)
|
||||
{
|
||||
ViewModel.Scheduler.ShowRecurrenceWindow(ViewModel.Appointment);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace BeWo.Scheduling.View
|
||||
private void CloseButton_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
IsCancelled = true;
|
||||
ViewModel.DeleteCommand.Execute(null);
|
||||
_IsCancelButtonClicked = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace BeWo.Scheduling.View
|
||||
|
||||
var employee2Appointment2 = SelectedAppointment.EmployeeList.ToList().Find(e2a => e2a.Employee2SchedulerAppointmentOid == SelectedAppointment.LabelKey);
|
||||
|
||||
if(!(employee2Appointment2 is null))
|
||||
if(employee2Appointment2 != null)
|
||||
{
|
||||
employee2Appointment2.IsPC_CheckedTs = DateTime.Now;
|
||||
employee2Appointment2.IsPChanged = false;
|
||||
|
||||
@@ -808,9 +808,9 @@
|
||||
AppointmentWindowShowing="SchedulerControl_OnAppointmentWindowShowing"
|
||||
CustomAllowAppointmentCreate="SchedulerControl_CustomAllowAppointmentCreate"
|
||||
CustomAllowAppointmentEdit="SchedulerControl_CustomAllowAppointmentEdit"
|
||||
CustomAllowAppointmentDrag="SchedulerControl_CustomAllowAppointmentEdit"
|
||||
CustomAllowAppointmentResize="SchedulerControl_CustomAllowAppointmentEdit"
|
||||
CustomAllowAppointmentDragBetweenResources="SchedulerControl_CustomAllowAppointmentEdit"
|
||||
CustomAllowAppointmentDrag="SchedulerControl_CustomAllowAppointmentDrag"
|
||||
CustomAllowAppointmentResize="SchedulerControl_CustomAllowAppointmentResize"
|
||||
CustomAllowAppointmentDragBetweenResources="SchedulerControl_CustomAllowAppointmentDragBetweenResources"
|
||||
RecurrenceWindowShowing="SchedulerControl_OnRecurrenceWindowShowing"
|
||||
DropAppointment="SchedulerControl_OnDropAppointment"
|
||||
AppointmentRemoved="SchedulerControl_OnAppointmentRemoved"
|
||||
@@ -867,8 +867,7 @@
|
||||
</dxsch:OptionsContextMenu>
|
||||
</dxsch:SchedulerControl.OptionsContextMenu>
|
||||
<dxsch:SchedulerControl.OptionsWindows>
|
||||
<dxsch:OptionsWindows AppointmentWindowType="{x:Type local:AppointmentEditView}"
|
||||
RecurrenceWindowType="{x:Type local:AppointmentRecurrenceEditView}" />
|
||||
<dxsch:OptionsWindows AppointmentWindowType="{x:Type local:AppointmentEditView}" RecurrenceWindowType="{x:Type local:AppointmentRecurrenceEditView}" />
|
||||
</dxsch:SchedulerControl.OptionsWindows>
|
||||
<dxsch:SchedulerControl.DataSource>
|
||||
<dxsch:DataSource AppointmentsSource="{Binding VMList}">
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -196,7 +196,6 @@ namespace BeWo.Scheduling.ViewModel
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private string TranslateRecurrenceInfoType()
|
||||
{
|
||||
if(RecurrenceInfo is null)
|
||||
|
||||
@@ -695,5 +695,7 @@ namespace BeWo.Scheduling.ViewModel
|
||||
employeeDependencyObject.SetValue(ListItemHelper.IsCheckedProperty, val);
|
||||
}
|
||||
}
|
||||
|
||||
public List<long> TeamRelatedCustomerOids { get; set; } = new List<long>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -613,9 +613,19 @@ namespace BeWo.Scheduling.ViewModel
|
||||
{
|
||||
IsTeilnahmeBestaetigung = dataContract.IsTeilnahmeBestaetigung;
|
||||
CanBeEdited = dataContract.CanBeEdited;
|
||||
|
||||
|
||||
InitAppointmentColors();
|
||||
}
|
||||
|
||||
if(dataContract.IsPrivate == false || dataContract.Originator.EmployeeOid.Equals(BeWoApp.LoggedOnEmployee.EmployeeOid) || dataContract.EmployeeList.Any(e2a => e2a.Employee.Equals(BeWoApp.CompactLoggedOnEmployee)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CanBeEdited = false;
|
||||
|
||||
dataContract.Description = "Privater Termin";
|
||||
dataContract.Subject = $"Privat ({dataContract.Originator})";
|
||||
}
|
||||
|
||||
// Wird für Abwesenheiten genutzt
|
||||
public SchedulingAppointmentVM(bool pAllDay, string pSubject, DateTime pStart, DateTime pEnd, CompactEmployeeDC pOriginator, DateTime? absenceTimeStart, DateTime? absenceTimeEnd)
|
||||
|
||||
@@ -310,6 +310,7 @@
|
||||
<Compile Include="Util\JsonCustomer.cs" />
|
||||
<Compile Include="Util\JsonOrganisation.cs" />
|
||||
<Compile Include="Util\MobileUserSettingsUtils.cs" />
|
||||
<Compile Include="Util\MoKExtensions\TagBuilderExtensions.cs" />
|
||||
<Compile Include="Util\NullableDateTimeSpan.cs" />
|
||||
<Compile Include="Util\PasswordUtils.cs" />
|
||||
<Compile Include="Util\QuittierungsbelegItem.cs" />
|
||||
@@ -538,6 +539,7 @@
|
||||
<Content Include="Scripts\moment\moment.js" />
|
||||
<Content Include="Scripts\moment\moment.min.js" />
|
||||
<Content Include="Scripts\ownSoft-Scripts\signature.js" />
|
||||
<Content Include="Scripts\ownSoft-Scripts\utils\dropdown-search.js" />
|
||||
<Content Include="Scripts\signature-pad.min.js" />
|
||||
<Content Include="Scripts\tempusdominus-boostrap-4.min.js" />
|
||||
<Content Include="Scripts\ownSoft-Scripts\utils\js-helper.js" />
|
||||
@@ -697,7 +699,7 @@
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>False</AutoAssignPort>
|
||||
<DevelopmentServerPort>8808</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
|
||||
@@ -159,6 +159,27 @@ textarea {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
.cancel-selection-btn-container {
|
||||
min-width: min-content;
|
||||
width: min-content;
|
||||
max-width: min-content;
|
||||
}
|
||||
|
||||
.entity-popup-open-button {
|
||||
flex: 1 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: normal;
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.lg-max-width {
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Bootstrap v4.4.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
@@ -11613,5 +11634,9 @@ a.text-bewo-report:hover, a.text-bewo-report:focus {
|
||||
border-color: #dee2e6;
|
||||
}
|
||||
}
|
||||
.btn-group-dropdown-toggle {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=style.css.map */
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -187,4 +187,29 @@ $font-family-sans-serif: 'Signika Negative', sans-serif;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
@import "bootstrap/scss/bootstrap";
|
||||
.cancel-selection-btn-container {
|
||||
min-width: min-content;
|
||||
width: min-content;
|
||||
max-width: min-content;
|
||||
}
|
||||
|
||||
.entity-popup-open-button {
|
||||
flex: 1 0 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
white-space: normal;
|
||||
border-radius: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.lg-max-width {
|
||||
max-width: 1200px;
|
||||
}
|
||||
|
||||
@import "bootstrap/scss/bootstrap";
|
||||
|
||||
.btn-group-dropdown-toggle {
|
||||
@include border-right-radius(0);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ using Image = System.Drawing.Image;
|
||||
using ServiceRecordDC = BS.Shared.DataContracts.ServiceRecordDC;
|
||||
|
||||
/*
|
||||
* ToDo für Montag, den 26.08.2024: Klickt man auf "bearbeiten" bei einem Eintrag, wird die Leistung nicht geladen
|
||||
* ToDo: Bug, wenn man auf "bearbeiten" bei einem Eintrag klickt, wird die Leistung nicht geladen
|
||||
* ToDo: Hat man vor dem Anlegen einer Mehrfachbuchung einen Hilfeplan ausgewählt, wird der nicht richtig nach dem Anlegen geladen und die Intervallauswahl ist nicht sichtbar.
|
||||
*/
|
||||
|
||||
@@ -348,8 +348,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
UserService.UpdateUserSettings(loggedInUser.UserOid.Value, userSettings);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Authorize]
|
||||
public ActionResult SetShowExpiredSupportConcepts(FormCollection pCollection)
|
||||
@@ -649,7 +647,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
[Authorize]
|
||||
public string LoadStatistics(long oid)
|
||||
{
|
||||
@@ -2154,6 +2151,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
case ServiceRecordTimeInterval.Monatsauswahl:
|
||||
Model.LastSelectedServiceRecordMonth = lastSelectedServiceRecordMonth.Value;
|
||||
Model.SelectedDayCount = lastSelectedServiceRecordMonth.Value.Date.GetDaysInMonth();
|
||||
Model.SelectedZeitraum = new NullableDateTimeSpan(lastSelectedServiceRecordMonth.Value.Date.GetFirstOfMonth(), lastSelectedServiceRecordMonth.Value.Date.GetLastOfMonth());
|
||||
UpdateUserSettingsWithoutReload(SettingsKeys.LastSelectedServiceRecordMonth, lastSelectedServiceRecordMonth.Value.ToString("dd.MM.yyyy HH:mm:ss"));
|
||||
break;
|
||||
case ServiceRecordTimeInterval.ZeitraumWaehlen:
|
||||
|
||||
@@ -14,8 +14,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.Service.Plugins;
|
||||
using DevExpress.Mvvm.Native;
|
||||
using NHibernate.Util;
|
||||
|
||||
namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
@@ -465,6 +463,29 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return $"vom {vom}.{month}. bis {bis}.{month}.{year}";
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string CheckForSelectedOrganization()
|
||||
{
|
||||
return Model?.SelectedOrganisation != null ? $"{Model.SelectedOrganisation.DetailDescription}_{Model.SelectedOrganisation.OrganisationOid}" : LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string CheckForSelectedEmployee()
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(Model.SelectedEmployee is null && (Model.Employee?.EmployeeOid.HasValue ?? false))
|
||||
{
|
||||
return $"{Model.Employee.LastNameFirstName}_{Model.Employee.EmployeeOid.Value}";
|
||||
}
|
||||
|
||||
return $"{Model.SelectedEmployee.DetailDescription}_{Model.SelectedEmployee.EmployeeOid}";
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string SetCustomer(long customerOid)
|
||||
{
|
||||
@@ -475,7 +496,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == customerOid);
|
||||
|
||||
return Model.SelectedCustomer?.DetailDescription ?? "Klient";
|
||||
return Model.SelectedCustomer?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -564,7 +585,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedEmployee = employeeOid.HasValue ? Model.Employees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid)) : null;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
return Model.SelectedEmployee?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -593,7 +614,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedOrganisation = organisationOid.HasValue ? Model.Organisations.FirstOrDefault(organisation => organisation.OrganisationOid.Equals(organisationOid)) : null;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
return Model.SelectedOrganisation?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -637,7 +658,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string SetQbFilterEnum(string filterEnumString)
|
||||
{
|
||||
if(Model == null)
|
||||
if(Model is null)
|
||||
{
|
||||
Logout();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
@@ -654,7 +675,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.SelectedFilterItem = new QbFilterItem(selectedFilterEnum);
|
||||
|
||||
if(selectedFilterEnum != QBFilterEnum.KlientenAuswahl || !(Model.SelectedCustomer is null))
|
||||
if(selectedFilterEnum != QBFilterEnum.KlientenAuswahl || Model.SelectedCustomer != null)
|
||||
{
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
@@ -859,254 +880,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Report");
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
LoadPaginatedQbEntries(1);
|
||||
//LoadServiceOverviewToModel();
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
private void LoadServiceOverviewToModel()
|
||||
{
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
||||
{
|
||||
var customerOidString = Model.SelectedCustomerOid.ToString();
|
||||
|
||||
var isCustomerOidSuccessful = long.TryParse(customerOidString, out var selectedCustomerOid);
|
||||
|
||||
if(isCustomerOidSuccessful)
|
||||
{
|
||||
var selectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == selectedCustomerOid);
|
||||
|
||||
Model.SelectedCustomer = selectedCustomer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedCustomer = null;
|
||||
}
|
||||
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
|
||||
{
|
||||
var teamOidString = Model.SelectedTeamOid.ToString();
|
||||
|
||||
var isTeamOidSuccessful = long.TryParse(teamOidString, out var selectedTeamOid);
|
||||
|
||||
if(isTeamOidSuccessful)
|
||||
{
|
||||
var selectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == selectedTeamOid);
|
||||
|
||||
Model.SelectedTeam = selectedTeam;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedTeam = null;
|
||||
}
|
||||
|
||||
var reportTimeFrame = GetReportTimeFrame();
|
||||
|
||||
var reportObjects = new List<ServicesOverviewRO>();
|
||||
|
||||
var organisationOid = Model.SelectedOrganisationOid ?? 0;
|
||||
var employeeOid = Model.SelectedEmployeeOid ?? 0;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var customerOid = Model.SelectedCustomerOid ?? 0;
|
||||
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>() ?? new DefaultReportCreator();
|
||||
|
||||
switch(Model.SelectedFilterItem.FilterEnum)
|
||||
{
|
||||
case QBFilterEnum.AlleKlienten:
|
||||
reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid);
|
||||
break;
|
||||
case QBFilterEnum.NurKlientenMeinesTeams:
|
||||
var teamRelatedCustomerOids = creator.GetKlientenOidsMeinesTeams(null);
|
||||
reportObjects.AddRange(teamRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
case QBFilterEnum.MeineKlienten:
|
||||
var myRelatedCustomerOids = creator.GetMeineKlientenOids();
|
||||
reportObjects.AddRange(myRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
case QBFilterEnum.KlientenAuswahl:
|
||||
reportObjects = new List<ServicesOverviewRO> { ServicesOverviewRO.Create(customerOid, reportTimeFrame.Month, reportTimeFrame.Year, false, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid) };
|
||||
break;
|
||||
case QBFilterEnum.TeamAuswahl:
|
||||
var customerOids = creator.GetKlientenOidsMeinesTeams(teamOid);
|
||||
reportObjects.AddRange(customerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
default:
|
||||
reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid, true, false);
|
||||
break;
|
||||
}
|
||||
|
||||
reportObjects = reportObjects.Where(x => x != null).ToList();
|
||||
|
||||
var srOids = new List<long>();
|
||||
|
||||
reportObjects.DoForEach(x => x.Services.DoForEach(s => srOids.AddIfNotIn(s.ServiceRecordOid)));
|
||||
|
||||
Model.ConfirmationReceiptSignatures = OperationsService.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(srOids, out var serviceRecordOidsWithSignature);
|
||||
|
||||
var customerSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Customer).ToList();
|
||||
var employeeSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Employee).ToList();
|
||||
|
||||
Model.ReportServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(ro => ro.Services.DoForEach(s =>
|
||||
{
|
||||
Model.ReportServiceRecordOids.AddIfNotIn(s.ServiceRecordOid);
|
||||
}));
|
||||
|
||||
var hasEmployeeSignature = srOids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var employeeSignatureState = SignatureState.None;
|
||||
|
||||
if(anyEmployeeSignatures)
|
||||
{
|
||||
employeeSignatureState = SignatureState.Some;
|
||||
}
|
||||
|
||||
if(hasEmployeeSignature)
|
||||
{
|
||||
employeeSignatureState = SignatureState.All;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
// Prüfen, ob alle eigenen ServiceRecords unterschrieben sind
|
||||
var ownServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => ownServiceRecordOids.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
// Prüfen, ob Einträge von anderen Mitarbeitern existieren
|
||||
var serviceRecordOidsFromOtherEmployees = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => serviceRecordOidsFromOtherEmployees.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState;
|
||||
}
|
||||
|
||||
Model.ConfirmationReceiptObject = null;
|
||||
Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
|
||||
BuildInformationString(),
|
||||
new List<QuittierungsbelegResult>(),
|
||||
BuildInformationString(true),
|
||||
GetTimeSpanString(),
|
||||
hasEmployeeSignature,
|
||||
employeeSignatures.ToList(),
|
||||
employeeSignatureState);
|
||||
|
||||
var confirmationReceiptResults = new List<QuittierungsbelegResult>();
|
||||
|
||||
reportObjects.DoForEach(reportObject =>
|
||||
{
|
||||
var quittierungsbelegItems = new List<QuittierungsbelegItem>();
|
||||
|
||||
reportObject.Services.DoForEach(serviceDetail =>
|
||||
{
|
||||
quittierungsbelegItems.Add(new QuittierungsbelegItem(serviceDetail));
|
||||
});
|
||||
|
||||
if(quittierungsbelegItems.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
|
||||
|
||||
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Customer, a));
|
||||
|
||||
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
|
||||
|
||||
var customerSignatureState = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Customer);
|
||||
|
||||
var customerSignatureOid = hasCustomerSignature ? customerSignatures.FirstOrDefault(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value)))?.ConfirmationReceiptSignatureOid : null;
|
||||
var sigs = customerSignatures.Where(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value))).ToList();
|
||||
|
||||
var customerSignatureOids = sigs.Where(signature => signature.ConfirmationReceiptSignatureOid.HasValue).Select(signature => signature.ConfirmationReceiptSignatureOid.Value).ToList();
|
||||
|
||||
var employeeSignatureOids = new List<long>();
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
foreach(var signature in employeeSignatures.Where(s => s.ConfirmationReceiptSignatureOid.HasValue))
|
||||
{
|
||||
foreach(var serviceRecord in signature.ServiceRecords)
|
||||
{
|
||||
var oid = serviceRecord.ServiceRecordOid;
|
||||
|
||||
if(oid.HasValue && oids.Contains(oid.Value))
|
||||
{
|
||||
employeeSignatureOids.AddIfNotIn(signature.ConfirmationReceiptSignatureOid.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var customerSignatureServiceRecordOids = new List<long>();
|
||||
var employeeSignatureServiceRecordOids = new List<long>();
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer))
|
||||
{
|
||||
customerSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Customer];
|
||||
}
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
employeeSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Employee];
|
||||
}
|
||||
|
||||
foreach(var quittierungsbelegItem in quittierungsbelegItems)
|
||||
{
|
||||
var serviceRecordOid = quittierungsbelegItem.ServiceRecordOid;
|
||||
|
||||
quittierungsbelegItem.HasCustomerSignature = customerSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
quittierungsbelegItem.HasEmployeeSignature = employeeSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
}
|
||||
|
||||
var employeeOids = new List<long>();
|
||||
foreach(var serviceDetail in reportObject.Services)
|
||||
{
|
||||
employeeOids.AddIfNotIn(serviceDetail.EmployeeOid);
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
var serviceRecordOidsFromOtherEmployees = reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var ownServiceRecordOids = reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState2 = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState2;
|
||||
}
|
||||
|
||||
confirmationReceiptResults.Add(
|
||||
item: new QuittierungsbelegResult
|
||||
(
|
||||
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
|
||||
quittierungsbelegItems,
|
||||
reportObject.CustomerOid,
|
||||
hasCustomerSignature,
|
||||
customerSignatureOid,
|
||||
customerSignatureState,
|
||||
customerSignatureOids,
|
||||
employeeSignatureState2,
|
||||
employeeSignatureOids,
|
||||
employeeOids.Count
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.AddRangeIfElementsNotIn(confirmationReceiptResults.OrderBy(o => o.CustomerName));
|
||||
|
||||
if(Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.All(qbItem => qbItem.Items.Count == 0))
|
||||
{
|
||||
TempData[TempDataConstants.HasWarningMessageKey] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Erstellt den Zeitraum für die Auswahl
|
||||
/// </summary>
|
||||
@@ -1139,7 +918,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, true);
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
LoadPaginatedQbEntries(Model.CurrentQbEntryPage);
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
@@ -1161,7 +940,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, false);
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
LoadPaginatedQbEntries(Model.CurrentQbEntryPage);
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
@@ -1375,6 +1154,302 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult GoToFirstServiceOverviewPage()
|
||||
{
|
||||
LoadPaginatedQbEntries(1);
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult GoToLastServiceOverviewPage()
|
||||
{
|
||||
LoadPaginatedQbEntries(Model.QbEntryPageCount);
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult LoadServiceOverviewPage(int selectedPage)
|
||||
{
|
||||
LoadPaginatedQbEntries(selectedPage);
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
private void LoadPaginatedQbEntries(int selectedPage)
|
||||
{
|
||||
if(selectedPage < 1)
|
||||
{
|
||||
selectedPage = 1;
|
||||
}
|
||||
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
||||
{
|
||||
var customerOidString = Model.SelectedCustomerOid.ToString();
|
||||
|
||||
var isCustomerOidSuccessful = long.TryParse(customerOidString, out var selectedCustomerOid);
|
||||
|
||||
if(isCustomerOidSuccessful)
|
||||
{
|
||||
var selectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == selectedCustomerOid);
|
||||
|
||||
Model.SelectedCustomer = selectedCustomer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedCustomer = null;
|
||||
}
|
||||
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
|
||||
{
|
||||
var teamOidString = Model.SelectedTeamOid.ToString();
|
||||
|
||||
var isTeamOidSuccessful = long.TryParse(teamOidString, out var selectedTeamOid);
|
||||
|
||||
if(isTeamOidSuccessful)
|
||||
{
|
||||
var selectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == selectedTeamOid);
|
||||
|
||||
Model.SelectedTeam = selectedTeam;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedTeam = null;
|
||||
}
|
||||
|
||||
var reportTimeFrame = GetReportTimeFrame();
|
||||
|
||||
var reportObjects = new List<ServicesOverviewRO>();
|
||||
|
||||
var organisationOid = Model.SelectedOrganisationOid ?? 0;
|
||||
var employeeOid = Model.SelectedEmployeeOid ?? 0;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var customerOid = Model.SelectedCustomerOid ?? 0;
|
||||
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>() ?? new DefaultReportCreator();
|
||||
|
||||
Model.CurrentQbEntryPage = selectedPage;
|
||||
|
||||
var firstResult = (selectedPage - 1) * Model.MaxResults;
|
||||
var rowCount = 1;
|
||||
|
||||
switch(Model.SelectedFilterItem.FilterEnum)
|
||||
{
|
||||
case QBFilterEnum.AlleKlienten:
|
||||
reportObjects = ServicesOverviewRO.CreatePaginated(firstResult, Model.MaxResults, reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, out rowCount, serviceCategoryOid);
|
||||
break;
|
||||
case QBFilterEnum.NurKlientenMeinesTeams:
|
||||
var teamRelatedCustomerOids = creator.GetKlientenOidsMeinesTeams(null);
|
||||
|
||||
var rOs = ServicesOverviewRO.CreatePaginated(firstResult, Model.MaxResults, teamRelatedCustomerOids.ToArray(), reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, out rowCount, serviceCategoryOid);
|
||||
|
||||
reportObjects.AddRange(rOs);
|
||||
break;
|
||||
case QBFilterEnum.MeineKlienten:
|
||||
var myRelatedCustomerOids = creator.GetMeineKlientenOids();
|
||||
|
||||
var myCustomersReportObject = ServicesOverviewRO.CreatePaginated(firstResult, Model.MaxResults, myRelatedCustomerOids.ToArray(), reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, out rowCount, serviceCategoryOid);
|
||||
|
||||
reportObjects.AddRange(myCustomersReportObject);
|
||||
break;
|
||||
case QBFilterEnum.KlientenAuswahl:
|
||||
reportObjects = new List<ServicesOverviewRO> { ServicesOverviewRO.Create(customerOid, reportTimeFrame.Month, reportTimeFrame.Year, false, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid) };
|
||||
break;
|
||||
case QBFilterEnum.TeamAuswahl:
|
||||
var customerOids = creator.GetKlientenOidsMeinesTeams(teamOid);
|
||||
|
||||
var teamCustomersReportObjects = ServicesOverviewRO.CreatePaginated(firstResult, Model.MaxResults, customerOids.ToArray(), reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, out rowCount, serviceCategoryOid);
|
||||
|
||||
reportObjects.AddRange(teamCustomersReportObjects);
|
||||
break;
|
||||
default:
|
||||
reportObjects = ServicesOverviewRO.CreatePaginated(firstResult, Model.MaxResults, reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, out rowCount, serviceCategoryOid);
|
||||
break;
|
||||
}
|
||||
|
||||
var pageCount = Math.DivRem(rowCount, Model.MaxResults, out var remainder);
|
||||
|
||||
if(remainder > 0)
|
||||
{
|
||||
pageCount++;
|
||||
}
|
||||
|
||||
Model.QbEntryPageCount = pageCount;
|
||||
Model.QbEntryCount = rowCount;
|
||||
|
||||
reportObjects = reportObjects.Where(x => x != null).ToList();
|
||||
|
||||
var srOids = new List<long>();
|
||||
|
||||
reportObjects.DoForEach(x => x.Services.DoForEach(s => srOids.AddIfNotIn(s.ServiceRecordOid)));
|
||||
|
||||
Model.ConfirmationReceiptSignatures = OperationsService.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(srOids, out var serviceRecordOidsWithSignature);
|
||||
|
||||
var customerSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Customer).ToList();
|
||||
var employeeSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Employee).ToList();
|
||||
|
||||
Model.ReportServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(ro => ro.Services.DoForEach(s =>
|
||||
{
|
||||
Model.ReportServiceRecordOids.AddIfNotIn(s.ServiceRecordOid);
|
||||
}));
|
||||
|
||||
var hasEmployeeSignature = srOids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var employeeSignatureState = SignatureState.None;
|
||||
|
||||
if(anyEmployeeSignatures)
|
||||
{
|
||||
employeeSignatureState = SignatureState.Some;
|
||||
}
|
||||
|
||||
if(hasEmployeeSignature)
|
||||
{
|
||||
employeeSignatureState = SignatureState.All;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
// Prüfen, ob alle eigenen ServiceRecords unterschrieben sind
|
||||
var ownServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => ownServiceRecordOids.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
// Prüfen, ob Einträge von anderen Mitarbeitern existieren
|
||||
var serviceRecordOidsFromOtherEmployees = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => serviceRecordOidsFromOtherEmployees.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState;
|
||||
}
|
||||
|
||||
Model.ConfirmationReceiptObject = null;
|
||||
Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
|
||||
BuildInformationString(),
|
||||
new List<QuittierungsbelegResult>(),
|
||||
BuildInformationString(true),
|
||||
GetTimeSpanString(),
|
||||
hasEmployeeSignature,
|
||||
employeeSignatures.ToList(),
|
||||
employeeSignatureState);
|
||||
|
||||
var confirmationReceiptResults = new List<QuittierungsbelegResult>();
|
||||
|
||||
reportObjects.DoForEach(reportObject =>
|
||||
{
|
||||
var quittierungsbelegItems = new List<QuittierungsbelegItem>();
|
||||
|
||||
reportObject.Services.DoForEach(serviceDetail =>
|
||||
{
|
||||
quittierungsbelegItems.Add(new QuittierungsbelegItem(serviceDetail));
|
||||
});
|
||||
|
||||
if(quittierungsbelegItems.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
|
||||
|
||||
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Customer, a));
|
||||
|
||||
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
|
||||
|
||||
var customerSignatureState = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Customer);
|
||||
|
||||
var customerSignatureOid = hasCustomerSignature ? customerSignatures.FirstOrDefault(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value)))?.ConfirmationReceiptSignatureOid : null;
|
||||
var sigs = customerSignatures.Where(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value))).ToList();
|
||||
|
||||
var customerSignatureOids = sigs.Where(signature => signature.ConfirmationReceiptSignatureOid.HasValue).Select(signature => signature.ConfirmationReceiptSignatureOid.Value).ToList();
|
||||
|
||||
var employeeSignatureOids = new List<long>();
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
foreach(var signature in employeeSignatures.Where(s => s.ConfirmationReceiptSignatureOid.HasValue))
|
||||
{
|
||||
foreach(var serviceRecord in signature.ServiceRecords)
|
||||
{
|
||||
var oid = serviceRecord.ServiceRecordOid;
|
||||
|
||||
if(oid.HasValue && oids.Contains(oid.Value))
|
||||
{
|
||||
employeeSignatureOids.AddIfNotIn(signature.ConfirmationReceiptSignatureOid.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var customerSignatureServiceRecordOids = new List<long>();
|
||||
var employeeSignatureServiceRecordOids = new List<long>();
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer))
|
||||
{
|
||||
customerSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Customer];
|
||||
}
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
employeeSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Employee];
|
||||
}
|
||||
|
||||
foreach(var quittierungsbelegItem in quittierungsbelegItems)
|
||||
{
|
||||
var serviceRecordOid = quittierungsbelegItem.ServiceRecordOid;
|
||||
|
||||
quittierungsbelegItem.HasCustomerSignature = customerSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
quittierungsbelegItem.HasEmployeeSignature = employeeSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
}
|
||||
|
||||
var employeeOids = new List<long>();
|
||||
foreach(var serviceDetail in reportObject.Services)
|
||||
{
|
||||
employeeOids.AddIfNotIn(serviceDetail.EmployeeOid);
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
var serviceRecordOidsFromOtherEmployees = reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var ownServiceRecordOids = reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState2 = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState2;
|
||||
}
|
||||
|
||||
confirmationReceiptResults.Add(
|
||||
item: new QuittierungsbelegResult
|
||||
(
|
||||
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
|
||||
quittierungsbelegItems,
|
||||
reportObject.CustomerOid,
|
||||
hasCustomerSignature,
|
||||
customerSignatureOid,
|
||||
customerSignatureState,
|
||||
customerSignatureOids,
|
||||
employeeSignatureState2,
|
||||
employeeSignatureOids,
|
||||
employeeOids.Count
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.AddRangeIfElementsNotIn(confirmationReceiptResults.OrderBy(o => o.CustomerName));
|
||||
|
||||
if(Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.All(qbItem => qbItem.Items.Count == 0))
|
||||
{
|
||||
TempData[TempDataConstants.HasWarningMessageKey] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmationReceiptSignatureObject
|
||||
|
||||
@@ -14,7 +14,6 @@ using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
using DevExpress.XtraEditors.Filtering.Templates;
|
||||
|
||||
namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
@@ -78,9 +77,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
? EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid)
|
||||
: EmployeeService.FindLeadingCompactTeamsOfEmployee(MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid);
|
||||
|
||||
if(!AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
if(false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll || Model.SelectedEmployee is null)
|
||||
{
|
||||
Model.SelectedEmployeeOid = MobileSessionFacade.LoggedInCompactEmployee.EmployeeOid;
|
||||
Model.SelectedEmployee = MobileSessionFacade.LoggedInCompactEmployee;
|
||||
}
|
||||
|
||||
Model.ReportTypes = new List<SelectListItem>();
|
||||
@@ -346,7 +345,47 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult LoadMitarbeiterstundenkonto(string parameters)
|
||||
public string SetEmployeeForMitarbeiterstundenkonto(long? employeeOid)
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(employeeOid is null)
|
||||
{
|
||||
Model.SelectedEmployee = null;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedEmployee = Model.AllEmployees.FirstOrDefault(employee => employee.EmployeeOid.Equals(employeeOid.Value));
|
||||
|
||||
return Model.SelectedEmployee?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string SetTeamForMitarbeiterstundenkonto(long? teamOid)
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
TempData[TempDataConstants.DoLogoutKey] = true;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
if(teamOid is null)
|
||||
{
|
||||
Model.SelectedTeam = null;
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
Model.SelectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid.Equals(teamOid.Value));
|
||||
|
||||
return Model.SelectedTeam?.DetailDescription ?? LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult LoadMitarbeiterstundenkonto(int ansicht, int month, int year, bool all, bool isEmployee)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
{
|
||||
@@ -354,79 +393,58 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("BeWoReportPartial");
|
||||
}
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(parameters))
|
||||
var teamOids = new List<long>();
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var oid = isEmployee ? employeeOid ?? Model.Employee.EmployeeOid.Value : Model.SelectedTeamOid;
|
||||
|
||||
if(isEmployee)
|
||||
{
|
||||
var splitParameters = parameters.Split(';');
|
||||
employeeOid = oid;
|
||||
|
||||
if(splitParameters.Length == 6)
|
||||
if(all || false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
var month = int.Parse(splitParameters[0]);
|
||||
var year = int.Parse(splitParameters[1]);
|
||||
var isEmployee = bool.Parse(splitParameters[2]);
|
||||
var all = bool.Parse(splitParameters[3]);
|
||||
long? employeeOid = null;
|
||||
List<long> teamOids = null;
|
||||
long? oid = null;
|
||||
employeeOid = null;
|
||||
}
|
||||
|
||||
if(long.TryParse(splitParameters[4], out var oOid))
|
||||
{
|
||||
oid = oOid;
|
||||
}
|
||||
if(employeeOid.HasValue)
|
||||
{
|
||||
employeeOid = oid;
|
||||
}
|
||||
|
||||
var ansicht = int.Parse(splitParameters[5]);
|
||||
|
||||
if(isEmployee)
|
||||
{
|
||||
employeeOid = oid;
|
||||
|
||||
if(all || !AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
employeeOid = null;
|
||||
}
|
||||
|
||||
if(!(employeeOid is null))
|
||||
{
|
||||
employeeOid = oid;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
employeeOid = Model.Employee.EmployeeOid;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
teamOids = new List<long>();
|
||||
|
||||
var teamOid = oid;
|
||||
|
||||
if(all || (!AbstractModel.HasRightMitarbeiterstundenkontoViewAll && !AbstractModel.HasRightMitarbeiterstundenkontoViewTeams))
|
||||
{
|
||||
teamOid = null;
|
||||
}
|
||||
|
||||
if(!(teamOid is null))
|
||||
{
|
||||
teamOid = oid;
|
||||
}
|
||||
|
||||
if(teamOid > 0 && !all)
|
||||
{
|
||||
teamOids.Add(teamOid.Value);
|
||||
}
|
||||
else if(all)
|
||||
{
|
||||
teamOids.AddRange(Model.AllTeams.Select(team => team.TeamOid));
|
||||
}
|
||||
}
|
||||
|
||||
var start = new DateTime(year, month, 1);
|
||||
var end = start.AddMonths(1);
|
||||
var report = Model.ReportCreator.CreateEmployeeHourReport(employeeOid, teamOids, start, end, ansicht);
|
||||
Model.Report = report;
|
||||
if(false == AbstractModel.HasRightMitarbeiterstundenkontoViewAll)
|
||||
{
|
||||
employeeOid = Model.Employee.EmployeeOid;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var teamOid = oid;
|
||||
|
||||
if(all || (!AbstractModel.HasRightMitarbeiterstundenkontoViewAll && !AbstractModel.HasRightMitarbeiterstundenkontoViewTeams))
|
||||
{
|
||||
teamOid = null;
|
||||
}
|
||||
|
||||
if(teamOid != null)
|
||||
{
|
||||
teamOid = oid;
|
||||
}
|
||||
|
||||
if(teamOid > 0 && !all)
|
||||
{
|
||||
teamOids.Add(teamOid.Value);
|
||||
}
|
||||
else if(all)
|
||||
{
|
||||
teamOids.AddRange(Model.AllTeams.Select(team => team.TeamOid));
|
||||
}
|
||||
}
|
||||
|
||||
var start = new DateTime(year, month, 1);
|
||||
var end = start.AddMonths(1);
|
||||
|
||||
Model.Report = Model.ReportCreator.CreateEmployeeHourReport(employeeOid, teamOids, start, end, ansicht);
|
||||
|
||||
return PartialView("BeWoReportPartial", Model);
|
||||
}
|
||||
|
||||
@@ -536,7 +554,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("BerichteFormPartialView");
|
||||
}
|
||||
|
||||
if((objectOid.HasValue || textValue != null) && parameterOid.HasValue)
|
||||
if(parameterOid.HasValue)
|
||||
{
|
||||
var queryParameterType = (QueryParameterType)parameterType;
|
||||
|
||||
@@ -544,7 +562,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
case QueryParameterType.Custom:
|
||||
throw new NotImplementedException("Dieser Parametertyp wird noch nicht unterstützt!");
|
||||
break;
|
||||
case QueryParameterType.Customer:
|
||||
if(objectOid is null || objectOid.Value.Equals(0))
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(AbstractModel.HasRightToInsertRessourceAppointments)
|
||||
if(AbstractModel.HasRightToInsertRessourceAppointments || AbstractModel.HasRightToViewAllResourceAppointments)
|
||||
{
|
||||
var allResources = KalenderService.GetAllResources().OrderBy(r => r.Name).ToList();
|
||||
|
||||
@@ -125,6 +125,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var appointments = KalenderService.LoadFilteredAppointmentsMitAufgaben(AbstractModel.HasRightToViewEmployeeAppointments, Model.Employee.EmployeeOid.Value, start.Date, end, selectedEmployees, selectedCustomers, selectedResources, false, false, false, false, true, true).ToList();
|
||||
|
||||
foreach(var appointment in appointments.Where(a => a.IsPrivate))
|
||||
{
|
||||
if(appointment.Originator.Equals(MobileSessionFacade.LoggedInCompactEmployee) || appointment.EmployeeList.Any(e2a => e2a.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
appointment.CanBeEdited = false;
|
||||
appointment.Description = "Privater Termin";
|
||||
appointment.Subject = $"Privat ({appointment.Originator})";
|
||||
}
|
||||
|
||||
var tasks = appointments.Where(w => w.IsTask && w.CompletedDate is null).ToList();
|
||||
|
||||
// Nur eigene Kliententermine ansehen
|
||||
@@ -146,6 +158,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
// Wenn es ein ganztägiger Termin ist, eine Sekunde abziehen und beim Speichern wieder draufaddieren?
|
||||
foreach(var app in appointments.Where(a => a.AllDay))
|
||||
{
|
||||
if(app.EndDate is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
app.EndDate = app.EndDate.Value.AddMinutes(-1);
|
||||
}
|
||||
|
||||
@@ -688,23 +705,23 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
var d = formCollection["Duration"];
|
||||
var s = formCollection["IntervalStart"].Substring(0, 10);
|
||||
var st = formCollection["IntervalStartTime"];
|
||||
var e = formCollection["IntervalEnd"].Substring(0, 10);
|
||||
var et = formCollection["IntervalEndTime"];
|
||||
var durationString = formCollection["Duration"];
|
||||
var intervalStartDateString = formCollection["IntervalStart"].Substring(0, 10);
|
||||
var intervalStartTimeString = formCollection["IntervalStartTime"];
|
||||
var intervalEndDateString = formCollection["IntervalEnd"].Substring(0, 10);
|
||||
var intervalEndTimeString = formCollection["IntervalEndTime"];
|
||||
|
||||
if (int.TryParse(d, out var duration) && DateTime.TryParse($"{s} {st}", out var start) && DateTime.TryParse($"{e} {et}", out var end) && Model.Employee.EmployeeOid.HasValue)
|
||||
if(int.TryParse(durationString, out var intervalDuration) && DateTime.TryParse($"{intervalStartDateString} {intervalStartTimeString}", out var intervalStart) && DateTime.TryParse($"{intervalEndDateString} {intervalEndTimeString}", out var intervalEnd) && Model.Employee.EmployeeOid.HasValue)
|
||||
{
|
||||
var customerOids = Model.SelectedCustomersForIntervalFinder.Select(c => c.CustomerOid).ToList();
|
||||
var employeeOids = Model.SelectedEmployeesForIntervalFinder.Select(m => m.EmployeeOid).ToList();
|
||||
var resourceOids = Model.SelectedResourcesForIntervalFinder.Where(w => w.ResourceOid.HasValue).Select(r => r.ResourceOid.Value).ToList();
|
||||
var customerOids = Model.SelectedCustomersForIntervalFinder.Select(customer => customer.CustomerOid).ToList();
|
||||
var employeeOids = Model.SelectedEmployeesForIntervalFinder.Select(employee => employee.EmployeeOid).ToList();
|
||||
var resourceOids = Model.SelectedResourcesForIntervalFinder.Where(resource => resource.ResourceOid.HasValue).Select(r => r.ResourceOid.Value).ToList();
|
||||
|
||||
Model.FreeIntervals = KalenderService.FindAppointmentsInRange(duration, start, end, resourceOids, customerOids, employeeOids, Model.Employee.EmployeeOid.Value);
|
||||
Model.FreeIntervals = KalenderService.FindAppointmentsInRangeForIntervalFinder(intervalDuration, intervalStart, intervalEnd, resourceOids, customerOids, employeeOids, Model.Employee.EmployeeOid.Value);
|
||||
|
||||
Model.IntervalStartDate = start;
|
||||
Model.IntervalEndDate = end;
|
||||
Model.IntervalDuration = duration;
|
||||
Model.IntervalStartDate = intervalStart;
|
||||
Model.IntervalEndDate = intervalEnd;
|
||||
Model.IntervalDuration = intervalDuration;
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
@@ -816,11 +833,11 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.SelectedAppointment = new SchedulerAppointmentDC()
|
||||
{
|
||||
ActivationType = ActivationTypeId.Active,
|
||||
IsTask = false,
|
||||
IsPrivate = false,
|
||||
Originator = MobileSessionFacade.LoggedInCompactEmployee,
|
||||
StartDate = startDate,
|
||||
EndDate = endDate
|
||||
IsTask = false,
|
||||
IsPrivate = false,
|
||||
Originator = MobileSessionFacade.LoggedInCompactEmployee,
|
||||
StartDate = startDate,
|
||||
EndDate = endDate
|
||||
};
|
||||
|
||||
Model.SelectedCustomers = Model.SelectedCustomersForIntervalFinder.Clone();
|
||||
@@ -832,7 +849,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.SelectedResourcesForIntervalFinder.Clear();
|
||||
|
||||
Model.IntervalStartDate = null;
|
||||
Model.IntervalEndDate = null;
|
||||
Model.IntervalEndDate = null;
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("Scheduler");
|
||||
|
||||
@@ -419,7 +419,7 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
var start = serviceRecord.Start.Value;
|
||||
var end = serviceRecord.End.Value;
|
||||
var end = start.AddMinutes((int) serviceRecord.RoundedDuration);//serviceRecord.End.Value;
|
||||
|
||||
if(start.Second == 0)
|
||||
{
|
||||
|
||||
@@ -21,23 +21,6 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public CompactCustomerDC SelectedCustomer { get; set; }
|
||||
|
||||
public List<CompactCustomerDC> Customers { get; set; }
|
||||
|
||||
public IEnumerable<SelectListItem> CustomerListItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
if(Customers != null)
|
||||
{
|
||||
result.AddRange(Customers.Select(customer => new SelectListItem {Value = customer.CustomerOid.ToString(), Text = customer.ToString()}));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name = "Monat")]
|
||||
public int? SelectedMonth { get; set; }
|
||||
|
||||
@@ -119,27 +102,6 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
|
||||
public List<CompactEmployeeDC> Employees { get; set; } = new List<CompactEmployeeDC>();
|
||||
|
||||
public List<SelectListItem> EmployeeItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
foreach(var employee in Employees)
|
||||
{
|
||||
result.AddIfNotIn(new SelectListItem
|
||||
{
|
||||
Value = employee.EmployeeOid.ToString(),
|
||||
Text = employee.ToString()
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name="Kostenträger")]
|
||||
public long? SelectedOrganisationOid => SelectedOrganisation?.OrganisationOid;
|
||||
|
||||
@@ -147,25 +109,6 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
public List<CompactOrganisationDC> Organisations { get; set; } = new List<CompactOrganisationDC>();
|
||||
|
||||
public List<SelectListItem> OrganisationItems
|
||||
{
|
||||
get
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
foreach(var organisation in Organisations)
|
||||
{
|
||||
result.AddIfNotIn(new SelectListItem()
|
||||
{
|
||||
Value = organisation.OrganisationOid.ToString(),
|
||||
Text = organisation.Name
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
[Display(Name="Leistungskategorie")]
|
||||
public long? SelectedServiceCategoryOid => SelectedServiceCategory?.ServiceCategoryOid;
|
||||
|
||||
@@ -287,5 +230,10 @@ namespace BeWoPlanerMobil.Models
|
||||
public AbstractReportCreator ReportCreator { get; set; }
|
||||
|
||||
public XtraReport QuittierungsbelegsReportObject { get; set; }
|
||||
|
||||
public int QbEntryCount { get; set; }
|
||||
public int MaxResults { get; set; } = 10;
|
||||
public int QbEntryPageCount { get; set; }
|
||||
public int CurrentQbEntryPage { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ using BeWo.Report;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
@@ -94,8 +93,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
|
||||
[Display(Name="Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid { get; set; }
|
||||
[Display(Name = "Mitarbeiter")]
|
||||
public long? SelectedEmployeeOid => SelectedEmployee?.EmployeeOid;
|
||||
public CompactEmployeeDC SelectedEmployee { get; set; }
|
||||
public List<SelectListItem> Employees
|
||||
{
|
||||
get
|
||||
@@ -125,8 +125,9 @@ namespace BeWoPlanerMobil.Models
|
||||
}
|
||||
|
||||
|
||||
[Display(Name = "Team")]
|
||||
public long? SelectedTeamOid { get; set; }
|
||||
[Display(Name = "Team")]
|
||||
public long? SelectedTeamOid => SelectedTeam?.TeamOid;
|
||||
public CompactTeamDC SelectedTeam { get; set; }
|
||||
public List<SelectListItem> Teams
|
||||
{
|
||||
get
|
||||
|
||||
@@ -154,7 +154,25 @@ namespace BeWoPlanerMobil.Models
|
||||
public List<CompactCustomerDC> SelectedCustomersForIntervalFinder { get; set; } = new List<CompactCustomerDC>();
|
||||
public List<ResourceDC> SelectedResourcesForIntervalFinder { get; set; } = new List<ResourceDC>();
|
||||
|
||||
public Dictionary<DateTime, List<DateTimeSpan>> FreeIntervals { get; set; } = new Dictionary<DateTime, List<DateTimeSpan>>();
|
||||
public Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> FreeIntervals { get; set; } = new Dictionary<DateTimeSpan, Dictionary<DateTime, bool>>();
|
||||
|
||||
public List<DateTime> FreeIntervalDays
|
||||
{
|
||||
get
|
||||
{
|
||||
var days = new List<DateTime>();
|
||||
|
||||
foreach(var date2HasFreeSlot in FreeIntervals.Values)
|
||||
{
|
||||
foreach(var date in date2HasFreeSlot.Keys)
|
||||
{
|
||||
days.AddIfNotIn(date.Date);
|
||||
}
|
||||
}
|
||||
|
||||
return days;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsInIntervalFinderMode { get; set; }
|
||||
public DateTime? IntervalStartDate { get; set; }
|
||||
|
||||
@@ -167,7 +167,7 @@ function cloneCanvas(oldCanvas) {
|
||||
function showAlertMessageBoxWithoutCallback(title, message) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
$("#messagePopup .modal-body").html(`<div class="row"><div class="col-auto"><span class="fas fa-exclamation-triangle fa-3x text-alert"></span></div><div class="col">${message}</div></div>`);
|
||||
$("#messagePopup .modal-body").html(`<div class="row"><div class="col-auto"><span class="fas fa-exclamation-triangle fa-3x text-danger"></span></div><div class="col">${message}</div></div>`);
|
||||
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
function resetEntitySearch(cancelButtonJQueryObject) {
|
||||
try {
|
||||
const button = cancelButtonJQueryObject;
|
||||
const inputGroupAppend = button.parent();
|
||||
const inputGroup = inputGroupAppend.parent();
|
||||
const modalBody = inputGroup.parent();
|
||||
const input = inputGroupAppend.siblings("input");
|
||||
|
||||
input.val("");
|
||||
modalBody.children(".list-group").children(".list-group-item").show();
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function onEntitySearchInput(searchInput) {
|
||||
try {
|
||||
const input = $(searchInput);
|
||||
const modalBody = input.parent().parent();
|
||||
|
||||
var searchText = input.val();
|
||||
|
||||
if(searchText === null || searchText === undefined || searchText.length === 0) {
|
||||
modalBody.find(".list-group").children(".list-group-item").show();
|
||||
return;
|
||||
}
|
||||
|
||||
const listGroupItems = modalBody.find(".list-group").children(".list-group-item").show();
|
||||
|
||||
listGroupItems.hide();
|
||||
|
||||
searchText = searchText.toLowerCase();
|
||||
|
||||
$.each(listGroupItems, function (index, item) {
|
||||
if($(item).text().toLowerCase().includes(searchText)) {
|
||||
$(item).show();
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
}
|
||||
|
||||
function setSelectedEmployee() {
|
||||
var employeeOid = parseInt($("#employeesDropDown").find(":selected").val());
|
||||
const employeeOid = parseInt($("#employeesDropDown").find(":selected").val());
|
||||
|
||||
if (isNaN(employeeOid)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.get(getSetServiceRecordEmployeeUrl(), { employeeOid: employeeOid });
|
||||
$.get(window.getSetServiceRecordEmployeeUrl(), { employeeOid: employeeOid });
|
||||
}
|
||||
|
||||
function checkJson(str) {
|
||||
@@ -32,9 +32,9 @@ function showAlertMessage(message) {
|
||||
function resetCreateForm() {
|
||||
$("#serviceRecordCreationForm").trigger("reset");
|
||||
|
||||
var test = $("#has-any-rating-types").val().toLowerCase() === "true";
|
||||
const test = $("#has-any-rating-types").val().toLowerCase() === "true";
|
||||
|
||||
if (test) {
|
||||
if(test) {
|
||||
$(".goal-rating-badge").text("Bewerten");
|
||||
} else {
|
||||
$(".goal-rating-badge").text("");
|
||||
@@ -82,7 +82,7 @@ function activateGroupBookingForm() {
|
||||
function deleteServiceRecord(serviceRecordOid) {
|
||||
showMessagePopupWithCallback("Eintrag löschen", "Sind Sie sicher, dass Sie den Eintrag löschen möchten?",
|
||||
function() {
|
||||
var url = getValidateServiceRecordDeletionUrl();
|
||||
const url = window.getValidateServiceRecordDeletionUrl();
|
||||
|
||||
$.get(url, { serviceRecordOidString: serviceRecordOid }).done(function(result) {
|
||||
if(result === "Error") {
|
||||
@@ -101,7 +101,6 @@ function deleteServiceRecord(serviceRecordOid) {
|
||||
|
||||
if(result.length === 0) {
|
||||
if(form.length !== 0) {
|
||||
logError("Sollte nicht mehr eintreffen; serviceRecordOid: " + serviceRecordOid);
|
||||
$("#oidHolder").val(serviceRecordOid);
|
||||
|
||||
showSpinner();
|
||||
@@ -110,7 +109,7 @@ function deleteServiceRecord(serviceRecordOid) {
|
||||
} else { // Meldungen
|
||||
hideSpinner();
|
||||
|
||||
var validationResult = parseJason(result);
|
||||
const validationResult = parseJason(result);
|
||||
|
||||
if(validationResult.Message === null) {
|
||||
$("#oidHolder").val(serviceRecordOid);
|
||||
@@ -124,7 +123,7 @@ function deleteServiceRecord(serviceRecordOid) {
|
||||
|
||||
var kannTrotzdemGespeichertWerden = validationResult.KannTrotzdemGespeichertWerden;
|
||||
|
||||
var validationCallback = function() {
|
||||
const validationCallback = function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
if(kannTrotzdemGespeichertWerden) {
|
||||
showSpinner();
|
||||
@@ -153,19 +152,19 @@ function validateForm(form, prefix) {
|
||||
}
|
||||
|
||||
var errorMessage = "";
|
||||
var isNoticeMandatory = getIsDocumentationMandatory();
|
||||
var numberOfNoticeTextareas = getNumberOfDokutypes();
|
||||
var isNoticeMandatory = window.getIsDocumentationMandatory();
|
||||
var numberOfNoticeTextareas = window.getNumberOfDokutypes();
|
||||
|
||||
var isValid = true;
|
||||
|
||||
if(isNoticeMandatory) {
|
||||
if(numberOfNoticeTextareas === 0) {
|
||||
var doku = $("#" + prefix + "dokufeld").val();
|
||||
var doku = $(`#${prefix}dokufeld`).val();
|
||||
|
||||
isValid = doku.length > 0;
|
||||
} else {
|
||||
for(var i = 0; i < numberOfNoticeTextareas; i++) {
|
||||
var d = $("#" + prefix + "doku-textarea-" + i).val();
|
||||
var d = $(`#${prefix}doku-textarea-${i}`).val();
|
||||
|
||||
isValid = d.length > 0;
|
||||
|
||||
@@ -176,7 +175,7 @@ function validateForm(form, prefix) {
|
||||
}
|
||||
|
||||
if(isValid === false) {
|
||||
errorMessage = "Bitte füllen Sie " + (numberOfNoticeTextareas > 1 ? "mindestens ein" : "das") + " Dokumentationsfeld aus.<br/>";
|
||||
errorMessage = `Bitte füllen Sie ${numberOfNoticeTextareas > 1 ? "mindestens ein" : "das"} Dokumentationsfeld aus.<br/>`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,19 +236,19 @@ function validateForm(form, prefix) {
|
||||
|
||||
function getDokuTexte() {
|
||||
try {
|
||||
var noticeList = [null, null, null, null, null];
|
||||
const noticeList = [null, null, null, null, null];
|
||||
|
||||
var isMultiBooking = $("#mb-dokufeld").length > 0 || $("#mb-doku-textarea-0").length > 0;
|
||||
const isMultiBooking = $("#mb-dokufeld").length > 0 || $("#mb-doku-textarea-0").length > 0;
|
||||
|
||||
var multiBookingPrefix = isMultiBooking ? "mb-" : "";
|
||||
const multiBookingPrefix = isMultiBooking ? "mb-" : "";
|
||||
|
||||
var hasMultipleDokufelder = $("#" + multiBookingPrefix + "dokufeld").length === 0;
|
||||
const hasMultipleDokufelder = $(`#${multiBookingPrefix}dokufeld`).length === 0;
|
||||
|
||||
var dokufeldCounter = 0;
|
||||
let dokufeldCounter = 0;
|
||||
|
||||
if(hasMultipleDokufelder) {
|
||||
for(var i = 0; i < 5; i++) {
|
||||
var dokufeld = $("#" + multiBookingPrefix + "doku-textarea-" + i);
|
||||
for(let i = 0; i < 5; i++) {
|
||||
const dokufeld = $(`#${multiBookingPrefix}doku-textarea-${i}`);
|
||||
|
||||
if(dokufeld.length > 0) {
|
||||
noticeList[i] = dokufeld.val();
|
||||
@@ -257,22 +256,22 @@ function getDokuTexte() {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
noticeList[0] = $("#" + multiBookingPrefix + "dokufeld").val();
|
||||
noticeList[0] = $(`#${multiBookingPrefix}dokufeld`).val();
|
||||
dokufeldCounter = 1;
|
||||
}
|
||||
|
||||
var x = "";
|
||||
for (var ii = 0; ii < dokufeldCounter; ii++) {
|
||||
let x = "";
|
||||
for(let ii = 0; ii < dokufeldCounter; ii++) {
|
||||
x += noticeList[ii];
|
||||
|
||||
if (ii < noticeList.length - 1) {
|
||||
if(ii < noticeList.length - 1) {
|
||||
x += ", ";
|
||||
}
|
||||
}
|
||||
|
||||
return noticeList;
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +280,7 @@ function showGoalRatingPopup(goalOid) {
|
||||
$("#goal-rating-popup").modal("show");
|
||||
$("#goal-to-rate-oid").val(goalOid);
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,21 +288,21 @@ function hideGoalRatingPopup() {
|
||||
try {
|
||||
$("#goal-rating-popup").modal("hide");
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function checkChildNodes(parentOid) {
|
||||
var rootElement = $("#c-" + parentOid);
|
||||
var checkboxes = rootElement.find("input");
|
||||
const rootElement = $(`#c-${parentOid}`);
|
||||
const checkboxes = rootElement.find("input");
|
||||
|
||||
var isChecked = $("#" + parentOid).prop("checked") === true;
|
||||
var isChecked = $(`#${parentOid}`).prop("checked") === true;
|
||||
|
||||
$.each(checkboxes, function(index, checkbox) {
|
||||
var box = $(checkbox);
|
||||
var id = box.attr("id");
|
||||
const box = $(checkbox);
|
||||
const id = box.attr("id");
|
||||
|
||||
if(!id !== parentOid) {
|
||||
box.prop("checked", isChecked);
|
||||
@@ -320,11 +319,9 @@ function validateDistanceInput() {
|
||||
}
|
||||
|
||||
function checkNumberInput(inputId) {
|
||||
var input = $("#" + inputId).val();
|
||||
const input = $(`#${inputId}`).val();
|
||||
|
||||
var isNum = /^\d+$/.test(input);
|
||||
|
||||
return isNum;
|
||||
return /^\d+$/.test(input);
|
||||
}
|
||||
|
||||
// Wird bei der Validierung des Formulars benutzt
|
||||
@@ -333,10 +330,10 @@ function getStartAndEndDate(prefix) {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
var startTimePicker = $("#" + prefix + "start-time-picker");
|
||||
var endTimePicker = $("#" + prefix + "end-time-picker");
|
||||
var startDatePicker = $("#" + prefix + "start-date-picker");
|
||||
var endDatePicker = $("#" + prefix + "end-date-picker");
|
||||
var startTimePicker = $(`#${prefix}start-time-picker`);
|
||||
var endTimePicker = $(`#${prefix}end-time-picker`);
|
||||
var startDatePicker = $(`#${prefix}start-date-picker`);
|
||||
var endDatePicker = $(`#${prefix}end-date-picker`);
|
||||
|
||||
startDatePicker.datetimepicker("show");
|
||||
startDatePicker.datetimepicker("hide");
|
||||
@@ -421,7 +418,7 @@ function supportConceptSearchOnChange() {
|
||||
try {
|
||||
var text = $("#support-concept-search-input").val().toLowerCase();
|
||||
|
||||
var links = $(".blubb-test");
|
||||
const links = $(".blubb-test");
|
||||
|
||||
if (text.length === 0) {
|
||||
links.show();
|
||||
@@ -429,7 +426,7 @@ function supportConceptSearchOnChange() {
|
||||
|
||||
$.each(links,
|
||||
function(index, item) {
|
||||
var supportConcept = $(item);
|
||||
const supportConcept = $(item);
|
||||
|
||||
if(supportConcept.find(".supportconcept-name-header").text().toLowerCase().includes(text)) {
|
||||
supportConcept.show();
|
||||
@@ -439,7 +436,7 @@ function supportConceptSearchOnChange() {
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -448,19 +445,19 @@ function resetSupportConceptSearch() {
|
||||
$("#support-concept-search-input").val("");
|
||||
$(".blubb-test").show();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function getSignatureImage(serviceRecordOid, signatureOid) {
|
||||
try {
|
||||
var url = getGetSignatureImageUrl();
|
||||
const url = window.getGetSignatureImageUrl();
|
||||
|
||||
$.get(url, { serviceRecordOid: serviceRecordOid, signatureOid: signatureOid }).done(function(textAndImage) {
|
||||
var kek = textAndImage.split(";");
|
||||
const text2Image = textAndImage.split(";");
|
||||
|
||||
var serviceRecordDescription = kek[0];
|
||||
var imageData = kek[1] + ";" + kek[2];
|
||||
const serviceRecordDescription = text2Image[0];
|
||||
const imageData = text2Image[1] + ";" + text2Image[2];
|
||||
|
||||
$("#signature-text").html(serviceRecordDescription);
|
||||
$("#signature-img").attr("src", imageData);
|
||||
@@ -468,18 +465,18 @@ function getSignatureImage(serviceRecordOid, signatureOid) {
|
||||
$("#signature-img-popup").modal("show");
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setServiceDescription(id) {
|
||||
try {
|
||||
var url = getSetServiceDescriptionUrl();
|
||||
const url = window.getSetServiceDescriptionUrl();
|
||||
|
||||
var selectedServiceDescription = $("#" + id).find(":selected").val();
|
||||
const selectedServiceDescription = $(`#${id}`).find(":selected").val();
|
||||
|
||||
$.get(url, {pServiceDescriptionOid: selectedServiceDescription});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
function initializeReportView() {
|
||||
checkForExistingSignature();
|
||||
qbFilterSelectionChange();
|
||||
window.checkForExistingSignature();
|
||||
window.qbFilterSelectionChange();
|
||||
}
|
||||
|
||||
function calculateDays() {
|
||||
var month = $("#month-select option:selected").val();
|
||||
var year = $("#year-select option:selected").val();
|
||||
const month = $("#month-select option:selected").val();
|
||||
const year = $("#year-select option:selected").val();
|
||||
|
||||
var monthInt = parseInt(month, 10) - 1;
|
||||
const monthInt = parseInt(month, 10) - 1;
|
||||
|
||||
var begin = moment(new Date(year, monthInt, 1)).date();
|
||||
var end = moment(new Date(year, monthInt, 1)).add(1, "months").add(-1, "days").date();
|
||||
const begin = window.moment(new Date(year, monthInt, 1)).date();
|
||||
const end = window.moment(new Date(year, monthInt, 1)).add(1, "months").add(-1, "days").date();
|
||||
|
||||
$("#start-day-select").empty();
|
||||
$("#end-day-select").empty();
|
||||
|
||||
for (var i = begin; i <= end; i++) {
|
||||
var option = new Option(i, i);
|
||||
var option2 = new Option(i, i);
|
||||
for(let i = begin; i <= end; i++) {
|
||||
const option = new Option(i, i);
|
||||
const option2 = new Option(i, i);
|
||||
|
||||
$("#start-day-select").append(option);
|
||||
$("#end-day-select").append(option2);
|
||||
@@ -26,14 +26,14 @@ function calculateDays() {
|
||||
$("#start-day-select").val(1);
|
||||
$("#end-day-select").val(end);
|
||||
|
||||
var startDay = $("#start-day-select option:selected").val();
|
||||
var endDay = $("#end-day-select option:selected").val();
|
||||
const startDay = $("#start-day-select option:selected").val();
|
||||
const endDay = $("#end-day-select option:selected").val();
|
||||
|
||||
if(startDay === 0 || endDay === 0 || year === 0 || month === 0 || areUndefinedOrNull([month, year, startDay, endDay])) {
|
||||
return;
|
||||
}
|
||||
|
||||
var changeDateSelectionUrl = getChangeDateSelectionUrl();
|
||||
const changeDateSelectionUrl = window.getChangeDateSelectionUrl();
|
||||
|
||||
$.get(changeDateSelectionUrl, { startDayString: startDay, endDayString: endDay, monthString: month, yearString: year});
|
||||
}
|
||||
@@ -48,7 +48,7 @@ function hideSigningParts(canSign) {
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ function confirmReportSignatureCancellation() {
|
||||
$("#report-signature-container").removeClass("d-block");
|
||||
$("#report-form-container").show();
|
||||
|
||||
var canvas = document.getElementById("sketch-pad");
|
||||
var context = canvas.getContext("2d", {willReadFrequently: true});
|
||||
const canvas = document.getElementById("sketch-pad");
|
||||
const context = canvas.getContext("2d", {willReadFrequently: true});
|
||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
}, false);
|
||||
@@ -67,25 +67,25 @@ function confirmReportSignatureCancellation() {
|
||||
|
||||
function onMonthOrYearChange() {
|
||||
calculateDays();
|
||||
checkForExistingSignature();
|
||||
window.checkForExistingSignature();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, overridingAlertId) {
|
||||
try {
|
||||
if (canSign === false) {
|
||||
if(canSign === false) {
|
||||
hideSignatureContainer(signatureContainer, overridingAlertId);
|
||||
signaturePad.clear();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var canvas = document.getElementById(canvasId);
|
||||
var twoDContext = canvas.getContext("2d", {willReadFrequently: true});
|
||||
const canvas = document.getElementById(canvasId);
|
||||
const twoDContext = canvas.getContext("2d", {willReadFrequently: true});
|
||||
|
||||
var width = canvas.getBoundingClientRect().width;
|
||||
var height = canvas.getBoundingClientRect().height;
|
||||
const width = canvas.getBoundingClientRect().width;
|
||||
const height = canvas.getBoundingClientRect().height;
|
||||
|
||||
if (width === 0 || height === 0) {
|
||||
hideSignatureContainer(signatureContainer, overridingAlertId);
|
||||
@@ -94,7 +94,7 @@ function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, ov
|
||||
return;
|
||||
}
|
||||
|
||||
var isEmpty = signaturePad.isEmpty();
|
||||
const isEmpty = signaturePad.isEmpty();
|
||||
|
||||
if(isEmpty === true) {
|
||||
hideSignatureContainer(signatureContainer, overridingAlertId);
|
||||
@@ -112,31 +112,31 @@ function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, ov
|
||||
},
|
||||
false);
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function hideSignatureContainer(signatureContainer, overridingAlertId) {
|
||||
$("#" + signatureContainer + ", #" + overridingAlertId).removeClass("d-block");
|
||||
$(`#${signatureContainer}, #${overridingAlertId}`).removeClass("d-block");
|
||||
$("#report-form-container").show();
|
||||
}
|
||||
|
||||
function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad, canvasId) {
|
||||
try {
|
||||
var canvas = document.getElementById(canvasId);
|
||||
var clonedCanvas = cloneCanvas(canvas);
|
||||
var trimmedCanvas = trimCanvas(clonedCanvas);
|
||||
const canvas = document.getElementById(canvasId);
|
||||
const clonedCanvas = cloneCanvas(canvas);
|
||||
const trimmedCanvas = trimCanvas(clonedCanvas);
|
||||
|
||||
var context = trimmedCanvas.getContext("2d", {willReadFrequently: true});
|
||||
const context = trimmedCanvas.getContext("2d", {willReadFrequently: true});
|
||||
context.globalCompositeOperation = "destination-over";
|
||||
context.fillStyle = "white";
|
||||
context.fillRect(0, 0, trimmedCanvas.width, trimmedCanvas.height);
|
||||
|
||||
var dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
const dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
|
||||
showSpinner();
|
||||
|
||||
var url = getCreateSignatureForServiceOverviewUrl();
|
||||
const url = window.getCreateSignatureForServiceOverviewUrl();
|
||||
|
||||
$.post(url, { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: !isEmployeeSignature, overwrite: overwrite }).done(function (json) {
|
||||
hideSpinner();
|
||||
@@ -156,6 +156,6 @@ function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad
|
||||
}
|
||||
});
|
||||
} catch (ex) {
|
||||
showErrorPopup(ex);
|
||||
window.showErrorPopup(ex);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace BeWoPlanerMobil.Service
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.WriteLine(">>>>Retrieving Session!");
|
||||
Debug.WriteLine($">>>>{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: Retrieving Session!");
|
||||
|
||||
Monitor.Enter(_Lock);
|
||||
|
||||
@@ -113,14 +113,14 @@ namespace BeWoPlanerMobil.Service
|
||||
{
|
||||
if(HttpContext.Current.Items["hibernateSession"] is null)
|
||||
{
|
||||
Debug.WriteLine("+++>Ending Request; Session is null!");
|
||||
Debug.WriteLine($"+++>{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: Ending Request; Session is null!");
|
||||
return;
|
||||
}
|
||||
|
||||
((ISession)HttpContext.Current.Items["hibernateSession"]).Close();
|
||||
HttpContext.Current.Items.Remove("hibernateSession");
|
||||
|
||||
Debug.WriteLine("####Ending Request; Closing and removing Session!");
|
||||
Debug.WriteLine($"####{DateTime.Now:dd.MM.yyyy HH:mm:ss.fff}: Ending Request; Closing and removing Session!");
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using BeWo.Data.Entities;
|
||||
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
using NHibernate;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
using System.Web.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using BeWoPlanerMobil.Util.MoKExtensions;
|
||||
using BS.Shared.DataContracts.ClientPartials;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
|
||||
namespace BeWoPlanerMobil.Util
|
||||
{
|
||||
@@ -12,5 +19,272 @@ namespace BeWoPlanerMobil.Util
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static IHtmlString PopupWithSearchForIFilterables<T>(this HtmlHelper htmlHelper, List<T> entities, string itemOnClickMethodName, string itemOnClickParameterString, string selectedItemText, string modalId, bool isButtonPrimaryColor = true, bool hasPrependInputGroupText = true, bool hasPrepend = true, bool hasDeleteSelectionButton = false) where T : IMoKSearchableDC
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(modalId))
|
||||
{
|
||||
modalId = $"{Guid.NewGuid()}-modal-popup";
|
||||
}
|
||||
|
||||
var buttonColor = "btn-primary";
|
||||
var buttonOutlineColor = "btn-outline-primary";
|
||||
var prependText = string.Empty;
|
||||
var modalTitleText = "Auswahl";
|
||||
|
||||
if(selectedItemText is null)
|
||||
{
|
||||
selectedItemText = string.Empty;
|
||||
}
|
||||
|
||||
switch(entities.GetType().GetGenericArguments().Single().Name)
|
||||
{
|
||||
case nameof(CompactCustomerDC):
|
||||
buttonColor = "btn-bewo-customers";
|
||||
buttonOutlineColor = "btn-outline-bewo-customers";
|
||||
prependText = "Klient";
|
||||
modalTitleText = "Klientenauswahl";
|
||||
break;
|
||||
case nameof(CompactEmployeeDC):
|
||||
buttonColor = "btn-bewo-employee";
|
||||
buttonOutlineColor = "btn-outline-bewo-employee";
|
||||
prependText = "Mitarbeiter";
|
||||
modalTitleText = "Mitarbeiterauswahl";
|
||||
break;
|
||||
case nameof(CompactOrganisationDC):
|
||||
buttonColor = "btn-bewo-organisation";
|
||||
buttonOutlineColor = "btn-outline-bewo-organisation";
|
||||
prependText = "Organisation";
|
||||
modalTitleText = "Organisationsauswahl";
|
||||
break;
|
||||
case nameof(CompactTeamDC):
|
||||
buttonColor = "btn-bewo-teams";
|
||||
buttonOutlineColor = "btn-outline-bewo-teams";
|
||||
prependText = "Team";
|
||||
modalTitleText = "Teamauswahl";
|
||||
break;
|
||||
}
|
||||
|
||||
if(isButtonPrimaryColor)
|
||||
{
|
||||
buttonColor = "btn-primary";
|
||||
}
|
||||
|
||||
var containerDiv = new TagBuilder("div");
|
||||
|
||||
var modalToggleButton = new TagBuilder("button");
|
||||
modalToggleButton.AddCssClass("dropdown-toggle");
|
||||
|
||||
if(hasDeleteSelectionButton)
|
||||
{
|
||||
modalToggleButton.AddCssClass(hasPrepend ? "entity-popup-open-button" : "btn-group-dropdown-toggle");
|
||||
}
|
||||
else
|
||||
{
|
||||
modalToggleButton.AddCssClass("white-space-normal");
|
||||
modalToggleButton.AddCssClass("text-truncate");
|
||||
modalToggleButton.AddCssClass("w-100");
|
||||
}
|
||||
|
||||
modalToggleButton.AddCssClass(buttonColor);
|
||||
modalToggleButton.AddCssClass("btn");
|
||||
modalToggleButton.MergeAttribute("type", "button");
|
||||
modalToggleButton.MergeAttribute("data-toggle", "modal");
|
||||
modalToggleButton.MergeAttribute("data-target", $"#{modalId}");
|
||||
modalToggleButton.InnerHtml = selectedItemText;
|
||||
|
||||
if(hasPrepend)
|
||||
{
|
||||
var inputGroup = new TagBuilder("div");
|
||||
inputGroup.AddCssClass("input-group");
|
||||
|
||||
var prepend = new TagBuilder("div");
|
||||
prepend.AddCssClass("input-group-prepend");
|
||||
|
||||
var inputGroupText = new TagBuilder("span") { InnerHtml = prependText };
|
||||
inputGroupText.AddCssClass("prepend-input-group-text");
|
||||
inputGroupText.AddCssClass("input-group-text");
|
||||
|
||||
var append = new TagBuilder("div");
|
||||
append.AddCssClass(hasDeleteSelectionButton ? "cancel-selection-btn-container" : "dropdown-append");
|
||||
append.AddCssClass("input-group-append");
|
||||
|
||||
if(hasDeleteSelectionButton)
|
||||
{
|
||||
modalToggleButton.AddCssClass("rounded-0");
|
||||
|
||||
var xButton = new TagBuilder("button");
|
||||
xButton.AddCssClass("w-100");
|
||||
xButton.AddCssClass(buttonOutlineColor);
|
||||
xButton.AddCssClass("btn");
|
||||
xButton.MergeAttribute("type", "button");
|
||||
xButton.MergeAttribute("onclick", $"{itemOnClickMethodName}(this, null, {itemOnClickParameterString})");
|
||||
|
||||
var xButtonSpan = new TagBuilder("span");
|
||||
xButtonSpan.AddCssClass("fa-times-circle");
|
||||
xButtonSpan.AddCssClass("fas");
|
||||
|
||||
xButton.AppendInnerHtml(xButtonSpan);
|
||||
|
||||
append.AppendInnerHtml(xButton);
|
||||
}
|
||||
else
|
||||
{
|
||||
append.AppendInnerHtml(modalToggleButton);
|
||||
}
|
||||
|
||||
prepend.AppendInnerHtml(inputGroupText);
|
||||
|
||||
inputGroup.AppendInnerHtml(prepend);
|
||||
|
||||
if(hasDeleteSelectionButton)
|
||||
{
|
||||
inputGroup.AppendInnerHtml(modalToggleButton);
|
||||
}
|
||||
|
||||
inputGroup.AppendInnerHtml(append);
|
||||
|
||||
containerDiv.AppendInnerHtml(inputGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(hasDeleteSelectionButton)
|
||||
{
|
||||
var btnGroup = new TagBuilder("div");
|
||||
btnGroup.AddCssClass("w-100");
|
||||
btnGroup.AddCssClass("d-flex");
|
||||
btnGroup.AddCssClass("btn-group");
|
||||
btnGroup.MergeAttribute("role", "group");
|
||||
|
||||
btnGroup.AppendInnerHtml(modalToggleButton);
|
||||
|
||||
var cancelSelectionButton = new TagBuilder("button");
|
||||
cancelSelectionButton.AddCssClass("cancel-selection-btn-container");
|
||||
cancelSelectionButton.AddCssClass(buttonOutlineColor);
|
||||
cancelSelectionButton.AddCssClass("btn");
|
||||
cancelSelectionButton.MergeAttribute("type", "button");
|
||||
|
||||
var cancelSelectionButtonSpan = new TagBuilder("span");
|
||||
cancelSelectionButtonSpan.AddCssClass("fa-times-circle");
|
||||
cancelSelectionButtonSpan.AddCssClass("fas");
|
||||
|
||||
btnGroup.AppendInnerHtml(cancelSelectionButtonSpan);
|
||||
}
|
||||
else
|
||||
{
|
||||
containerDiv.AppendInnerHtml(modalToggleButton);
|
||||
}
|
||||
}
|
||||
|
||||
var modalDiv = new TagBuilder("div");
|
||||
modalDiv.AddCssClass("modal");
|
||||
modalDiv.MergeAttribute("id", modalId);
|
||||
modalDiv.MergeAttribute("role", "dialog");
|
||||
modalDiv.MergeAttribute("tabindex", "-1");
|
||||
|
||||
var modalDialog = new TagBuilder("div");
|
||||
modalDialog.AddCssClass("modal-dialog-scrollable");
|
||||
modalDialog.AddCssClass("modal-dialog");
|
||||
modalDialog.MergeAttribute("role", "document");
|
||||
|
||||
var modalContent = new TagBuilder("div");
|
||||
modalContent.AddCssClass("modal-content");
|
||||
|
||||
var modalHeader = new TagBuilder("div");
|
||||
modalHeader.AddCssClass("modal-header");
|
||||
|
||||
var modalTitle = new TagBuilder("h5");
|
||||
modalTitle.AddCssClass("font-weight-bold");
|
||||
modalTitle.AddCssClass("modal-title");
|
||||
modalTitle.InnerHtml = modalTitleText;
|
||||
|
||||
var closeButton = new TagBuilder("button");
|
||||
closeButton.AddCssClass("close");
|
||||
closeButton.MergeAttribute("type", "button");
|
||||
closeButton.MergeAttribute("data-dismiss", "modal");
|
||||
closeButton.MergeAttribute("onclick", "resetEntitySearch($(this).parent().siblings('.modal-body').children('.input-group').find('.btn-outline-secondary'))");
|
||||
|
||||
var closeButtonSpan = new TagBuilder("span")
|
||||
{
|
||||
InnerHtml = "×"
|
||||
};
|
||||
|
||||
closeButton.InnerHtml = closeButtonSpan.ToString();
|
||||
modalHeader.AppendInnerHtml(modalTitle);
|
||||
modalHeader.AppendInnerHtml(closeButton);
|
||||
|
||||
modalContent.AppendInnerHtml(modalHeader);
|
||||
|
||||
var modalBody = new TagBuilder("div");
|
||||
modalBody.AddCssClass("modal-body");
|
||||
|
||||
var modalInputGroup = new TagBuilder("div");
|
||||
modalInputGroup.AddCssClass("input-group");
|
||||
|
||||
var searchInput = new TagBuilder("input");
|
||||
searchInput.AddCssClass("form-control");
|
||||
searchInput.MergeAttribute("oninput", "onEntitySearchInput(this)");
|
||||
searchInput.MergeAttribute("placeholder", "Suchen...");
|
||||
searchInput.MergeAttribute("type", "text");
|
||||
|
||||
var modalInputGroupAppend = new TagBuilder("div");
|
||||
modalInputGroupAppend.AddCssClass("input-group-append");
|
||||
|
||||
var resetSearchButton = new TagBuilder("button");
|
||||
resetSearchButton.AddCssClass("btn-outline-secondary");
|
||||
resetSearchButton.AddCssClass("btn");
|
||||
resetSearchButton.MergeAttribute("onclick", "resetEntitySearch($(this))");
|
||||
|
||||
var resetSearchButtonSpan = new TagBuilder("span");
|
||||
resetSearchButtonSpan.AddCssClass("fa-times-circle");
|
||||
resetSearchButtonSpan.AddCssClass("fas");
|
||||
|
||||
resetSearchButton.AppendInnerHtml(resetSearchButtonSpan);
|
||||
modalInputGroupAppend.AppendInnerHtml(resetSearchButton);
|
||||
modalInputGroup.AppendInnerHtml(searchInput);
|
||||
modalInputGroup.AppendInnerHtml(modalInputGroupAppend);
|
||||
|
||||
modalBody.AppendInnerHtml(modalInputGroup);
|
||||
|
||||
var hr = new TagBuilder("hr");
|
||||
|
||||
modalBody.AppendInnerHtml(hr);
|
||||
|
||||
var listGroup = new TagBuilder("list-group");
|
||||
listGroup.AddCssClass("list-group");
|
||||
|
||||
foreach(var entity in entities.OrderBy(e => e.ToString()))
|
||||
{
|
||||
var a = new TagBuilder("a");
|
||||
a.AddCssClass("text-body");
|
||||
a.AddCssClass("text-truncate");
|
||||
a.AddCssClass("cursor-pointer");
|
||||
a.AddCssClass("no-underline");
|
||||
a.AddCssClass("list-group-item");
|
||||
|
||||
if(false == string.IsNullOrWhiteSpace(itemOnClickMethodName))
|
||||
{
|
||||
var parameters = string.IsNullOrWhiteSpace(itemOnClickParameterString) ? string.Empty : $", {itemOnClickParameterString}";
|
||||
|
||||
a.MergeAttribute("onclick", $"{itemOnClickMethodName}(this, {entity.EntityOid}{parameters});resetEntitySearch($(this).parent().parent().children('.input-group').find('.btn-outline-secondary'));");
|
||||
}
|
||||
|
||||
a.MergeAttribute("id", $"{Guid.NewGuid()}_{entity.EntityOid}");
|
||||
a.MergeAttribute("href", "#");
|
||||
a.InnerHtml = entity.ToString();
|
||||
|
||||
listGroup.AppendInnerHtml(a);
|
||||
}
|
||||
|
||||
modalBody.AppendInnerHtml(listGroup);
|
||||
|
||||
modalContent.AppendInnerHtml(modalBody);
|
||||
modalDialog.AppendInnerHtml(modalContent);
|
||||
modalDiv.AppendInnerHtml(modalDialog);
|
||||
|
||||
containerDiv.AppendInnerHtml(modalDiv);
|
||||
|
||||
return MvcHtmlString.Create(containerDiv.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
17
BeWoPlanerMobil/Util/MoKExtensions/TagBuilderExtensions.cs
Normal file
17
BeWoPlanerMobil/Util/MoKExtensions/TagBuilderExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace BeWoPlanerMobil.Util.MoKExtensions
|
||||
{
|
||||
public static class TagBuilderExtensions
|
||||
{
|
||||
public static void AppendInnerHtml(this TagBuilder tagBuilder, TagBuilder tagBuilderToAppend, TagRenderMode tagRenderMode = TagRenderMode.Normal)
|
||||
{
|
||||
if(tagBuilderToAppend is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tagBuilder.InnerHtml += tagBuilderToAppend.ToString(tagRenderMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@using BeWoPlanerMobil.Models;
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BS.Shared
|
||||
|
||||
@model CustomerModel
|
||||
@@ -16,7 +17,7 @@
|
||||
|
||||
function resizeCustomerPrependElements() {
|
||||
try {
|
||||
var width = getMaxWidth("customer-prepend-text-eigenschaften");
|
||||
let width = getMaxWidth("customer-prepend-text-eigenschaften");
|
||||
if(width > 0) {
|
||||
$(".customer-prepend-text-eigenschaften").width(width);
|
||||
}
|
||||
@@ -36,7 +37,7 @@
|
||||
$(".customer-prepend-text-kontakt").width(width);
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@
|
||||
showSpinner();
|
||||
$("#stammdaten-form").submit();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,15 +54,15 @@
|
||||
try {
|
||||
$.get("@Url.Action("ResetReport")");
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
window.addEventListener('load', function () {
|
||||
var forms = document.getElementsByClassName("needs-validation");
|
||||
var validation = Array.prototype.filter.call(forms, function (form) {
|
||||
const forms = document.getElementsByClassName("needs-validation");
|
||||
const validation = Array.prototype.filter.call(forms, function (form) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
if(form.checkValidity() === false) {
|
||||
hideSpinner();
|
||||
@@ -84,7 +85,7 @@
|
||||
$("#customer-search-input").val("");
|
||||
$("#customer-dropdown-menu .dropdown-item").show();
|
||||
|
||||
var e = window.event;
|
||||
const e = window.event;
|
||||
e.cancelBubble = true;
|
||||
if(e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
@@ -98,20 +99,18 @@
|
||||
try {
|
||||
var searchText = $("#customer-search-input").val();
|
||||
|
||||
logInfo2($`Suche Klient mit ${searchText} im Namen`);
|
||||
|
||||
if(searchText === null || searchText === undefined || searchText.length === 0) {
|
||||
$("#customer-dropdown-menu .dropdown-item").show();
|
||||
return;
|
||||
}
|
||||
|
||||
var menuItems = $("#customer-dropdown-menu .dropdown-item");
|
||||
const menuItems = $("#customer-dropdown-menu .dropdown-item");
|
||||
|
||||
menuItems.hide();
|
||||
|
||||
$.each(menuItems,
|
||||
function(index, item) {
|
||||
var itemText = $(item).text().toLowerCase();
|
||||
const itemText = $(item).text().toLowerCase();
|
||||
|
||||
if(itemText.includes(searchText.toLowerCase())) {
|
||||
$(item).show();
|
||||
@@ -122,9 +121,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
function selectCustomer(customerOid) {
|
||||
function selectCustomer(element, customerOid) {
|
||||
try {
|
||||
$("#customer-oid-input").val(customerOid);
|
||||
$("#customer-modal-popup").modal("hide");
|
||||
showSpinner();
|
||||
$("#select-customer-form").submit();
|
||||
} catch(error) {
|
||||
@@ -133,7 +133,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container mt-3" style="max-width: 1200px !important;">
|
||||
<div class="container mt-3 lg-max-width">
|
||||
<div class="row mb-3">
|
||||
@if(AbstractModel.IsAllowedToSeeCustomerFilter)
|
||||
{
|
||||
@@ -150,40 +150,15 @@
|
||||
{
|
||||
var customerName = Model.SelectedCustomer != null ? $"{Model.SelectedCustomer.LastName}, {Model.SelectedCustomer.FirstName}{(!string.IsNullOrWhiteSpace(Model.SelectedCustomer.CustomerAlias) ? $"({Model.SelectedCustomer.CustomerAlias})" : string.Empty)}" : string.Empty;
|
||||
|
||||
<div class="wide-dropdown">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Klient</span>
|
||||
</div>
|
||||
<div class="input-group-append dropdown-append">
|
||||
<button class="btn btn-bewo-customers dropdown-toggle w-100 text-truncate white-space-normal" type="button" data-toggle="dropdown">
|
||||
@customerName
|
||||
</button>
|
||||
<div class="dropdown-menu w-100" id="customer-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control w-100" id="customer-search-input" type="text" placeholder="Suchen ..." oninput="onCustomerSearchInput()" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="resetCustomerSearch()">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
@foreach(var customer in Model.CustomerListItems)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" onclick="selectCustomer('@customer.Value')">@Html.Raw(customer.Text)</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@Html.PopupWithSearchForIFilterables(Model.Customers, "selectCustomer", null, customerName, "customer-modal-popup", false)
|
||||
|
||||
<input type="hidden" name="SelectedCustomerOid" id="customer-oid-input"/>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid mt-3 px-0" id="customer-container" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid mt-3 px-0 lg-max-width" id="customer-container">
|
||||
@if(Model?.SelectedJsonCustomer != null)
|
||||
{
|
||||
@* ----- Details ----- *@
|
||||
@@ -525,16 +500,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-6 col-lg-12 my-3">
|
||||
<div class="col-sm-12 col-md-6 col-lg-12 my-3 px-1">
|
||||
<div class="card w-100 h-100">
|
||||
<div class="card-header">
|
||||
<div class="clearfix">
|
||||
<h5 class="text-bewo-customer-card-header d-inline float-left">Kommentar</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
<textarea id="notice-textarea" @inputDisabled name="notiz" class="w-100" style="resize: vertical;">@Model.SelectedJsonCustomer.Kommentar</textarea>
|
||||
<div class="card-body m-1 p-1">
|
||||
<div class="container-fluid m-1 p-1">
|
||||
<textarea id="notice-textarea" @inputDisabled name="notiz" class="w-100 m-1 p-1" style="resize: vertical;">@Model.SelectedJsonCustomer.Kommentar</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -542,8 +517,8 @@
|
||||
|
||||
@if(AbstractModel.HasRightToEditCustomers)
|
||||
{
|
||||
<div class="col-12 my-3">
|
||||
<button type="submit" class="btn btn-primary float-right w-100" onclick="showSpinner()">Speichern</button>
|
||||
<div class="col-12 my-3 px-1">
|
||||
<button type="submit" class="btn btn-primary float-right w-100 m-0" onclick="showSpinner()">Speichern</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -866,8 +841,8 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<div class="card-body pb-0 px-0" id="medikamentenlistencontainer">
|
||||
<div class="collapse mx-0 px-0">
|
||||
<div class="card-body pb-0 px-0 mx-0" id="medikamentenlistencontainer">
|
||||
@Html.Partial("CustomerMedListPartial", Model)
|
||||
</div>
|
||||
</div>
|
||||
@@ -891,7 +866,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<div class="card-body">
|
||||
<div class="card-body m-0 p-1 pt-3">
|
||||
@{
|
||||
var hasDiagnosen = Model.SelectedJsonCustomer.HasDiagnosen;
|
||||
var hasDisabilities = Model.SelectedJsonCustomer.HasDisabilities;
|
||||
@@ -937,44 +912,44 @@
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Aust. Vers. -amt</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiAusstAmt</td>
|
||||
<td class="text-secondary align-text-top">Aust. Vers. -amt</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiAusstAmt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausweis unbefristet gültig</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiIsUnlimited</td>
|
||||
<td class="text-secondary align-text-top">Ausweis unbefristet gültig</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiIsUnlimited</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausweis gültig von</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiGueltigVon</td>
|
||||
<td class="text-secondary align-text-top">Ausweis gültig von</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiGueltigVon</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Ausweis gültig bis</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiGueltigBis</td>
|
||||
<td class="text-secondary align-text-top">Ausweis gültig bis</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiGueltigBis</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Beiblatt gültig bis</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiBeiblattGueltigBis</td>
|
||||
<td class="text-secondary align-text-top">Beiblatt gültig bis</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiBeiblattGueltigBis</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Grad der Behinderung</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiGradDerBehinderung</td>
|
||||
<td class="text-secondary align-text-top">Grad der Behinderung</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiGradDerBehinderung</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Merkzeichen</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiMerkzeichen</td>
|
||||
<td class="text-secondary align-text-top">Merkzeichen</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiMerkzeichen</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Behinderungsart</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiBehinderungsart</td>
|
||||
<td class="text-secondary align-text-top">Behinderungsart</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiBehinderungsart</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pflegegrad</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiPflegegrad</td>
|
||||
<td class="text-secondary align-text-top">Pflegegrad</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiPflegegrad</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aktenzeichen</td>
|
||||
<td>@Model.SelectedJsonCustomer.SchwebiAktenzeichen</td>
|
||||
<td class="text-secondary align-text-top">Aktenzeichen</td>
|
||||
<td class="text-right align-text-top">@Model.SelectedJsonCustomer.SchwebiAktenzeichen</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1011,11 +986,10 @@
|
||||
var isAllowedToViewBargeldkassen = AbstractModel.HasRightToViewAllCustomersBargeldkassen || (isRelatedCustomer && AbstractModel.HasRightToViewOwnCustomersBargeldkassen);
|
||||
|
||||
|
||||
@* Bargeldverwaltung *@
|
||||
@* ----- Bargeldverwaltung ----- *@
|
||||
if(isAllowedToViewBargeldkassen)
|
||||
{
|
||||
@* ----- Bargeldverwaltung ----- *@
|
||||
<div class="col-12 my-3">
|
||||
<div class="col-12">
|
||||
<div class="card w-100 h-100">
|
||||
<div class="card-header" onclick="cardHeaderClick2(this)">
|
||||
<div class="d-inline-flex">
|
||||
@@ -1029,7 +1003,7 @@
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<div class="card-body pb-0 px-0">
|
||||
<div class="container-fluid my-0 py-0" id="bargeldkassen-container">
|
||||
<div class="container-fluid" id="bargeldkassen-container">
|
||||
@Html.Partial("CustomerBargeldkassen", Model)
|
||||
</div>
|
||||
</div>
|
||||
@@ -1068,12 +1042,10 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@*Betreuung*@
|
||||
|
||||
@* ----- Betreuung ----- *@
|
||||
var hasRelatedEmployees = Model.SelectedCustomer?.RelatedEmployees.Any() ?? false;
|
||||
var hasRelatedTeams = Model.SelectedCustomer?.RelatedTeams.Any() ?? false;
|
||||
|
||||
|
||||
if(AbstractModel.HasRightToViewBetreuung && (hasRelatedEmployees || hasRelatedTeams))
|
||||
{
|
||||
<div class="col-12 my-3">
|
||||
@@ -1089,7 +1061,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<div class="card-body">
|
||||
<div class="card-body p-1">
|
||||
<div id="betreuungscontainer">
|
||||
@Html.Partial("CustomerBetreuungPartial", Model)
|
||||
</div>
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
|
||||
function resizeButtons() {
|
||||
try {
|
||||
var btnGroupMaxWidth = getMaxWidth("bk-btn-group");
|
||||
const btnGroupMaxWidth = getMaxWidth("bk-btn-group");
|
||||
|
||||
if(btnGroupMaxWidth > 0) {
|
||||
$(".bk-btn-group").width(btnGroupMaxWidth);
|
||||
}
|
||||
|
||||
var dateInputMaxWidth = getMaxWidth("date-input-prepend-group");
|
||||
const dateInputMaxWidth = getMaxWidth("date-input-prepend-group");
|
||||
|
||||
if(dateInputMaxWidth > 0) {
|
||||
$(".date-input-prepend-group").width(dateInputMaxWidth);
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
try {
|
||||
$.get("@Url.Action("DeselectBargeldkasse")");
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
hideSpinner();
|
||||
$("#customer-bargeldkassen-form-popup-title").text(`${bargeldkassenname} bearbeiten`);
|
||||
$("#customer-bargeldkassen-form-popup").modal("show");
|
||||
calcBargeldkassenFormPrependWidth();
|
||||
window.calcBargeldkassenFormPrependWidth();
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
document.getElementById("bargeldkassendeleteform").submit();
|
||||
}, false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,10 +74,10 @@
|
||||
hideSpinner();
|
||||
$("#customer-bargeldkassen-form-popup-title").text("Bargeldkasse hinzufügen");
|
||||
$("#customer-bargeldkassen-form-popup").modal("show");
|
||||
calcBargeldkassenFormPrependWidth();
|
||||
window.calcBargeldkassenFormPrependWidth();
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@
|
||||
try {
|
||||
showSpinner();
|
||||
|
||||
var start = $(`#customer-bargeldkasse-start-date-${bargeldkassenOid}`).val();
|
||||
var end = $(`#customer-bargeldkasse-end-date-${bargeldkassenOid}`).val();
|
||||
const start = $(`#customer-bargeldkasse-start-date-${bargeldkassenOid}`).val();
|
||||
const end = $(`#customer-bargeldkasse-end-date-${bargeldkassenOid}`).val();
|
||||
|
||||
$("#customer-report-popup-container").load("@Url.Action("PrintBargeldkasse")",
|
||||
{
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
var initialDateInputWidth = 0;
|
||||
function calculateDateInputWidth() {
|
||||
try {
|
||||
var bargeldkassenDateInputMaxWidth = getMaxWidth("customer-bargeldkassen-date-prepend");
|
||||
const bargeldkassenDateInputMaxWidth = getMaxWidth("customer-bargeldkassen-date-prepend");
|
||||
|
||||
if(initialDateInputWidth <= 0 && $.isNumeric(bargeldkassenDateInputMaxWidth)) {
|
||||
initialDateInputWidth = bargeldkassenDateInputMaxWidth;
|
||||
@@ -124,14 +124,14 @@
|
||||
|
||||
$(".customer-bargeldkassen-date-prepend").width(bargeldkassenDateInputMaxWidth);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteBargeldransaktion(transaktionsOid) {
|
||||
try {
|
||||
if(false === $.isNumeric(transaktionsOid)) {
|
||||
showErrorMessagePopup("Es ist ein Fehler beim Löschen einer Transaktion gekommen. Bitte wenden Sie sich an Ihren Administrator");
|
||||
window.showErrorMessagePopup("Es ist ein Fehler beim Löschen einer Transaktion gekommen. Bitte wenden Sie sich an Ihren Administrator");
|
||||
}
|
||||
|
||||
showMessagePopupWithCallback("Transaktion löschen",
|
||||
@@ -148,12 +148,11 @@
|
||||
},
|
||||
false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function signZahlungsbeleg(transaktionsOid, zahlungsdatum, zahlungsart, zahlungsbetrag, zahlungsbelegnummer) {
|
||||
logInfo(`Transaktion mit Oid ${transaktionsOid} wird unterschrieben`);
|
||||
try {
|
||||
$("#customer-container").hide();
|
||||
$("#transaktionsunterschriftencontainer").addClass("d-block");
|
||||
@@ -161,17 +160,17 @@
|
||||
|
||||
resizeCanvas("#transaktionsunterschriftencanvas", "#transaktionsunterschriften-canvas-row");
|
||||
|
||||
var canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
const canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
|
||||
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
var signaturePad = new window.SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
|
||||
var cancelButton = document.getElementById("transaktionsunterschriften-cancel-btn");
|
||||
var saveButton = document.getElementById("transaktionsunterschriften-save-btn");
|
||||
var clearButton = document.getElementById("transaktionsunterschriften-clear-canvas-btn");
|
||||
const cancelButton = document.getElementById("transaktionsunterschriften-cancel-btn");
|
||||
const saveButton = document.getElementById("transaktionsunterschriften-save-btn");
|
||||
const clearButton = document.getElementById("transaktionsunterschriften-clear-canvas-btn");
|
||||
|
||||
var cancelButtonClone = cancelButton.cloneNode(true);
|
||||
var saveButtonClone = saveButton.cloneNode(true);
|
||||
var clearButtonClone = clearButton.cloneNode(true);
|
||||
const cancelButtonClone = cancelButton.cloneNode(true);
|
||||
const saveButtonClone = saveButton.cloneNode(true);
|
||||
const clearButtonClone = clearButton.cloneNode(true);
|
||||
|
||||
cancelButton.parentNode.replaceChild(cancelButtonClone, cancelButton);
|
||||
saveButton.parentNode.replaceChild(saveButtonClone, saveButton);
|
||||
@@ -195,28 +194,28 @@
|
||||
$("#transaktionsunterschriftencontainer").removeClass("d-block");
|
||||
$("#transaktionsunterschriftencontainer").addClass("d-none");
|
||||
$("#customer-container").show();
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
|
||||
function clearButtonEvent(signaturePad) {
|
||||
try {
|
||||
signaturePad.clear();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function saveButtonEvent(transaktionsOid) {
|
||||
var canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
var clonedCanvas = cloneCanvas(canvas);
|
||||
var trimmedCanvas = trimCanvas(clonedCanvas);
|
||||
const canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
const clonedCanvas = cloneCanvas(canvas);
|
||||
const trimmedCanvas = trimCanvas(clonedCanvas);
|
||||
|
||||
var context = trimmedCanvas.getContext("2d", {willReadFrequently: true});
|
||||
const context = trimmedCanvas.getContext("2d", {willReadFrequently: true});
|
||||
context.globalCompositeOperation = "destination-over";
|
||||
context.fillStyle = "white";
|
||||
context.fillRect(0, 0, trimmedCanvas.width, trimmedCanvas.height);
|
||||
|
||||
var dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
const dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
|
||||
showSpinner();
|
||||
|
||||
@@ -236,9 +235,9 @@
|
||||
|
||||
function cancelButtonEvent(signaturePad) {
|
||||
try {
|
||||
var canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
var width = canvas.getBoundingClientRect().width;
|
||||
var height = canvas.getBoundingClientRect().height;
|
||||
const canvas = document.getElementById("transaktionsunterschriftencanvas");
|
||||
const width = canvas.getBoundingClientRect().width;
|
||||
const height = canvas.getBoundingClientRect().height;
|
||||
|
||||
if(width === 0 || height === 0 || signaturePad.isEmpty()) {
|
||||
$("#customer-container").show();
|
||||
@@ -261,7 +260,7 @@
|
||||
},
|
||||
false);
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,7 +275,7 @@
|
||||
$("#bargeldtransaktionsarten-select-input select").val("0");
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +295,7 @@
|
||||
},
|
||||
false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +313,7 @@
|
||||
}
|
||||
);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +366,7 @@
|
||||
$("#customer-bargeldtransaktionshistorienpopup").modal("hide");
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -379,17 +378,13 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row mx-0 px-0">
|
||||
<div class="col-sm-12 p-0">
|
||||
<button type="button" class="btn btn-primary w-100 mb-3 mx-0 px-0" onclick="addNewBargeldkasse()">Neue Kasse hinzufügen</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-primary w-100 mx-0 px-0" onclick="addNewBargeldkasse()">Neue Kasse hinzufügen</button>
|
||||
|
||||
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4">
|
||||
@foreach(var bargeldkasse in Model.Bargeldkassen)
|
||||
{
|
||||
<div class="col mb-3 mx-0 px-1">
|
||||
<div class="col mb-1 mt-2 mx-0 px-1">
|
||||
<div class="card h-100">
|
||||
<div class="card-header" onclick="cardHeaderClick2(this, calculateDateInputWidth)">
|
||||
<div class="d-inline-flex">
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="collapse-customer-betreuung-list">
|
||||
<div class="card-body">
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4">
|
||||
<div class="card-body p-1">
|
||||
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3">
|
||||
@foreach(var relation in Model.SelectedCustomer.RelatedEmployees)
|
||||
{
|
||||
var start = relation.StartDate.HasValue ? $"{relation.StartDate.Value:dd.MM.yyyy}" : "";
|
||||
@@ -33,32 +33,32 @@
|
||||
<table class="w-100">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-secondary">Betreuer:</td>
|
||||
<td class="text-right">@relation.Employee</td>
|
||||
<td class="text-secondary align-text-top">Betreuer:</td>
|
||||
<td class="text-right align-text-top">@relation.Employee</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-secondary">Rolle:</td>
|
||||
<td class="text-right">@relation.RelationRole.DisplayName</td>
|
||||
<td class="text-secondary align-text-top">Rolle:</td>
|
||||
<td class="text-right align-text-top">@relation.RelationRole.DisplayName</td>
|
||||
</tr>
|
||||
@if(!string.IsNullOrWhiteSpace(start))
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">Startdatum:</td>
|
||||
<td class="text-right">@start</td>
|
||||
<td class="text-secondary align-text-top">Startdatum:</td>
|
||||
<td class="text-right align-text-top">@start</td>
|
||||
</tr>
|
||||
}
|
||||
@if(!string.IsNullOrWhiteSpace(end))
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">Enddatum:</td>
|
||||
<td class="text-right">@end</td>
|
||||
<td class="text-secondary align-text-top">Enddatum:</td>
|
||||
<td class="text-right align-text-top">@end</td>
|
||||
</tr>
|
||||
}
|
||||
@if(!string.IsNullOrWhiteSpace(relation.Notice))
|
||||
{
|
||||
<tr>
|
||||
<td class="text-secondary">Erläuterung:</td>
|
||||
<td class="text-justify">@relation.Notice</td>
|
||||
<td class="text-secondary align-text-top pr-1">Erläuterung:</td>
|
||||
<td class="text-justify align-text-top">@relation.Notice</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<script type="text/javascript">
|
||||
function changeReportTypeSelection() {
|
||||
try {
|
||||
var selectedReportType = $("#report-type-select").find(":selected").val();
|
||||
var historyList = $("#med-list-history-list");
|
||||
const selectedReportType = $("#report-type-select").find(":selected").val();
|
||||
const historyList = $("#med-list-history-list");
|
||||
$("#show-med-list-btn").prop("disabled", selectedReportType === "2");
|
||||
|
||||
if (selectedReportType !== "2") {
|
||||
@@ -16,7 +16,7 @@
|
||||
historyList.removeClass("d-none");
|
||||
historyList.show();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
);
|
||||
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
try {
|
||||
showSpinner();
|
||||
|
||||
var selectedReportType = $("#report-type-select").find(":selected").val();
|
||||
const selectedReportType = $("#report-type-select").find(":selected").val();
|
||||
|
||||
$("#customer-report-popup-container").load("@Url.Action("ShowMedList")",
|
||||
{
|
||||
@@ -75,12 +75,12 @@
|
||||
hideSpinner();
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container-fluid my-0 py-0">
|
||||
<div class="container-fluid m-0 px-1">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-lg-auto mb-3">
|
||||
@Html.DropDownListFor(m => m.SelectedReportType, Model.ReportTypeItems, new { @class = "custom-select", id = "report-type-select", onchange = "changeReportTypeSelection()" })
|
||||
@@ -89,7 +89,7 @@
|
||||
@{
|
||||
var showReportBtnDisabledValue = Model.SelectedReportType == CustomerReportType.Historie ? "disabled" : string.Empty;
|
||||
}
|
||||
<button @showReportBtnDisabledValue class="btn btn-primary" type="button" onclick="loadMedListReport();" id="show-med-list-btn">Bericht anzeigen</button>
|
||||
<button @showReportBtnDisabledValue class="btn btn-primary mx-0" type="button" onclick="loadMedListReport();" id="show-med-list-btn">Bericht anzeigen</button>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg">
|
||||
@if(!(Model.SelectedCustomer is null))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
toggleDescriptionTextareaSaveButton(item);
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,21 +34,21 @@
|
||||
$(element).siblings(".input-group-prepend").find(".input-group-text").find(".fa-folder,.fa-folder-open").toggleClass("fa-folder").toggleClass("fa-folder-open");
|
||||
$(element).parents(".card-header").next(".collapse").toggle();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleDescriptionTextareaSaveButton(item) {
|
||||
try {
|
||||
var descriptionText = $(item).val();
|
||||
const descriptionText = $(item).val();
|
||||
|
||||
var descriptionSaveButton = $(item).siblings("button");
|
||||
const descriptionSaveButton = $(item).siblings("button");
|
||||
|
||||
var hasDescriptionText = descriptionText !== undefined && descriptionText !== null && descriptionText.length > 0
|
||||
const hasDescriptionText = descriptionText !== undefined && descriptionText !== null && descriptionText.length > 0;
|
||||
|
||||
descriptionSaveButton.attr("disabled", !hasDescriptionText);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,17 +56,17 @@
|
||||
try {
|
||||
toggleDescriptionTextareaSaveButton(item);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function saveDescriptionChange(fileOid) {
|
||||
try {
|
||||
var descriptionText = $(`#description-${fileOid}`).val();
|
||||
const descriptionText = $(`#description-${fileOid}`).val();
|
||||
|
||||
$("#customer-document-container").load("@Url.Action("SaveDescriptionChange")", {descriptionText: descriptionText, fileOid: fileOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
$("#new-file-popup").modal("show");
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
$("#new-folder-popup").modal("hide");
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
$("#new-folder-popup").modal("hide");
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
},
|
||||
false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
$("#new-folder-popup").modal("show");
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
},
|
||||
false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -145,7 +145,9 @@
|
||||
|
||||
var isSupportConceptSelected = supportConceptOid !== -1;
|
||||
|
||||
$("#employeesDropDown, #single-booking-dropdown-employees-menu, #category-select, #leistung-select, " +
|
||||
$("#single-booking-employee-container").find(".dropdown-toggle").prop("disabled", (isSupportConceptSelected ? false : true));
|
||||
|
||||
$("#employeesDropDown, #category-select, #leistung-select, " +
|
||||
"#start-date, #end-date, #start-time, #end-time, #duration, " +
|
||||
"#distance, #textbausteine-button, #goals-button, textarea, #reset-button, " +
|
||||
"#create-button, #statistics-button, #timeFrameSelect, #hours-minutes-dropdown-btn, #marker-cb, #betrag").prop("disabled", (isSupportConceptSelected ? false : true));
|
||||
@@ -153,7 +155,7 @@
|
||||
if("@Model.IsInGroupBookingMode".toLowerCase() === "true") {
|
||||
var hasSelectedSupportConcepts = "@Model.SelectedConceptCostBearerRelations.Any()".toLowerCase() === "true";
|
||||
|
||||
$("#employees-button, #single-booking-dropdown-employees-menu, #category-select, #leistung-select, " +
|
||||
$("#employees-button, #category-select, #leistung-select, " +
|
||||
"#start-date, #end-date, #start-time, #end-time, #duration, " +
|
||||
"#distance, textarea, #reset-button, #create-button, #textbausteine-button, #hours-minutes-dropdown-btn, #marker-cb, #betrag").prop("disabled", (hasSelectedSupportConcepts ? false : true));
|
||||
}
|
||||
@@ -445,7 +447,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container mt-3" id="checkbox-container" style="max-width: 1200px !important;">
|
||||
<div class="container mt-3 lg-max-width" id="checkbox-container">
|
||||
<div class="row">
|
||||
@if(AbstractModel.IsAllowedToSeeSupportConceptFilter)
|
||||
{
|
||||
@@ -496,7 +498,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Einzelbuchung ----- *@
|
||||
<div class="container-fluid mb-3" id="main-container" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid mb-3 lg-max-width" id="main-container">
|
||||
@if(!Model.IsInGroupBookingMode && !Model.IsInMultiBookingMode)
|
||||
{
|
||||
@Html.Partial("SingleBookingPartial", Model)
|
||||
@@ -504,7 +506,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Gruppenbuchung ----- *@
|
||||
<div class="container mb-3" style="max-width: 1200px !important;">
|
||||
<div class="container mb-3 lg-max-width">
|
||||
@if(Model.IsInGroupBookingMode && !Model.IsInMultiBookingMode)
|
||||
{
|
||||
<div id="group-booking-container">
|
||||
@@ -514,7 +516,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Mehrfachbuchung ----- *@
|
||||
<div class="container mb-3" style="max-width: 1200px !important;">
|
||||
<div class="container mb-3 lg-max-width">
|
||||
@if(Model.IsInMultiBookingMode && !Model.IsInGroupBookingMode)
|
||||
{
|
||||
@Html.Partial("MultiBookingPartial", Model);
|
||||
@@ -544,7 +546,7 @@
|
||||
</div>
|
||||
|
||||
@* ----- Unterschriften-Layover ----- *@
|
||||
<div class="container-fluid d-none mb-3" id="signature-container" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid d-none mb-3 lg-max-width" id="signature-container">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
|
||||
foreach(var serviceRecord in Model.ServiceRecords)
|
||||
{
|
||||
if(serviceRecord.Start == null || serviceRecord.End == null)
|
||||
if(serviceRecord.Start is null || serviceRecord.End is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
});
|
||||
|
||||
$(".hours-minutes-link").on("click", function () {
|
||||
var previousText = $("#hours-minutes-dropdown-btn").data("text");
|
||||
var currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
const previousText = $("#hours-minutes-dropdown-btn").data("text");
|
||||
const currentText = $(this).text().replaceAll(/\s/g, "");
|
||||
|
||||
if(previousText === currentText) {
|
||||
return;
|
||||
}
|
||||
|
||||
var buttonText = $(this).text();
|
||||
const buttonText = $(this).text();
|
||||
$("#hours-minutes-dropdown-btn").text(buttonText);
|
||||
|
||||
window.setInputFilter('duration', 'distance', 'hours-minutes-dropdown-btn');
|
||||
@@ -40,23 +40,25 @@
|
||||
});
|
||||
|
||||
@{
|
||||
if(Model.SelectedSupportConcept != null || Model.CostBearer2SupportConceptOid == -2)
|
||||
{
|
||||
<text>
|
||||
try {
|
||||
initializeIntervalSelection();
|
||||
} catch (error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
</text>
|
||||
if(Model.SelectedSupportConcept != null || Model.CostBearer2SupportConceptOid == -2)
|
||||
{
|
||||
<text>
|
||||
try {
|
||||
initializeIntervalSelection();
|
||||
} catch (error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
</text>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.calcPrependWidth();
|
||||
});
|
||||
|
||||
function deleteSigntarue(signatureOid, serviceRecordOid, customerName, dateOfRecord) {
|
||||
try {
|
||||
showMessagePopupWithCallback("Unterschrift löschen",
|
||||
"Sind Sie sicher, dass Sie die Unterschrift von " + customerName + " vom " + dateOfRecord + " löschen möchten?",
|
||||
`Sind Sie sicher, dass Sie die Unterschrift von ${customerName} vom ${dateOfRecord} löschen möchten?`,
|
||||
function () {
|
||||
$("#sr-signature-to-del-oid-input").val(signatureOid);
|
||||
$("#sr-sig-to-del-record-oid-input").val(serviceRecordOid);
|
||||
@@ -65,7 +67,7 @@
|
||||
},
|
||||
false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,9 +76,7 @@
|
||||
showSpinner();
|
||||
$("#singleBookingForm").trigger("reset");
|
||||
|
||||
var test = $("#has-any-rating-types").val().toLowerCase() === "true";
|
||||
|
||||
if (test) {
|
||||
if($("#has-any-rating-types").val().toLowerCase() === "true") {
|
||||
$(".goal-rating-badge").text("Bewerten");
|
||||
} else {
|
||||
$(".goal-rating-badge").text("");
|
||||
@@ -84,58 +84,16 @@
|
||||
|
||||
$("#reset-single-booking-form-form").submit();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function onSingleBookingEmployeeDropdownInput() {
|
||||
try {
|
||||
var input = $("#single-booking-employee-search-input");
|
||||
|
||||
var searchText = input.val();
|
||||
|
||||
if(searchText === null || searchText === undefined || searchText.length === 0) {
|
||||
$("#single-booking-employee-dropdown-menu .dropdown-item").show();
|
||||
return;
|
||||
}
|
||||
|
||||
var menuItems = $("#single-booking-employee-dropdown-menu .dropdown-item");
|
||||
|
||||
menuItems.hide();
|
||||
|
||||
$.each(menuItems, function(index, item) {
|
||||
var itemText = $(item).text().toLowerCase();
|
||||
|
||||
if(itemText.includes(searchText.toLowerCase())) {
|
||||
$(item).show();
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetSingleBookingEmployeeSearch() {
|
||||
try {
|
||||
$("#single-booking-employee-search-input").val("");
|
||||
$("#single-booking-employee-dropdown-menu .dropdown-item").show();
|
||||
|
||||
var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
|
||||
if (e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setSelectedEmployeeForSingleBooking(employeeOid) {
|
||||
function setSelectedEmployeeForSingleBooking(selectedListElement, employeeOid) {
|
||||
try {
|
||||
if(employeeOid !== null && employeeOid !== undefined && $.isNumeric(employeeOid) === true && employeeOid > 0) {
|
||||
$.get("@Url.Action("SetServiceRecordEmployee")", {employeeOid: employeeOid}, function (employeeName) {
|
||||
$("#single-booking-dropdown-employees-menu").text(employeeName);
|
||||
$.get("@Url.Action("SetServiceRecordEmployee")", {employeeOid: parseFloat(employeeOid)}, function (employeeName) {
|
||||
$("#single-booking-employee-modal-popup").parent().find(".dropdown-toggle").text(employeeName);
|
||||
$("#single-booking-employee-modal-popup").modal("hide");
|
||||
|
||||
loadServiceRecords();
|
||||
});
|
||||
@@ -147,27 +105,31 @@
|
||||
|
||||
function loadServiceRecords() {
|
||||
try {
|
||||
var selectedOption = $("#timeFrameSelect").val();
|
||||
var start = $("#time-frame-start-date").val();
|
||||
var end = $("#time-frame-end-date").val();
|
||||
var dayCount = $("#day-count-number").val();
|
||||
var year = $("#year-select").val();
|
||||
var month = $("#month-select").val();
|
||||
const selectedOption = $("#timeFrameSelect").val();
|
||||
const start = $("#time-frame-start-date").val();
|
||||
const end = $("#time-frame-end-date").val();
|
||||
const dayCount = $("#day-count-number").val();
|
||||
const year = $("#year-select").val();
|
||||
const month = $("#month-select").val();
|
||||
|
||||
if(areUndefinedOrNull([dayCount, start, end, month, year, selectedOption])) {
|
||||
return;
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
|
||||
$("#service-record-list-container").load("@Url.Action("LoadServiceRecordsNonPost")", {dayCountNumber: dayCount, start: start, end: end, month: month, year: year, recordsKey: selectedOption},
|
||||
$("#service-record-list-container").load("@Url.Action("LoadServiceRecordsNonPost")", {dayCountNumber: dayCount, start: start, end: end, month: parseInt(month), year: parseInt(year), recordsKey: parseInt(selectedOption)},
|
||||
() => {
|
||||
hideSpinner();
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function initializeIntervalSelection() {
|
||||
try {
|
||||
var selectedOption = $("#timeFrameSelect option:selected").val();
|
||||
const selectedOption = $("#timeFrameSelect option:selected").val();
|
||||
|
||||
switch (selectedOption) {
|
||||
case "0":
|
||||
@@ -199,13 +161,13 @@
|
||||
break;
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function changeServiceRecordIntervalSelection(select) {
|
||||
try {
|
||||
var selectedOption = $(select).val();
|
||||
const selectedOption = $(select).val();
|
||||
|
||||
showSpinner();
|
||||
|
||||
@@ -229,7 +191,7 @@
|
||||
hideSpinner();
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -341,50 +303,12 @@
|
||||
@* ----- Einzelbuchung: Mitarbeiter ----- *@
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="dropdown mt-3">
|
||||
@{
|
||||
var employeeButtonValue = "Mitarbeiter";
|
||||
|
||||
if(Model.SelectedEmployee != null)
|
||||
{
|
||||
employeeButtonValue = Model.SelectedEmployee.DetailDescription;
|
||||
}
|
||||
}
|
||||
|
||||
<div class="wide-dropdown">
|
||||
<div class="input-group" id="single-booking-employee-input-group">
|
||||
<div class="input-group-prepend" id="single-booking-employee-prepend">
|
||||
<span class="input-group-text prepend-input-group-text">Mitarbeiter</span>
|
||||
</div>
|
||||
<div class="input-group-append dropdown-append" id="single-booking-employee-dropdown-container">
|
||||
<button class="btn btn-primary dropdown-toggle text-truncate w-100 white-space-normal" type="button" id="single-booking-dropdown-employees-menu" data-toggle="dropdown">
|
||||
@employeeButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu" id="single-booking-employee-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control" type="text" id="single-booking-employee-search-input" placeholder="Suchen..." oninput="onSingleBookingEmployeeDropdownInput()" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="resetSingleBookingEmployeeSearch()">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
@foreach(var employee in Model.Employees)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="employee-@employee.EmployeeOid" onclick="setSelectedEmployeeForSingleBooking(@employee.EmployeeOid)">@employee.DetailDescription</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3" id="single-booking-employee-container">
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllEmployees, "setSelectedEmployeeForSingleBooking", null, Model.SelectedEmployee?.DetailDescription, "single-booking-employee-modal-popup")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@* ----- Einzelbuchung: Ziele ----- *@
|
||||
@if(Model.SelectedSupportConcept != null && Model.SelectedSupportConcept.Goals.Any())
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="container-fluid" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid lg-max-width">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button type="button" class="btn btn-primary float-right" id="qb-sig-cancel-btn">
|
||||
|
||||
@@ -20,15 +20,7 @@
|
||||
'of': 'von'
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function qbReaderDocumentReady(s, e) {
|
||||
try {
|
||||
logInfo(`Seitenanzahl: ${e.PageCount}; DocumentId: ${e.DocumentId}; ReportId: ${e.ReportId}`);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -44,6 +36,5 @@
|
||||
settings.SettingsMobile.ReaderMode = true;
|
||||
settings.SettingsMobile.AnimationEnabled = false;
|
||||
settings.ClientSideEvents.Init = "quittierungsbelegsViewerInit";
|
||||
settings.ClientSideEvents.DocumentReady = "qbReaderDocumentReady";
|
||||
}).Bind(Model.QuittierungsbelegsReportObject).GetHtml()
|
||||
}
|
||||
@@ -19,12 +19,12 @@
|
||||
try {
|
||||
cardHeaderButtonClick(cardBodyId);
|
||||
|
||||
showMessagePopupWithCallback("Unterschriften löschen", "Sind Sie sicher, die Unterschriften von " + customerName + " im Zeitraum " + timeSpan + " zu löschen?", function () {
|
||||
showMessagePopupWithCallback("Unterschriften löschen", `Sind Sie sicher, die Unterschriften von ${customerName} im Zeitraum ${timeSpan} zu löschen?`, function () {
|
||||
showSpinner();
|
||||
$("#delCSigForm-" + resultIdentifier).submit();
|
||||
$(`#delCSigForm-${resultIdentifier}`).submit();
|
||||
}, false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
try {
|
||||
cardHeaderButtonClick(cardBodyId);
|
||||
|
||||
showMessagePopupWithCallback("Unterschrift löschen", "Sind Sie sicher, die Unterschrift von " + employeeName + " für " + customerName + " im Zeitraum " + timeSpan + " zu löschen?", function () {
|
||||
showMessagePopupWithCallback("Unterschrift löschen", `Sind Sie sicher, die Unterschrift von ${employeeName} für ${customerName} im Zeitraum ${timeSpan} zu löschen?`, function () {
|
||||
showSpinner();
|
||||
$("#delESigForm-" + resultIdentifier).submit();
|
||||
$(`#delESigForm-${resultIdentifier}`).submit();
|
||||
}, false);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,34 @@
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function goToFirstQBListPage() {
|
||||
try {
|
||||
showSpinner();
|
||||
$("#report-signatures-container").load("@Url.Action("GoToFirstServiceOverviewPage")", hideSpinner);
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function goToLastQBListPage() {
|
||||
try {
|
||||
showSpinner();
|
||||
$("#report-signatures-container").load("@Url.Action("GoToLastServiceOverviewPage")", hideSpinner);
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function goToQBListPage(selectedPage) {
|
||||
try {
|
||||
showSpinner();
|
||||
$("#report-signatures-container").load("@Url.Action("LoadServiceOverviewPage")", {selectedPage: selectedPage}, hideSpinner);
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -145,6 +172,10 @@
|
||||
}
|
||||
else if(Model?.ConfirmationReceiptObject?.ConfirmationReceiptResultList?.Count > 0)
|
||||
{
|
||||
var previousPage = Model.CurrentQbEntryPage - 1 <= 0 ? 1 : Model.CurrentQbEntryPage - 1;
|
||||
var nextPage = Model.CurrentQbEntryPage + 1 > Model.QbEntryPageCount ? Model.QbEntryPageCount : Model.CurrentQbEntryPage + 1;
|
||||
var page = 1;
|
||||
|
||||
<div class="alert alert-info" role="alert">
|
||||
@Model.ConfirmationReceiptObject.Information
|
||||
</div>
|
||||
@@ -152,6 +183,80 @@
|
||||
<input type="hidden" id="service-record-count" value="@Model.ConfirmationReceiptObject.NumberOfServiceRecords" />
|
||||
<input type="hidden" id="signature-canvas-information" value="@Model.ConfirmationReceiptObject.SignatureCanvasInformation" />
|
||||
|
||||
if(Model.CurrentQbEntryPage > 3 && Model.QbEntryPageCount > 5)
|
||||
{
|
||||
page = Model.CurrentQbEntryPage - 2;
|
||||
|
||||
if(page > Model.QbEntryPageCount - 4)
|
||||
{
|
||||
page = Model.QbEntryPageCount - 4;
|
||||
}
|
||||
|
||||
if(page < 1)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
var lastPage = page + 4;
|
||||
|
||||
if(lastPage > Model.QbEntryPageCount)
|
||||
{
|
||||
lastPage = Model.QbEntryPageCount;
|
||||
}
|
||||
|
||||
var previousButtonsClass = Model.CurrentQbEntryPage == 1 ? "disabled" : string.Empty;
|
||||
var nextButtonsClass = Model.CurrentQbEntryPage == Model.QbEntryPageCount ? "disabled" : string.Empty;
|
||||
|
||||
if(Model.QbEntryPageCount > 1)
|
||||
{
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item @previousButtonsClass">
|
||||
<button type="button" class="page-link" tab-index="-1" onclick="goToFirstQBListPage()">
|
||||
<span class="fas fa-angle-double-left"></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="page-item @previousButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToQBListPage(@previousPage)">
|
||||
<span class="fas fa-angle-left"></span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
@for(; page <= lastPage; page++)
|
||||
{
|
||||
var isActive = Model.CurrentQbEntryPage == page;
|
||||
var activeClass = isActive ? "active" : string.Empty;
|
||||
|
||||
<li class="page-item @activeClass">
|
||||
@if(isActive)
|
||||
{
|
||||
<span class="page-link" onclick="goToQBListPage(@page)">
|
||||
@page
|
||||
<span class="sr-only">(current)</span>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="page-link" onclick="goToQBListPage(@page)">@page</button>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
|
||||
<li class="page-item @nextButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToQBListPage(@nextPage)">
|
||||
<span class="fas fa-angle-right"></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="page-item @nextButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToLastQBListPage()">
|
||||
<span class="fas fa-angle-double-right"></span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
}
|
||||
|
||||
foreach(var result in Model.ConfirmationReceiptObject.ConfirmationReceiptResultList)
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
@@ -282,6 +387,7 @@
|
||||
}
|
||||
|
||||
<span class="fas fa-check h-100 @hasEmployeeSignatureTextColorClass float-right pt-2"></span>
|
||||
|
||||
|
||||
<span class="float-right pt-2 text-light">m</span>
|
||||
|
||||
@@ -335,5 +441,74 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
page = Model.CurrentQbEntryPage - 2;
|
||||
|
||||
if(page > Model.QbEntryPageCount - 4)
|
||||
{
|
||||
page = Model.QbEntryPageCount - 4;
|
||||
}
|
||||
|
||||
if(page < 1)
|
||||
{
|
||||
page = 1;
|
||||
}
|
||||
|
||||
lastPage = page + 4;
|
||||
|
||||
if(lastPage > Model.QbEntryPageCount)
|
||||
{
|
||||
lastPage = Model.QbEntryPageCount;
|
||||
}
|
||||
|
||||
if(Model.QbEntryPageCount > 1)
|
||||
{
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item @previousButtonsClass">
|
||||
<button type="button" class="page-link" tab-index="-1" onclick="goToFirstQBListPage()">
|
||||
<span class="fas fa-angle-double-left"></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="page-item @previousButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToQBListPage(@previousPage)">
|
||||
<span class="fas fa-angle-left"></span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
@for(; page <= lastPage; page++)
|
||||
{
|
||||
var isActive = Model.CurrentQbEntryPage == page;
|
||||
var activeClass = isActive ? "active" : string.Empty;
|
||||
|
||||
<li class="page-item @activeClass">
|
||||
@if(isActive)
|
||||
{
|
||||
<span class="page-link" onclick="goToQBListPage(@page)">
|
||||
@page
|
||||
<span class="sr-only">(current)</span>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="page-link" onclick="goToQBListPage(@page)">@page</button>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
|
||||
<li class="page-item @nextButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToQBListPage(@nextPage)">
|
||||
<span class="fas fa-angle-right"></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="page-item @nextButtonsClass">
|
||||
<button type="button" class="page-link" tabindex="-1" onclick="goToLastQBListPage()">
|
||||
<span class="fas fa-angle-double-right"></span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -29,10 +29,6 @@
|
||||
return "@Url.Action("ChangeFilters")";
|
||||
}
|
||||
|
||||
function getSetQbFilterEnumUrl() {
|
||||
return "@Url.Action("SetQbFilterEnum")";
|
||||
}
|
||||
|
||||
function getSetCustomerUrl() {
|
||||
return "@Url.Action("SetCustomer")";
|
||||
}
|
||||
@@ -67,7 +63,7 @@
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
{
|
||||
<text>
|
||||
var windowHeight = $(window).height() * .8;
|
||||
const windowHeight = $(window).height() * .8;
|
||||
$("#qb-container").height(windowHeight);
|
||||
$("#qb-report-popup").modal("show");
|
||||
</text>
|
||||
@@ -92,7 +88,7 @@
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +99,7 @@
|
||||
reportFormWidth = getMaxWidth("sm-report-prepend-input-group-text");
|
||||
}
|
||||
|
||||
var newWidth = reportFormWidth;
|
||||
let newWidth = reportFormWidth;
|
||||
|
||||
if($(document).width() <= 768) {
|
||||
newWidth = getMaxWidth("sm-report-prepend-input-group-text");
|
||||
@@ -111,82 +107,115 @@
|
||||
|
||||
$(".sm-report-prepend-input-group-text").width(newWidth);
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setIsOnlyForSelectedEmployee() {
|
||||
try {
|
||||
var cb = $("#selected-employee-cb");
|
||||
var isChecked = cb.is(":checked");
|
||||
var employeeOid = isChecked ? parseFloat($("#employee-select option:selected").val()) : null;
|
||||
var isChecked = $("#selected-employee-cb").is(":checked");
|
||||
|
||||
$.get("@Url.Action("ChangeIsForSelectedEmployeesOnly")", { isForSelectedEmployeeOnly: isChecked, employeeOid: employeeOid});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
$.get("@Url.Action("CheckForSelectedEmployee")", function(employeeName2Oid) {
|
||||
if(!employeeName2Oid.includes("_")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [name, employeeOid] = employeeName2Oid.split("_");
|
||||
|
||||
$("#qb-employee-popup").parent().find(".dropdown-toggle").text(name);
|
||||
|
||||
$.get("@Url.Action("ChangeIsForSelectedEmployeesOnly")", {isForSelectedEmployeeOnly: isChecked, employeeOid: isChecked ? parseFloat(employeeOid) : null});
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setIsOnlyForSelectedOrganisation() {
|
||||
try {
|
||||
var cb = $("#selected-organisation-cb");
|
||||
var isChecked = cb.is(":checked");
|
||||
var organisationOid = isChecked ? parseFloat($("#organisation-select option:selected").val()) : null;
|
||||
var isChecked = $("#selected-organisation-cb").is(":checked");
|
||||
|
||||
$.get("@Url.Action("ChangeIsForSelectedOrganisationOnly")", { isForSelectedOrganisationOnly: isChecked, organisationOid: organisationOid});
|
||||
var organizationOid = null;
|
||||
|
||||
$.get("@Url.Action("CheckForSelectedOrganization")",
|
||||
function(organizationName2Oid) {
|
||||
const popup = $("#qb-organization-popup");
|
||||
|
||||
const links = popup.find("a");
|
||||
|
||||
const dropdownToggleButton = popup.parent().find(".dropdown-toggle");
|
||||
|
||||
if(organizationName2Oid === " " && links.length > 0) {
|
||||
const firstOrganization = $(links[0]);
|
||||
|
||||
dropdownToggleButton.text(firstOrganization.text());
|
||||
|
||||
const id = firstOrganization.attr("id");
|
||||
|
||||
if(false === isUndefinedOrNull(id) && id.includes("_")) {
|
||||
organizationOid = parseFloat(id.split("_")[1]);
|
||||
}
|
||||
} else if(organizationName2Oid.includes("_")) {
|
||||
const splitName2Oid = organizationName2Oid.split("_");
|
||||
|
||||
const organizationName = splitName2Oid[0];
|
||||
const oid = parseFloat(splitName2Oid[1]);
|
||||
|
||||
organizationOid = oid;
|
||||
|
||||
dropdownToggleButton.text(organizationName);
|
||||
}
|
||||
|
||||
$.get("@Url.Action("ChangeIsForSelectedOrganisationOnly")", {isForSelectedOrganisationOnly: isChecked, organisationOid: isChecked ? organizationOid : null});
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setIsOnlyForSelectedServiceCategory() {
|
||||
try {
|
||||
var cb = $("#selected-category-cb");
|
||||
var isChecked = cb.is(":checked");
|
||||
var serviceCategoryOid = isChecked ? parseFloat($("#category-select option:selected").val()) : null;
|
||||
const isChecked = $("#selected-category-cb").is(":checked");
|
||||
const serviceCategoryOid = isChecked ? parseFloat($("#category-select option:selected").val()) : null;
|
||||
|
||||
$.get("@Url.Action("ChangeIsForSelectedServiceCategoryOnly")", { isForSelectedServiceCategoryOnly: isChecked, serviceCategoryOid: serviceCategoryOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setReportEmployee() {
|
||||
function setReportEmployee(selectedDropdownItem, employeeOid) {
|
||||
try {
|
||||
var employeeOid = parseFloat($("#employee-select option:selected").val());
|
||||
if(employeeOid !== null && $.isNumeric(employeeOid)) {
|
||||
$.get("@Url.Action("SetEmployeeOid")", { employeeOid: employeeOid });
|
||||
} else {
|
||||
logWarning("employeeOid '" + employeeOid + "' ist nicht numerisch!");
|
||||
}
|
||||
$.get("@Url.Action("SetEmployeeOid")", { employeeOid: employeeOid }, function(employeeName) {
|
||||
$("#qb-employee-popup").parent().find(".dropdown-toggle").text(employeeName);
|
||||
$("#qb-employee-popup").modal("hide");
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setReportOrganisation() {
|
||||
function setReportOrganization(selectedDropdownItem, organisationOid) {
|
||||
try {
|
||||
var organisationOid = parseFloat($("#organisation-select option:selected").val());
|
||||
if(organisationOid !== null && $.isNumeric(organisationOid)) {
|
||||
$.get("@Url.Action("SetOrganisationOid")", { organisationOid: organisationOid });
|
||||
} else {
|
||||
logWarning("organisationOid '" + organisationOid + "' ist nicht numerisch!");
|
||||
$.get("@Url.Action("SetOrganisationOid")", { organisationOid: organisationOid }, function(organisationName) {
|
||||
$("#qb-organization-popup").parent().find(".dropdown-toggle").text(organisationName);
|
||||
$("#qb-organization-popup").modal("hide");
|
||||
});
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setReportServiceCategory() {
|
||||
try {
|
||||
var serviceCategoryOid = parseFloat($("#category-select option:selected").val());
|
||||
const serviceCategoryOid = parseFloat($("#category-select option:selected").val());
|
||||
if(serviceCategoryOid !== null && $.isNumeric(serviceCategoryOid)) {
|
||||
$.get("@Url.Action("SetServiceCategoryOid")", { serviceCategoryOid: serviceCategoryOid });
|
||||
} else {
|
||||
logWarning("serviceCategoryOid '" + serviceCategoryOid + "' ist nicht numerisch!");
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +225,7 @@
|
||||
|
||||
$("#load-report-form").submit();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,10 +243,10 @@
|
||||
|
||||
function checkForExistingSignature() {
|
||||
try {
|
||||
var month = $("#month-select option:selected").val();
|
||||
var year = $("#year-select option:selected").val();
|
||||
var startDay = $("#start-day-select option:selected").val();
|
||||
var endDay = $("#end-day-select option:selected").val();
|
||||
const month = $("#month-select option:selected").val();
|
||||
const year = $("#year-select option:selected").val();
|
||||
const startDay = $("#start-day-select option:selected").val();
|
||||
const endDay = $("#end-day-select option:selected").val();
|
||||
|
||||
if(startDay === 0 || endDay === 0 || year === 0 || month === 0 || areUndefinedOrNull([month, year, startDay, endDay])) {
|
||||
return;
|
||||
@@ -237,41 +266,42 @@
|
||||
|
||||
function qbFilterSelectionChange() {
|
||||
try {
|
||||
var selectedOption = $("#qb-filter-select option:selected").val();
|
||||
|
||||
const selectedOption = $("#qb-filter-select option:selected").val();
|
||||
|
||||
switch(selectedOption) {
|
||||
case "3":
|
||||
$("#team-selection-container").removeClass("d-block");
|
||||
$("#team-selection-container").addClass("d-none");
|
||||
case "3": // Klient auswählen
|
||||
$("#team-selection-container").removeClass("d-block");
|
||||
$("#team-selection-container").addClass("d-none");
|
||||
|
||||
$("#customer-selection-container").removeClass("d-none");
|
||||
$("#customer-selection-container").addClass("d-block");
|
||||
break;
|
||||
case "4":
|
||||
$("#customer-selection-container").removeClass("d-block");
|
||||
$("#customer-selection-container").addClass("d-none");
|
||||
$("#customer-selection-container").removeClass("d-none");
|
||||
$("#customer-selection-container").addClass("d-block");
|
||||
break;
|
||||
case "4": // Team auswählen
|
||||
$("#customer-selection-container").removeClass("d-block");
|
||||
$("#customer-selection-container").addClass("d-none");
|
||||
|
||||
$("#team-selection-container").removeClass("d-none");
|
||||
$("#team-selection-container").addClass("d-block");
|
||||
break;
|
||||
default:
|
||||
$("#customer-selection-container, #team-selection-container").removeClass("d-block");
|
||||
$("#customer-selection-container, #team-selection-container").addClass("d-none");
|
||||
break;
|
||||
$("#team-selection-container").removeClass("d-none");
|
||||
$("#team-selection-container").addClass("d-block");
|
||||
break;
|
||||
default:
|
||||
$("#customer-selection-container, #team-selection-container").removeClass("d-block");
|
||||
$("#customer-selection-container, #team-selection-container").addClass("d-none");
|
||||
break;
|
||||
}
|
||||
|
||||
var selectedFilterEnumUrl = getSetQbFilterEnumUrl();
|
||||
window.calcPrependWidth();
|
||||
|
||||
$.get(selectedFilterEnumUrl, {filterEnumString: selectedOption});
|
||||
$.get("@Url.Action("SetQbFilterEnum")", { filterEnumString: selectedOption });
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function onQBCustomerDropdownItemClick(customerOid) {
|
||||
function onQBCustomerDropdownItemClick(selectedDropdownItem, customerOid) {
|
||||
try {
|
||||
$.get("@Url.Action("SetCustomer")", {customerOid: customerOid}).done(function(result) {
|
||||
$("#qb-customer-dropdown-menu-btn").text(result);
|
||||
$.get("@Url.Action("SetCustomer")", {customerOid: customerOid}).done(function(customerName) {
|
||||
$("#qb-customer-popup").parent().find(".dropdown-toggle").text(customerName);
|
||||
$("#qb-customer-popup").modal("hide");
|
||||
checkForExistingSignature();
|
||||
});
|
||||
} catch(error) {
|
||||
@@ -279,113 +309,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
function onQBCustomerSearchInput() {
|
||||
function onQBTeamDropdownItemClick(selectedDropdownItem, teamOid) {
|
||||
try {
|
||||
var input = $("#qb-customer-search-input");
|
||||
|
||||
var searchText = input.val();
|
||||
|
||||
if(searchText === null || searchText === undefined || searchText.length === 0) {
|
||||
$("#qb-customer-dropdown-menu .dropdown-item").show();
|
||||
return;
|
||||
}
|
||||
|
||||
var menuItems = $("#qb-customer-dropdown-menu .dropdown-item");
|
||||
|
||||
menuItems.hide();
|
||||
|
||||
searchText = searchText.toLowerCase();
|
||||
|
||||
$.each(menuItems, function(index, item) {
|
||||
var itemText = $(item).text().toLowerCase();
|
||||
|
||||
if(itemText.includes(searchText)) {
|
||||
$(item).show();
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetQBCustomerSearch() {
|
||||
try {
|
||||
$("#qb-customer-search-input").val("");
|
||||
$("#qb-customer-dropdown-menu .dropdown-item").show();
|
||||
|
||||
var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
|
||||
if(e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onQBTeamDropdownItemClick(teamOid) {
|
||||
try {
|
||||
$.get("@Url.Action("SetTeam")", {teamOid: teamOid}).done(function(selectedTeamName) {
|
||||
$("#qb-team-dropdown-menu-btn").text(selectedTeamName);
|
||||
$.get("@Url.Action("SetTeam")", {teamOid: teamOid}).done(function(teamName) {
|
||||
$("#qb-team-popup").parent().find(".dropdown-toggle").text(teamName);
|
||||
$("#qb-team-popup").modal("hide");
|
||||
checkForExistingSignature();
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function onQBTeamSearchInput() {
|
||||
try {
|
||||
var input = $("#qb-team-search-input");
|
||||
|
||||
var searchText = input.val();
|
||||
|
||||
if (searchText === null || searchText === undefined || searchText.length === 0) {
|
||||
$("#qb-team-dropdown-menu .dropdown-item").show();
|
||||
return;
|
||||
}
|
||||
|
||||
var menuItems = $("#qb-team-dropdown-menu .dropdown-item");
|
||||
|
||||
menuItems.hide();
|
||||
|
||||
searchText = searchText.toLowerCase();
|
||||
|
||||
$.each(menuItems,
|
||||
function(index, item) {
|
||||
var itemText = $(item).text().toLowerCase();
|
||||
|
||||
if(itemText.includes(searchText)) {
|
||||
$(item).show();
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetQBTeamSearch() {
|
||||
try {
|
||||
$("#qb-team-search-input").val("");
|
||||
$("#qb-team-dropdown-menu .dropdown-item").show();
|
||||
|
||||
var e = window.event;
|
||||
e.cancelBubble = true;
|
||||
|
||||
if(e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container-fluid my-3" id="report-form-container" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid my-3 lg-max-width" id="report-form-container">
|
||||
<div class="row">
|
||||
<div class="col col-12">
|
||||
@* ----- Filter ----- *@
|
||||
<div class="mt-3">
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
@@ -396,78 +336,23 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ----- Klient ----- *@
|
||||
<div class="mt-3">
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="mt-3" id="customer-selection-container">
|
||||
@{
|
||||
var customerButtonValue = Model.SelectedCustomer?.DetailDescription ?? string.Empty;
|
||||
}
|
||||
<div class="wide-dropdown">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Klient</span>
|
||||
</div>
|
||||
<div class="input-group-append dropdown-append">
|
||||
<button class="btn btn-bewo-customers dropdown-toggle w-100 text-truncate white-space-normal" type="button" id="qb-customer-dropdown-menu-btn" data-toggle="dropdown">
|
||||
@customerButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100 dropdown-max-height" id="qb-customer-dropdown-menu">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control" type="text" id="qb-customer-search-input" placeholder="Suchen..." oninput="onQBCustomerSearchInput()" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="resetQBCustomerSearch()">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
@foreach(var customer in Model.Customers)
|
||||
{
|
||||
<a class="dropdown-item cursor-pointer" id="customer-@customer.CustomerOid" onclick="onQBCustomerDropdownItemClick(@customer.CustomerOid)">@customer.DetailDescription</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@Html.PopupWithSearchForIFilterables(Model.Customers, "onQBCustomerDropdownItemClick", null, Model.SelectedCustomer?.DetailDescription, "qb-customer-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* ----- Team ----- *@
|
||||
<div class="mt-3">
|
||||
<div class="form-row">
|
||||
<div class="col-xl">
|
||||
<div class="form-group mb-1 d-none" id="team-selection-container">
|
||||
<div class="input-group">
|
||||
@{
|
||||
var teamButtonValue = Model.SelectedTeam?.DetailDescription ?? string.Empty;
|
||||
}
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">Team</div>
|
||||
</div>
|
||||
<div class="input-group-append dropdown-append">
|
||||
<button type="button" class="btn btn-bewo-teams dropdown-toggle w-100 text-truncate white-space-normal" id="qb-team-dropdown-menu-btn" data-toggle="dropdown">
|
||||
@teamButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100 dropdown-max-height" id="qb-team-dropdown-menu">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control" type="text" id="qb-team-search-input" placeholder="Suchen..." oninput="onQBTeamSearchInput()" />
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-secondary" onclick="resetQBTeamSearch()">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
@foreach(var team in Model.AllTeams)
|
||||
{
|
||||
<a class="dropdown-item cursor-pointer" id="team-@team.TeamOid" onclick="onQBTeamDropdownItemClick(@team.TeamOid)">@team.DetailDescription</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@*@Html.DropDownListFor(m => m.SelectedTeamOid, Model.Teams, new { id = "teams-drop-down", @class = "custom-select", onchange = "checkForExistingSignature()" })*@
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="mb-1 d-none" id="team-selection-container">
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllTeams, "onQBTeamDropdownItemClick", null, Model.SelectedTeam?.DetailDescription, "qb-team-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -484,7 +369,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-1 collapse" id="employee-select-container">
|
||||
@Html.DropDownListFor(m => m.SelectedEmployeeOid, Model.EmployeeItems, new { id = "employee-select", @class = "custom-select", onchange = "setReportEmployee()" })
|
||||
@Html.PopupWithSearchForIFilterables(Model.Employees, "setReportEmployee", null, Model.SelectedEmployee?.DetailDescription, "qb-employee-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
@@ -496,7 +381,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group mb-1 collapse" id="organisation-select-container">
|
||||
@Html.DropDownListFor(m => m.SelectedOrganisationOid, Model.OrganisationItems, new { id = "organisation-select", @class = "custom-select", onchange = "setReportOrganisation()" })
|
||||
@Html.PopupWithSearchForIFilterables(Model.Organisations, "setReportOrganization", null, Model.SelectedOrganisation?.DetailDescription, "qb-organization-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl">
|
||||
@@ -566,7 +451,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@* Info-, Erstellen- und Vorschau-Buttons *@
|
||||
<div class="clearfix mt-3">
|
||||
<button type="button" class="btn btn-info float-left" data-toggle="modal" data-target="#qb-info-popup">
|
||||
@@ -574,8 +459,8 @@
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary float-right" id="create-button" onclick="createServiceOverview()">Erstellen</button>
|
||||
|
||||
@using(Html.BeginForm("LoadQuittierungsbeleg", "Report", FormMethod.Post, new {id="load-report-form"}))
|
||||
|
||||
@using(Html.BeginForm("LoadQuittierungsbeleg", "Report", FormMethod.Post, new { id = "load-report-form" }))
|
||||
{
|
||||
<button type="button" class="btn btn-primary float-right mr-2" onclick="previewQBReport()">
|
||||
<span class="fas fa-file-alt"></span>
|
||||
@@ -591,13 +476,13 @@
|
||||
</div>
|
||||
|
||||
<!-- Container für die Mitarbeiterunterschrift -->
|
||||
<div class="container-fluid d-none my-3" id="report-signature-container" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid d-none my-3 lg-max-width" id="report-signature-container">
|
||||
|
||||
</div>
|
||||
<!-- /Container für die Mitarbeiterunterschrift -->
|
||||
|
||||
<!-- Container für die Unterschrift -->
|
||||
<div class="container-fluid d-none my-3" id="report-signature-container-div" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid d-none my-3 lg-max-width" id="report-signature-container-div">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@@ -634,7 +519,7 @@
|
||||
|
||||
<!-- Popup der Legende -->
|
||||
<div class="modal" tabindex="-1" role="dialog" id="qb-info-popup">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title text-danger font-weight-bold">Legende</h5>
|
||||
|
||||
@@ -31,15 +31,13 @@
|
||||
locale: "de",
|
||||
format: "L"
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
calcPrependWidth();
|
||||
window.calcPrependWidth();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -47,28 +45,28 @@
|
||||
try {
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: relOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectMonth(parameterType, parameterOid) {
|
||||
try {
|
||||
var selectedMonth = $("#month-select").find(":selected").val().toString();
|
||||
var selectedYear = $("#month-year-select").find(":selected").val().toString();
|
||||
const selectedMonth = $("#month-select").find(":selected").val().toString();
|
||||
const selectedYear = $("#month-year-select").find(":selected").val().toString();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: `${selectedMonth}_${selectedYear}`});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectYear(parameterType, parameterOid) {
|
||||
try {
|
||||
var selectedYear = $("#month-year-select").find(":selected").val();
|
||||
const selectedYear = $("#month-year-select").find(":selected").val();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: selectedYear.toString()});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,14 +74,14 @@
|
||||
try {
|
||||
var searchText = $(element).val();
|
||||
|
||||
var id = $(element).attr("id");
|
||||
const id = $(element).attr("id");
|
||||
|
||||
var prefix = "";
|
||||
let prefix = "";
|
||||
|
||||
if (id !== undefined && id !== null && id.includes("-")) {
|
||||
var splitId = id.split("-");
|
||||
const splitId = id.split("-");
|
||||
|
||||
if (splitId.length > 1) {
|
||||
if(splitId.length > 1) {
|
||||
prefix = splitId[1];
|
||||
}
|
||||
}
|
||||
@@ -93,20 +91,20 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var menuItems = $(`#query-${prefix}-dropdown-menu .dropdown-item`);
|
||||
const menuItems = $(`#query-${prefix}-dropdown-menu .dropdown-item`);
|
||||
|
||||
menuItems.hide();
|
||||
|
||||
$.each(menuItems,
|
||||
function (index, item) {
|
||||
var itemText = $(item).text().toLowerCase();
|
||||
const itemText = $(item).text().toLowerCase();
|
||||
|
||||
if(itemText.includes(searchText.toLowerCase())) {
|
||||
$(item).show();
|
||||
}
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,99 +113,94 @@
|
||||
$(`#query-${prefix}-search-input`).val("");
|
||||
$(`#query-${prefix}-dropdown-menu .dropdown-item`).show();
|
||||
|
||||
var e = window.event;
|
||||
const e = window.event;
|
||||
e.cancelBubble = true;
|
||||
if(e.stopPropagation) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectEmployeeParameter(element, employeeOid, parameterType, parameterOid) {
|
||||
try {
|
||||
$("#dropdownEmployeesMenu").text($(element).text());
|
||||
$("#query-employee-popup").modal("hide");
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: employeeOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectCustomerParameter(element, customerOid, parameterType, parameterOid) {
|
||||
try {
|
||||
$("#dropdownCustomersMenu").text($(element).text());
|
||||
$("#query-customer-popup").modal("hide");
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: customerOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectOrganisationParameter(element, organisationOid, parameterType, parameterOid) {
|
||||
function selectOrganizationParameter(element, organizationOid, parameterType, parameterOid) {
|
||||
try {
|
||||
$("#dropdownOrganisationsMenu").text(organisationOid === 0 ? "Organisation" : $(element).text());
|
||||
$("#query-organization-popup").modal("hide");
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: organisationOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: organizationOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectServiceCategoryParameter(element, parameterType, parameterOid) {
|
||||
try {
|
||||
var serviceCategoryOid = $(element).find(":selected").val();
|
||||
const serviceCategoryOid = $(element).find(":selected").val();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: serviceCategoryOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectTeamParameter(element, teamOid, parameterType, parameterOid) {
|
||||
try {
|
||||
$("#query-team-popup").modal("hide");
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: teamOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectValueListEntry(element, parameterType, parameterOid) {
|
||||
try {
|
||||
var selectedOption = $(element).find(":selected");
|
||||
var valueListEntryOid = selectedOption.val();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: valueListEntryOid, parameterType: parameterType, parameterOid: parameterOid});
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: $(element).find(":selected").val(), parameterType: parameterType, parameterOid: parameterOid});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectQueryText(element, parameterType, parameterOid) {
|
||||
try {
|
||||
var selectedText = $(element).val();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: selectedText});
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: $(element).val()});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectQueryDate(element, parameterType, parameterOid) {
|
||||
try {
|
||||
var date = $(element).val().toString();
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: date});
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: $(element).val().toString()});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function selectQueryDateRange(parameterType, parameterOid) {
|
||||
try {
|
||||
var start = $("#query-date-range-start").val().toString();
|
||||
var end = $("#query-date-range-end").val().toString();
|
||||
const start = $("#query-date-range-start").val().toString();
|
||||
const end = $("#query-date-range-end").val().toString();
|
||||
|
||||
if(!start || !end) {
|
||||
return;
|
||||
@@ -215,7 +208,20 @@
|
||||
|
||||
$("#berichte-form-container").load("@Url.Action("SelectQueryParameter")", {objectOid: null, parameterType: parameterType, parameterOid: parameterOid, textValue: `${start}_${end}`});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function executeQueryButtonClick() {
|
||||
try {
|
||||
showSpinner();
|
||||
$("#msk-report-container").load("@Url.Action("ExecuteQuery")",
|
||||
function () {
|
||||
hideSpinner();
|
||||
$("#bewo-report-popup").modal("show");
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -244,7 +250,7 @@
|
||||
<div class="col-md">
|
||||
<div class="container p-0">
|
||||
<div class="row">
|
||||
<div class="col mt-3">
|
||||
<div class="col mb-3">
|
||||
<div class="list-group">
|
||||
<a href="#" class="list-group-item flex-column align-items-start no-underline" data-toggle="modal" data-target="#supportConceptList">
|
||||
<div class="d-flex">
|
||||
@@ -307,103 +313,43 @@
|
||||
break;
|
||||
case QueryParameterType.Employee:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="dropdown mt-3">
|
||||
@{
|
||||
var employeeButtonValue = "Mitarbeiter";
|
||||
<div class="col-md mb-3">
|
||||
@{
|
||||
var employeeButtonValue = "Mitarbeiter";
|
||||
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid) && Model.SelectedValues[parameterOid].Parameter is CompactEmployeeDC selectedEmployee)
|
||||
{
|
||||
employeeButtonValue = selectedEmployee.DetailDescription;
|
||||
}
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid) && Model.SelectedValues[parameterOid].Parameter is CompactEmployeeDC selectedEmployee)
|
||||
{
|
||||
employeeButtonValue = selectedEmployee.DetailDescription;
|
||||
}
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend wide-dropdown">
|
||||
<button class="btn btn-bewo-employee dropdown-toggle w-100" type="button" id="dropdownEmployeesMenu" data-toggle="dropdown">
|
||||
@employeeButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100" id="query-employee-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control" id="query-employee-search-input" type="text" placeholder="Suchen..." oninput="onDropdownParameterInput(this)" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="resetDropdownParameterSearch('employee')">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-team-0" onclick="selectEmployeeParameter(this, 0, @parameterType, @parameterOid)"> </a>
|
||||
@foreach(var employee in Model.AllEmployeesForQueries)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-employee-@employee.EmployeeOid" onclick="selectEmployeeParameter(this, @employee.EmployeeOid, @parameterType, @parameterOid)">@employee.DetailDescription</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-append" style="min-width: min-content !important;">
|
||||
<button class="btn btn-outline-bewo-employee w-100" type="button" onclick="selectEmployeeParameter(getElementById('query-employee-0'), 0, @parameterType, @parameterOid)">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllEmployeesForQueries, "selectEmployeeParameter", $"{parameterType}, {parameterOid}", employeeButtonValue, "query-employee-popup", false, true, true, true)
|
||||
</div>
|
||||
</div>
|
||||
break;
|
||||
case QueryParameterType.Customer:
|
||||
if(Model.AllCustomersForQueries.Any())
|
||||
{
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="dropdown mt-3">
|
||||
@{
|
||||
var customerButtonValue = "Klient";
|
||||
<div class="form-row">
|
||||
<div class="col-md mb-3">
|
||||
@{
|
||||
var customerButtonValue = "Klient";
|
||||
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid))
|
||||
{
|
||||
if(Model.SelectedValues[parameterOid].Parameter is CompactCustomerDC selectedCustomer)
|
||||
{
|
||||
customerButtonValue = selectedCustomer.DetailDescription;
|
||||
}
|
||||
}
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid))
|
||||
{
|
||||
if(Model.SelectedValues[parameterOid].Parameter is CompactCustomerDC selectedCustomer)
|
||||
{
|
||||
customerButtonValue = selectedCustomer.DetailDescription;
|
||||
}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend wide-dropdown">
|
||||
<button class="btn btn-bewo-customers dropdown-toggle w-100" type="button" id="dropdownCustomersMenu" data-toggle="dropdown">
|
||||
@customerButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100" id="query-customer-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control w-100" id="query-customer-search-input" type="text" placeholder="Suchen ..." oninput="onDropdownParameterInput(this)" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" onclick="resetDropdownParameterSearch('customer')">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-customer-0" onclick="selectCustomerParameter(this, 0, @parameterType, @parameterOid)"> </a>
|
||||
@foreach(var customer in Model.AllCustomersForQueries)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-customer-@customer.CustomerOid" onclick="selectCustomerParameter(this, @customer.CustomerOid, @parameterType, @parameterOid)">@customer.DetailDescription</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-append" style="min-width: min-content !important;">
|
||||
<button class="btn btn-outline-bewo-customers w-100" type="button" onclick="selectCustomerParameter(getElementById('query-customer-0', 0, @parameterType, @parameterOid))">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllCustomersForQueries, "selectCustomerParameter", $"{parameterType}, {parameterOid}", customerButtonValue, "query-customer-popup", false, true, true, true)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
break;
|
||||
case QueryParameterType.Month:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -474,7 +420,7 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group date" id="query-date-picker" data-target-input="nearest">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -503,7 +449,7 @@
|
||||
}
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group date" id="query-date-range-start-picker" data-target-input="nearest">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -520,7 +466,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group date" id="query-date-range-end-picker" data-target-input="nearest">
|
||||
<input onfocusout="selectQueryDateRange(@parameterType, @parameterOid)" value="@endValue" type="text" id="query-date-range-end" name="query-date-range-end" class="form-control datetimepicker-input" data-target="#query-date-range-end-picker" data-toggle="datetimepicker" />
|
||||
<div class="input-group-append" data-target="#query-date-range-end-picker" data-toggle="datetimepicker">
|
||||
@@ -535,54 +481,24 @@
|
||||
break;
|
||||
case QueryParameterType.Team:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="dropdown mt-3">
|
||||
@{
|
||||
var teamButtonValue = "Team";
|
||||
<div class="col-md mb-3">
|
||||
@{
|
||||
var teamButtonValue = "Team";
|
||||
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid) && Model.SelectedValues[parameterOid].Parameter is CompactTeamDC selectedTeam)
|
||||
{
|
||||
teamButtonValue = selectedTeam.Name;
|
||||
}
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid) && Model.SelectedValues[parameterOid].Parameter is CompactTeamDC selectedTeam)
|
||||
{
|
||||
teamButtonValue = selectedTeam.Name;
|
||||
}
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend wide-dropdown">
|
||||
<button class="btn btn-bewo-teams dropdown-toggle w-100" type="button" id="dropdownTeamsMenu" data-toggle="dropdown">
|
||||
@teamButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100" id="query-team-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control w-100" id="query-team-search-input" type="text" placeholder="Suchen ..." oninput="onDropdownParameterInput(this)" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-bewo-teams" type="button" onclick="resetDropdownParameterSearch('team')">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-team-0" onclick="selectTeamParameter(this, 0, @parameterType, @parameterOid)"> </a>
|
||||
|
||||
@foreach(var team in Model.AllTeamsForQueries)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-team-@team.TeamOid" onclick="selectTeamParameter(this, @team.TeamOid, @parameterType, @parameterOid)">@team.Name</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-append" style="min-width: min-content !important;">
|
||||
<button class="btn btn-outline-secondary w-100" type="button" onclick="selectTeamParameter(getElementById('query-team-0', 0, @parameterType, @parameterOid))">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllTeamsForQueries, "selectTeamParameter", $"{parameterType}, {parameterOid}", teamButtonValue, "query-team-popup", false, true, true, true)
|
||||
</div>
|
||||
</div>
|
||||
break;
|
||||
case QueryParameterType.ServiceCategory:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -615,7 +531,7 @@
|
||||
case QueryParameterType.Text:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -634,7 +550,7 @@
|
||||
case QueryParameterType.Year:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
@@ -665,7 +581,7 @@
|
||||
case QueryParameterType.ValueListEntryType:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">
|
||||
@@ -713,49 +629,21 @@
|
||||
break;
|
||||
case QueryParameterType.Organisation:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="dropdown mt-3">
|
||||
<div class="col-md mb-3">
|
||||
<div class="dropdown">
|
||||
@{
|
||||
var organisationButtonValue = "Organisation";
|
||||
var organizationButtonValue = "Organisation";
|
||||
|
||||
if(Model.SelectedValues.ContainsKey(parameterOid))
|
||||
{
|
||||
if(Model.SelectedValues[parameterOid].Parameter is CompactOrganisationDC selectedOrganisation)
|
||||
{
|
||||
organisationButtonValue = selectedOrganisation.DetailDescription;
|
||||
organizationButtonValue = selectedOrganisation.DetailDescription;
|
||||
}
|
||||
}
|
||||
}
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend wide-dropdown">
|
||||
<button class="btn btn-bewo-organisation dropdown-toggle w-100" type="button" id="dropdownOrganisationsMenu" data-toggle="dropdown">
|
||||
@organisationButtonValue
|
||||
</button>
|
||||
<div class="dropdown-menu w-100" id="query-organisation-dropdown-menu" style="max-height: 90vh !important; overflow-y: auto !important;">
|
||||
<div class="input-group px-2">
|
||||
<input class="form-control w-100" id="query-organisation-search-input" type="text" placeholder="Suchen ..." oninput="onDropdownParameterInput(this)" />
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-bewo-organisation" type="button" onclick="resetDropdownParameterSearch('organisation')">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-organisation-0" onclick="selectOrganisationParameter(this, 0, @parameterType, @parameterOid)"> </a>
|
||||
@foreach(var organisation in Model.AllOrganisationForQuery)
|
||||
{
|
||||
<a class="dropdown-item" style="cursor: pointer;" id="query-organisation-@organisation.OrganisationOid" onclick="selectOrganisationParameter(this, @organisation.OrganisationOid, @parameterType, @parameterOid)">@organisation.Name</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group-append" style="min-width: min-content !important;">
|
||||
<button class="btn btn-outline-secondary w-100" type="button" onclick="selectOrganisationParameter(getElementById('query-organisation-0', 0, @parameterType, @parameterOid))">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllOrganisationForQuery, "selectOrganizationParameter", $"{parameterType}, {parameterOid}", organizationButtonValue, "query-organization-popup", false, true, true, true)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -763,7 +651,7 @@
|
||||
case QueryParameterType.Custom:
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<div class="form-group my-2">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">
|
||||
@@ -787,9 +675,8 @@
|
||||
<hr />
|
||||
<div class="form-row">
|
||||
<div class="col-md">
|
||||
<button class="btn btn-primary" type="button">Bericht öffnen</button>
|
||||
<button class="btn btn-primary" type="button" onclick="executeQueryButtonClick()">Bericht öffnen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,18 +19,18 @@
|
||||
|
||||
function toggleMitarbeiterstundenForm() {
|
||||
try {
|
||||
var isEmployeeFormSelected = $("#msk-filterForEmployeesRadio").prop("checked");
|
||||
const isEmployeeFormSelected = $("#msk-filterForEmployeesRadio").prop("checked");
|
||||
|
||||
$((isEmployeeFormSelected ? "#msk-employee-form" : "#msk-team-form")).show();
|
||||
$((isEmployeeFormSelected ? "#msk-team-form" : "#msk-employee-form")).hide();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function updateForm() {
|
||||
try {
|
||||
var selectedReportType = $("#msk-report-type-select").val();
|
||||
const selectedReportType = $("#msk-report-type-select").val();
|
||||
|
||||
showSpinner();
|
||||
$("#msk-form-col").load("@Url.Action("LoadViewerForm")", { reportType: selectedReportType }, function () {
|
||||
@@ -39,7 +39,7 @@
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,14 +47,14 @@
|
||||
try {
|
||||
$.get("@Url.Action("ResetReport")");
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container my-3" style="max-width: 1200px !important;">
|
||||
<div class="container my-3 lg-max-width">
|
||||
<div class="row h-auto" id="abc-def">
|
||||
<div class="col-sm-12 col-md-4 col-lg-4 col-xl-3">
|
||||
<div class="col-sm-12 col-md-4 col-lg-4 col-xl-3 mb-2">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@Html.DropDownListFor(model => model.SelectedReportType, Model.ReportTypes, new { @class = "custom-select", onchange = "updateForm()", id = "msk-report-type-select" })
|
||||
|
||||
@@ -16,58 +16,43 @@
|
||||
<script type="text/javascript">
|
||||
function reportFilterOnChange() {
|
||||
try {
|
||||
toggleMitarbeiterstundenForm();
|
||||
window.toggleMitarbeiterstundenForm();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function allEmployeesCbOnClick() {
|
||||
try {
|
||||
var isChecked = $("#msk-all-employees-cb").is(':checked');
|
||||
const isChecked = $("#msk-all-employees-cb").is(':checked');
|
||||
|
||||
$("#msk-employee-list").toggle(isChecked);
|
||||
|
||||
if(isChecked) {
|
||||
$("#msk-form-warning").hide();
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function allTeamsCbOnClick() {
|
||||
try {
|
||||
var isChecked = $("#msk-all-teams-cb").is(':checked');
|
||||
const isChecked = $("#msk-all-teams-cb").is(':checked');
|
||||
|
||||
$("#msk-team-list").toggle(isChecked);
|
||||
|
||||
if (isChecked) {
|
||||
$("#msk-form-warning").hide();
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function createMitarbeiterstundenkontoReport() {
|
||||
try {
|
||||
var formWarning = $("#msk-form-warning");
|
||||
formWarning.hide();
|
||||
formWarning.empty();
|
||||
const month = parseInt($("#msk-month-select :selected").val());
|
||||
const year = parseInt($("#msk-year-select :selected").val());
|
||||
|
||||
var month = $("#msk-month-select :selected").val();
|
||||
var year = $("#msk-year-select :selected").val();
|
||||
const allEmployees = $("#msk-all-employees-cb").is(':checked');
|
||||
const allTeams = $("#msk-all-teams-cb").is(':checked');
|
||||
|
||||
var allEmployees = $("#msk-all-employees-cb").is(':checked');
|
||||
var allTeams = $("#msk-all-teams-cb").is(':checked');
|
||||
let ansicht = 0;
|
||||
|
||||
var employeeOid = $("#msk-employee-select :selected").val();
|
||||
var teamOid = $("#msk-team-select :selected").val();
|
||||
|
||||
var ansicht = 0;
|
||||
|
||||
if ($("#msk-tagesansicht-cb").length) {
|
||||
if($("#msk-tagesansicht-cb").length) {
|
||||
ansicht = $("#msk-tagesansicht-cb").is('checked') ? 1 : 0;
|
||||
} else {
|
||||
switch ($("input[name=msk-ansichtsradio]:checked").attr("id")) {
|
||||
@@ -83,63 +68,49 @@
|
||||
}
|
||||
}
|
||||
|
||||
var teamForm = $("#msk-team-form");
|
||||
var employeeForm = $("#msk-employee-form");
|
||||
const teamForm = $("#msk-team-form");
|
||||
const employeeForm = $("#msk-employee-form");
|
||||
|
||||
var isEmployeeFormSelected = employeeForm.css("display") === "block" || employeeForm.css("display") === "none" && (teamForm.css("display") === "none" || teamForm.length === 0);
|
||||
const isEmployeeFormSelected = employeeForm.css("display") === "block" || employeeForm.css("display") === "none" && (teamForm.css("display") === "none" || teamForm.length === 0);
|
||||
|
||||
var parameterString = month + ";" + year + ";" + isEmployeeFormSelected + ";";
|
||||
const buttonTextLength = $("#msk-team-popup").parent().find(".dropdown-toggle").text().length;
|
||||
|
||||
if(isEmployeeFormSelected) {
|
||||
if (allEmployees === false && employeeOid === "0") {
|
||||
formWarning.removeClass("d-none");
|
||||
formWarning.html("Bitte wählen Sie einen Mitarbeiter aus.");
|
||||
formWarning.show();
|
||||
return;
|
||||
} else {
|
||||
parameterString += allEmployees + ";" + employeeOid;
|
||||
}
|
||||
} else {
|
||||
if (allTeams === false && teamOid === "0") {
|
||||
formWarning.removeClass("d-none");
|
||||
formWarning.html("Bitte wählen Sie ein Team aus.");
|
||||
formWarning.show();
|
||||
return;
|
||||
} else {
|
||||
parameterString += allTeams + ";" + teamOid;
|
||||
}
|
||||
if(false === isEmployeeFormSelected && buttonTextLength === 0) {
|
||||
window.showAlertMessageBoxWithoutCallback("Mitarbeiterstundenkonto", "Bitte wählen Sie ein Team aus.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
parameterString += `;${ansicht}`;
|
||||
const all = allEmployees === true || allTeams === true;
|
||||
|
||||
showSpinner();
|
||||
$("#msk-report-container").load("@Url.Action("LoadMitarbeiterstundenkonto")", { parameters: parameterString }, function() {
|
||||
$("#msk-report-container").load("@Url.Action("LoadMitarbeiterstundenkonto")", {ansicht: ansicht, month: month, year: year, all: all, isEmployee: isEmployeeFormSelected }, function() {
|
||||
hideSpinner();
|
||||
$("#bewo-report-popup").modal("show");
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function loadCustomReport() {
|
||||
try {
|
||||
var selectedReportOid2HasParameters = $("#msk-customReportSelect").val();
|
||||
const selectedReportOid2HasParameters = $("#msk-customReportSelect").val();
|
||||
|
||||
if(selectedReportOid2HasParameters === undefined || selectedReportOid2HasParameters === null || selectedReportOid2HasParameters.includes("_") === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
var oid2HasParams = selectedReportOid2HasParameters.split("_");
|
||||
const oid2HasParams = selectedReportOid2HasParameters.split("_");
|
||||
|
||||
var hasParameters = oid2HasParams[1] === "1";
|
||||
const hasParameters = oid2HasParams[1] === "1";
|
||||
|
||||
var selectedReportOid = oid2HasParams[0];
|
||||
const selectedReportOid = oid2HasParams[0];
|
||||
|
||||
if(hasParameters) {
|
||||
$("#berichte-form-container").load("@Url.Action("LoadBerichteForm")", {reportOid: selectedReportOid}, function() {
|
||||
hideSpinner();
|
||||
toggleMitarbeiterstundenForm();
|
||||
window.toggleMitarbeiterstundenForm();
|
||||
$("#berichte-form-container").show();
|
||||
});
|
||||
} else {
|
||||
@@ -148,15 +119,38 @@
|
||||
$("#berichte-form-container").hide();
|
||||
$("#msk-report-container").load("@Url.Action("LoadCustomReport")", {reportOid: selectedReportOid}, function () {
|
||||
hideSpinner();
|
||||
toggleMitarbeiterstundenForm();
|
||||
window.toggleMitarbeiterstundenForm();
|
||||
$("#bewo-report-popup").modal("show");
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setEmployee(element, oid) {
|
||||
try {
|
||||
$.get("@Url.Action("SetEmployeeForMitarbeiterstundenkonto")", {employeeOid: oid}).done(
|
||||
function(employeeName) {
|
||||
$("#msk-employee-popup").parent().find(".dropdown-toggle").text(employeeName);
|
||||
$("#msk-employee-popup").modal("hide");
|
||||
});
|
||||
} catch(error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function setTeam(element, oid) {
|
||||
try {
|
||||
$.get("@Url.Action("SetTeamForMitarbeiterstundenkonto")", {teamOid: oid}).done(
|
||||
function(teamName) {
|
||||
$("#msk-team-popup").parent().find(".dropdown-toggle").text(teamName);
|
||||
$("#msk-team-popup").modal("hide");
|
||||
});
|
||||
} catch (error) {
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -174,13 +168,6 @@
|
||||
@if(Model.SelectedReportType == ReportType.Mitarbeiterstundenkonto && AbstractModel.HasRightToViewMitarbeiterstundenkonto)
|
||||
{
|
||||
<div id="report-form-container">
|
||||
<div class="form-row">
|
||||
<div class="col">
|
||||
<div class="alert alert-danger d-none w-100" role="alert" id="msk-form-warning">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(AbstractModel.HasRightMitarbeiterstundenkontoViewAll || AbstractModel.HasRightMitarbeiterstundenkontoViewTeams)
|
||||
{
|
||||
<div class="form-row">
|
||||
@@ -214,8 +201,8 @@
|
||||
</div>
|
||||
}
|
||||
<div class="form-row" id="msk-employee-list">
|
||||
<div class="col">
|
||||
@Html.DropDownListFor(model => model.SelectedEmployeeOid, Model.Employees, new { @class = "custom-select mb-3", id = "msk-employee-select" })
|
||||
<div class="col mb-3">
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllEmployees, "setEmployee", null, Model.SelectedEmployee?.DetailDescription, "msk-employee-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,8 +219,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row" id="msk-team-list">
|
||||
<div class="col">
|
||||
@Html.DropDownListFor(model => model.SelectedTeamOid, Model.Teams, new { @class = "custom-select mb-3", id = "msk-team-select" })
|
||||
<div class="col mb-3">
|
||||
@Html.PopupWithSearchForIFilterables(Model.AllTeams, "setTeam", null, Model.SelectedTeam?.DetailDescription, "msk-team-popup", false)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
try {
|
||||
$("#scheduler-start-time, #scheduler-end-time").attr("disabled", $("#IsAllDay").prop("checked"));
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
$(".scheduler-form-prepend-text").width(width);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -45,7 +45,7 @@
|
||||
{
|
||||
var disabled = Model.SelectedAppointment?.AllDay ?? false ? "disabled" : string.Empty;
|
||||
|
||||
<div class="mt-3">
|
||||
<div class="mt-0">
|
||||
<div class="form-row">
|
||||
<div class="col-7 mx-0 pr-1">
|
||||
<div class="form-group mb-1 mr-0 pr-0">
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
$("#interval-finder-validation-alert").html("");
|
||||
$("#interval-finder-validation-alert").collapse("hide");
|
||||
|
||||
var isValid = validateIntervalFinderForm();
|
||||
const isValid = validateIntervalFinderForm();
|
||||
|
||||
if(isValid === false) {
|
||||
hideSpinner();
|
||||
@@ -65,7 +65,7 @@
|
||||
$("#hidden-submit-btn").click();
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,22 +73,22 @@
|
||||
var isValid = false;
|
||||
|
||||
try {
|
||||
var validationAlert = $("#interval-finder-validation-alert");
|
||||
const validationAlert = $("#interval-finder-validation-alert");
|
||||
|
||||
validationAlert.html("");
|
||||
|
||||
var duration = parseInt($("#interval-duration").val());
|
||||
const duration = parseInt($("#interval-duration").val());
|
||||
|
||||
var start = getDateTimeFromPicker("scheduler-interval-start", "scheduler-interval-start-time");
|
||||
var end = getDateTimeFromPicker("scheduler-interval-end", "scheduler-interval-end-time");
|
||||
const start = getDateTimeFromPicker("scheduler-interval-start", "scheduler-interval-start-time");
|
||||
const end = getDateTimeFromPicker("scheduler-interval-end", "scheduler-interval-end-time");
|
||||
|
||||
var isStartValid = start !== null && isValidDate(new Date(start));
|
||||
var isEndValid = end !== null && isValidDate(new Date(end));
|
||||
const isStartValid = start !== null && isValidDate(new Date(start));
|
||||
const isEndValid = end !== null && isValidDate(new Date(end));
|
||||
|
||||
isValid = isStartValid && isEndValid && duration > 0 && (start !== null && start !== undefined && start.isBefore(end));
|
||||
|
||||
if(isValid === false) {
|
||||
var validationMessage = "";
|
||||
let validationMessage = "";
|
||||
|
||||
if(isStartValid === false && isEndValid === false) {
|
||||
validationMessage = "Das Start- und Endwerte sind ungültig!";
|
||||
@@ -118,7 +118,7 @@
|
||||
validationAlert.collapse("show");
|
||||
}
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
} finally {
|
||||
return isValid;
|
||||
}
|
||||
@@ -126,13 +126,13 @@
|
||||
|
||||
function getDateTimeFromPicker(datePickerId, timePickerId) {
|
||||
try {
|
||||
var dateVal = $("#" + datePickerId).datetimepicker("viewDate");
|
||||
var timeVal = $("#" + timePickerId).val();
|
||||
const dateVal = $(`#${datePickerId}`).datetimepicker("viewDate");
|
||||
const timeVal = $(`#${timePickerId}`).val();
|
||||
|
||||
var timeRegEx = new RegExp('^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$');
|
||||
const timeRegEx = new RegExp('^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$');
|
||||
|
||||
if(isValidDate(new Date(dateVal)) && timeRegEx.test(timeVal)) {
|
||||
var hm = timeVal.split(":");
|
||||
const hm = timeVal.split(":");
|
||||
|
||||
if(hm.length === 2 && $.isNumeric(hm[0]) && $.isNumeric(hm[1])) {
|
||||
dateVal.hours(parseInt(hm[0]));
|
||||
@@ -144,12 +144,12 @@
|
||||
|
||||
return null;
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
$("#interval-form-container").ready(function() {
|
||||
var width = getMaxWidth("prepend-text");
|
||||
const width = getMaxWidth("prepend-text");
|
||||
$(".prepend-text").width(width);
|
||||
});
|
||||
|
||||
@@ -166,13 +166,13 @@
|
||||
var employeeOids = parseJason(jsonResult);
|
||||
|
||||
$("#employees-interval-finder-popup .popup-list-item-container input[type=checkbox]").map(function() {
|
||||
var employeeOid = $(this).attr("id").split("-")[1];
|
||||
const employeeOid = $(this).attr("id").split("-")[1];
|
||||
|
||||
if($.isNumeric(employeeOid) === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
var numericEmployeeOid = parseInt(employeeOid);
|
||||
const numericEmployeeOid = parseInt(employeeOid);
|
||||
|
||||
if(employeeOids.includes(numericEmployeeOid)) {
|
||||
$(this).prop("checked", true);
|
||||
@@ -182,7 +182,7 @@
|
||||
changeItemListSelection('@Url.Action("SelectEmployeesForIntervalFinder", "Scheduler")', 'employees-interval-finder-popup', 'selected-employees-interval-finder-list', 'related-employee-interval-finder-', false, '-interval-finder-checkbox', '@Url.Action("FetchAppointments", "Scheduler")');
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -191,7 +191,7 @@
|
||||
<div class="alert alert-danger collapse" role="alert" id="interval-finder-validation-alert"></div>
|
||||
@using(Html.BeginForm("FindFreeIntervals", "Scheduler", FormMethod.Post, new { id = "find-appointment-intervals-form", @class = "needs-validation", novalidate = true }))
|
||||
{
|
||||
<div class="mt-3">
|
||||
<div>
|
||||
<div class="form-row">
|
||||
<div class="col-7 mx-0 pr-1">
|
||||
<div class="form-group mb-1 mr-0 pr-0">
|
||||
|
||||
@@ -12,55 +12,50 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if(Model.FreeIntervals.Count > 0)
|
||||
@if(Model.FreeIntervals.Any())
|
||||
{
|
||||
<div class="container-fluid mx-0 px-0">
|
||||
<div class="row">
|
||||
@foreach(var kv in Model.FreeIntervals)
|
||||
{
|
||||
<div class="col-sm-12 col-md-6 col-lg-4">
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" data-toggle="collapse" data-target="#collapsable-date-list-@kv.Key.Ticks">
|
||||
<div class="d-flex align-items-center">
|
||||
<h5 class="mr-auto">@kv.Key.ToShortDateString()</h5>
|
||||
<div class="btn-group" role="group">
|
||||
<span class="fas fa-chevron-down text-primary"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="collapsable-date-list-@kv.Key.Ticks">
|
||||
<div class="card-body px-1 py-1">
|
||||
<div class="form-group my-0">
|
||||
<div class="list-group">
|
||||
@foreach(var dts in kv.Value)
|
||||
{
|
||||
<div class="list-group-item my-auto">
|
||||
@using(Html.BeginForm("SelectIntervalForForm", "Scheduler", FormMethod.Post))
|
||||
{
|
||||
<div class="input-group">
|
||||
<p class="form-control border-0 bg-transparent">
|
||||
@dts.StartDate.ToString("HH:mm") - @dts.EndDate.ToString("HH:mm")
|
||||
</p>
|
||||
<div class="table-responsive overflow-auto" style="max-width: 1200px; max-height: 80vh;">
|
||||
<table class="table table-striped small table-bordered overflow-auto" style="width: fit-content; max-height: 80vh;">
|
||||
<thead>
|
||||
<th scope="col">Zeit</th>
|
||||
@foreach(var date in Model.FreeIntervalDays)
|
||||
{
|
||||
var dateStr = date.ToString("dd.MM.yy");
|
||||
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-primary" type="submit" onclick="showSpinner()">
|
||||
<span class="far fa-calendar-plus"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" value="@dts.StartDate.ToString("dd.MM.yyyy HH:mm")" name="startDate" />
|
||||
<input type="hidden" value="@dts.EndDate.ToString("dd.MM.yyyy HH:mm")" name="endDate" />
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<th scope="col" class="text-center">@dateStr</th>
|
||||
}
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach(var interval in Model.FreeIntervals)
|
||||
{
|
||||
var key = interval.Key;
|
||||
var header = $"{key.StartDate:HH:mm} - {key.EndDate:HH:mm}";
|
||||
|
||||
<tr>
|
||||
<th scope="row" class="align-middle m-0">@header</th>
|
||||
@foreach(var date2IsFree in interval.Value)
|
||||
{
|
||||
<td class="text-center">
|
||||
@if(date2IsFree.Value)
|
||||
{
|
||||
var btnTitle = $"{date2IsFree.Key:dd.MM.yyyy} {header}";
|
||||
|
||||
using(Html.BeginForm("SelectIntervalForForm", "Scheduler", FormMethod.Post))
|
||||
{
|
||||
<button class="btn btn-primary btn-sm" type="submit" data-toggle="tooltip" data-placement="top" title="@btnTitle" onclick="showSpinner()">
|
||||
<span class="far fa-calendar-plus"></span>
|
||||
</button>
|
||||
|
||||
<input type="hidden" value="@key.StartDate.ToString("dd.MM.yyyy HH:mm")" name="startDate" />
|
||||
<input type="hidden" value="@key.EndDate.ToString("dd.MM.yyyy HH:mm")" name="endDate" />
|
||||
}
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
else if(Model.IntervalStartDate.HasValue && Model.IntervalEndDate.HasValue)
|
||||
@@ -71,4 +66,3 @@ else if(Model.IntervalStartDate.HasValue && Model.IntervalEndDate.HasValue)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#scheduler-date-picker").datetimepicker({
|
||||
locale: "de",
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
<div class="container mt-3">
|
||||
<div class="row d-flex justify-content-center">
|
||||
<div class="col-auto justify-content-center mx-1 px-0">
|
||||
<div class="col-auto justify-content-center mx-1 px-0 ml-3">
|
||||
@using(Html.BeginForm("NavigateToPreviousDate", "Scheduler", FormMethod.Post))
|
||||
{
|
||||
<button type="submit" class="btn btn-primary" onclick="showSpinner()">
|
||||
@@ -262,12 +262,12 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="container-fluid" style="max-width: 1200px !important;">
|
||||
<div class="container-fluid lg-max-width">
|
||||
<hr />
|
||||
<div class="row">
|
||||
@{
|
||||
var editorCol = "col-md-6";
|
||||
var listCol = "col-md-6";
|
||||
var editorCol = "col-md-4";
|
||||
var listCol = "col-md-8";
|
||||
|
||||
if(Model?.SelectedSchedulerView == "5" || Model?.SelectedSchedulerView == "7")
|
||||
{
|
||||
@@ -275,8 +275,8 @@
|
||||
listCol = "col-md-12";
|
||||
}
|
||||
}
|
||||
<div class="col col-12 @editorCol" id="test-container">
|
||||
@if(Model.IsInIntervalFinderMode)
|
||||
<div class="col col-12 @editorCol mb-3" id="test-container">
|
||||
@if(Model != null && Model.IsInIntervalFinderMode)
|
||||
{
|
||||
<!-- Intervallfinder -->
|
||||
<div id="interval-finder-container">
|
||||
@@ -295,9 +295,9 @@
|
||||
</div>
|
||||
|
||||
<!-- Terminliste -->
|
||||
<div class="col col-12 @listCol mt-3">
|
||||
<!-- TODO: VORERST NICHT LÖSCHEN!-->
|
||||
@if(Model.IsInIntervalFinderMode)
|
||||
<div class="col col-12 @listCol">
|
||||
@* TODO: VORERST NICHT LÖSCHEN! *@
|
||||
@if(Model?.IsInIntervalFinderMode ?? false)
|
||||
{
|
||||
@Html.Partial("AppointmentIntervalFinderResultPartial", Model)
|
||||
}
|
||||
@@ -315,7 +315,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Filterauswahl: -->
|
||||
@if(AbstractModel.HasRightToViewAllResourceAppointments && Model.ResourceCategories2Resources.Any())
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
'of': 'von'
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
window.showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
if(bewoReportViewer === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bewoReportViewer.AdjustControl();
|
||||
});
|
||||
</script>
|
||||
@@ -31,12 +31,12 @@
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" style="height: 90vh !important;">
|
||||
<div class="modal-body" id="report-modal-body" style="height: 90vh;">
|
||||
@if(TempData[TempDataConstants.ReportErrorMessageKey] is string reportErrorMessage)
|
||||
{
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@(new HtmlString(reportErrorMessage))
|
||||
</div>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@(new HtmlString(reportErrorMessage))
|
||||
</div>
|
||||
}
|
||||
else if(Model?.Report != null)
|
||||
{
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
<script src="@Scripts.Url("~/Scripts/ownSoft-Scripts/utils/logging.js")" type="text/javascript"></script>
|
||||
<script src="@Scripts.Url("~/Scripts/ownSoft-Scripts/utils/MoKPasswordSecurity.js")" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/bs-custom-file-input.min.js")"></script>
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/ownSoft-Scripts/utils/dropdown-search.js")"></script>
|
||||
|
||||
<script type="text/javascript" src="@Scripts.Url("~/Scripts/devexpress-dependencies/devextreme/dx.all.js")"></script>
|
||||
|
||||
@@ -137,7 +138,7 @@
|
||||
}
|
||||
|
||||
function copyErrorToClipboard() {
|
||||
var element = document.querySelector("#fehlerdetail-textarea");
|
||||
const element = document.querySelector("#fehlerdetail-textarea");
|
||||
element.select();
|
||||
element.setSelectionRange(0, 99999);
|
||||
|
||||
@@ -271,7 +272,7 @@
|
||||
Large ≥992px
|
||||
Extra large ≥1200px
|
||||
*/
|
||||
var result = "xs";
|
||||
let result = "xs";
|
||||
|
||||
if(width < 567) {
|
||||
result = "xs";
|
||||
@@ -310,7 +311,7 @@
|
||||
var initialVonWidth = 0;
|
||||
function calcPrependWidth() {
|
||||
try {
|
||||
// Prepend-Elemente
|
||||
@* Prepend der Datetimepicker-Prepends, die kleiner sind als die anderen *@
|
||||
if(initialVonWidth === 0 && $.isNumeric(getMaxWidth("sm-prepend-input-group-text"))) {
|
||||
initialVonWidth = getMaxWidth("sm-prepend-input-group-text");
|
||||
}
|
||||
@@ -334,7 +335,7 @@
|
||||
|
||||
function getMaxWidth(elementClassName) {
|
||||
try {
|
||||
return Math.max.apply(Math, $(`.${elementClassName}`).map(function () { return $(this).width(); }).get());
|
||||
return Math.max.apply(Math, $(`.${elementClassName}`).map(function() { return $(this).width(); }).get());
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
|
||||
@@ -4873,7 +4873,7 @@ namespace BeWo.Data.Access
|
||||
|
||||
// Es werden im subset nach überschneidenden Terminen gesucht.
|
||||
//
|
||||
foreach (var dts in subset)
|
||||
foreach(var dts in subset)
|
||||
{
|
||||
var start = dts.StartDate.MergeDatesByDate(intervalStart);
|
||||
var end = dts.EndDate.MergeDatesByDate(intervalEnd);
|
||||
@@ -4900,13 +4900,13 @@ namespace BeWo.Data.Access
|
||||
|
||||
var freeIntervals = new List<DateTimeSpan>();
|
||||
|
||||
if (intervals.Count > 0)
|
||||
if(intervals.Count > 0)
|
||||
{
|
||||
if (result.Count > 0)
|
||||
if(result.Count > 0)
|
||||
{
|
||||
foreach (var interval in intervals)
|
||||
foreach(var interval in intervals)
|
||||
{
|
||||
if (!result.Any(a => a.StartDate.HasValue && a.EndDate.HasValue && a.StartDate.Value.IsInInterval(a.EndDate.Value, interval.StartDate, interval.EndDate)))
|
||||
if(!result.Any(a => a.StartDate.HasValue && a.EndDate.HasValue && a.StartDate.Value.IsInInterval(a.EndDate.Value, interval.StartDate, interval.EndDate)))
|
||||
{
|
||||
freeIntervals.Add(interval);
|
||||
}
|
||||
@@ -4921,11 +4921,70 @@ namespace BeWo.Data.Access
|
||||
return IntervalFinderHelper.CreateFreeIntervalsDictionary(freeIntervals);
|
||||
}
|
||||
|
||||
public Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> FindAppointmentsInRangeForIntervalFinder(int duration, DateTime intervalStart, DateTime intervalEnd, List<long> resourceOids, List<long> customerOids, List<long> employeeOids, long loggedInEmployeeOid, int intervalBuffer = 30, bool skipWeekends = true)
|
||||
{
|
||||
var result = new List<SchedulerAppointment>();
|
||||
|
||||
var intervals = IntervalFinderHelper.CreateIntervals(duration, intervalStart, intervalEnd, skipWeekends, intervalBuffer);
|
||||
|
||||
// Das subset enthält die zu prüfenden Tage im angegebenen Intervall.
|
||||
// 04.12.2023 15:00 bis 06.12.2023 12:00 wären 04.12.2023, 05.12.2023, 06.12.2023 im subset.
|
||||
var subset = IntervalFinderHelper.GenereateIntervalsForChecking(intervalStart, intervalEnd);
|
||||
|
||||
// Es werden im subset nach überschneidenden Terminen gesucht.
|
||||
foreach(var dts in subset)
|
||||
{
|
||||
var start = dts.StartDate.MergeDatesByDate(intervalStart);
|
||||
var end = dts.EndDate.MergeDatesByDate(intervalEnd);
|
||||
|
||||
var apptmts = LoadAppointmentsForIntervalFinder(start, end, resourceOids, customerOids, employeeOids, loggedInEmployeeOid, skipWeekends);
|
||||
|
||||
result.AddRangeIfElementsNotIn(apptmts);
|
||||
}
|
||||
|
||||
/*
|
||||
Normal = 0,
|
||||
Pattern = 1,
|
||||
Occurrence = 2,
|
||||
ChangedOccurrence = 3,
|
||||
DeletedOccurrence = 4
|
||||
*/
|
||||
|
||||
var changedOccurrences = result.Where(a => a.Type == 3).Select(s => BS.Shared.Core.Utils.GetOccurrenceId(s.RecurrenceInfo)).ToList();
|
||||
var deletedOccurrences = result.Where(a => a.Type == 4).Select(s => BS.Shared.Core.Utils.GetOccurrenceId(s.RecurrenceInfo)).ToList();
|
||||
|
||||
var kek = IntervalFinderHelper.GetRecurrencesForIntervalFinder(result, intervalStart, intervalEnd, changedOccurrences, deletedOccurrences, skipWeekends);
|
||||
|
||||
result.AddRange(kek);
|
||||
|
||||
var freeIntervals = new List<DateTimeSpan>();
|
||||
|
||||
if(intervals.Count > 0)
|
||||
{
|
||||
if(result.Count > 0)
|
||||
{
|
||||
foreach(var interval in intervals)
|
||||
{
|
||||
if(!result.Any(a => a.StartDate.HasValue && a.EndDate.HasValue && a.StartDate.Value.IsInInterval(a.EndDate.Value, interval.StartDate, interval.EndDate)))
|
||||
{
|
||||
freeIntervals.Add(interval);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return IntervalFinderHelper.CreateFreeIntervals(intervals, intervalStart, intervalEnd, intervalBuffer, duration);
|
||||
}
|
||||
}
|
||||
|
||||
return IntervalFinderHelper.CreateFreeIntervals(freeIntervals, intervalStart, intervalEnd, intervalBuffer, duration);
|
||||
}
|
||||
|
||||
private IEnumerable<SchedulerAppointment> LoadAppointmentsForIntervalFinder(DateTime intervalStart, DateTime intervalEnd, IReadOnlyCollection<long> resourceOids, IReadOnlyCollection<long> customerOids, List<long> employeeOids, long loggedInEmployeeOid, bool skipWeekends)
|
||||
{
|
||||
var result = new List<SchedulerAppointment>();
|
||||
|
||||
if (intervalStart < intervalEnd)
|
||||
if(intervalStart < intervalEnd)
|
||||
{
|
||||
var intervals = IntervalFinderHelper.GenerateIntervalsForCriteria(intervalStart, intervalEnd, skipWeekends);
|
||||
|
||||
@@ -4936,13 +4995,13 @@ namespace BeWo.Data.Access
|
||||
var criteria = CreateCriteriaIsActiveWithAlias<SchedulerAppointment>("sa")
|
||||
.Add(Restrictions.Not(Restrictions.Eq(nameof(SchedulerAppointment.IsTask), true)));
|
||||
|
||||
if (intervals.Count > 0)
|
||||
if(intervals.Count > 0)
|
||||
{
|
||||
if (intervals.Count > 1)
|
||||
if(intervals.Count > 1)
|
||||
{
|
||||
var criterionList = new List<ICriterion>();
|
||||
|
||||
foreach (var dts in intervals)
|
||||
foreach(var dts in intervals)
|
||||
{
|
||||
criterionList.AddIfNotIn(
|
||||
Restrictions.Or(
|
||||
@@ -4961,7 +5020,7 @@ namespace BeWo.Data.Access
|
||||
{
|
||||
var dts = intervals.FirstOrDefault();
|
||||
|
||||
if (dts != null)
|
||||
if(dts != null)
|
||||
{
|
||||
var cri = Restrictions.Or(
|
||||
Restrictions.Between(nameof(SchedulerAppointment.StartDate), dts.StartDate, dts.EndDate),
|
||||
@@ -4980,7 +5039,7 @@ namespace BeWo.Data.Access
|
||||
ICriterion resourceCriterion = null;
|
||||
ICriterion customerCriterion = null;
|
||||
|
||||
if (employeeOids.Count == 0)
|
||||
if(employeeOids.Count == 0)
|
||||
{
|
||||
employeeOids.Add(loggedInEmployeeOid);
|
||||
}
|
||||
@@ -5002,13 +5061,13 @@ namespace BeWo.Data.Access
|
||||
|
||||
var employeeCriterion = Restrictions.Or(employee2SchedCrit, and);
|
||||
|
||||
if (customerOids?.Count > 0)
|
||||
if(customerOids?.Count > 0)
|
||||
{
|
||||
var customerSql = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM customer2newschapp WHERE customeroid IN ({customerOids.ToSeparatedString(",")}))";
|
||||
customerCriterion = Expression.Sql(customerSql);
|
||||
}
|
||||
|
||||
if (resourceOids?.Count > 0)
|
||||
if(resourceOids?.Count > 0)
|
||||
{
|
||||
var resourceSql = $"{BeWoEntityBase.PropertyName_Oid} IN (SELECT newschappoid FROM resource2newschapp WHERE resourceoid IN ({resourceOids.ToSeparatedString(",")}))";
|
||||
resourceCriterion = Expression.Sql(resourceSql);
|
||||
@@ -5021,11 +5080,11 @@ namespace BeWo.Data.Access
|
||||
resourceCriterion
|
||||
};
|
||||
|
||||
if (listOfCriterias.Count > 0)
|
||||
if(listOfCriterias.Count > 0)
|
||||
{
|
||||
var orCriteria = CreateOrCriteria(listOfCriterias);
|
||||
|
||||
if (orCriteria != null)
|
||||
if(orCriteria != null)
|
||||
{
|
||||
criteria.Add(orCriteria);
|
||||
}
|
||||
@@ -5780,7 +5839,7 @@ namespace BeWo.Data.Access
|
||||
var criteria = CreateCriteriaIsActive<ServiceRecord>();
|
||||
var rowCountCirteria = CreateCriteriaIsActive<ServiceRecord>();
|
||||
|
||||
if (costBearer2SupportConceptOid.HasValue)
|
||||
if(costBearer2SupportConceptOid.HasValue)
|
||||
{
|
||||
var groupOidsQuery = Session.CreateSQLQuery($"SELECT MIN(Oid) FROM servicerecord WHERE CostBearer2SupportConceptOid = {costBearer2SupportConceptOid} GROUP BY GroupOid");
|
||||
var groupOids = groupOidsQuery.List<long>().ToArray();
|
||||
@@ -5800,7 +5859,7 @@ namespace BeWo.Data.Access
|
||||
.Add(Restrictions.IsNull(ServiceRecord.PropertyName_CostBearer2SupportConceptOid));
|
||||
}
|
||||
|
||||
if (dayCount > 0)
|
||||
if(dayCount > 0)
|
||||
{
|
||||
criteria.Add(Restrictions.Ge(ServiceRecord.PropertyName_Start, minStart));
|
||||
rowCountCirteria.Add(Restrictions.Ge(ServiceRecord.PropertyName_Start, minStart));
|
||||
@@ -5987,5 +6046,118 @@ namespace BeWo.Data.Access
|
||||
|
||||
return criteria.List<SupportConcept>().ToList();
|
||||
}
|
||||
|
||||
public virtual IList<Customer> FindCustomersOfTeams(IEnumerable<long> teamOids)
|
||||
{
|
||||
return CreateCriteriaIsActiveOrArchived<Customer>()
|
||||
.CreateCriteria(nameof(Customer.Team2CustomerList), JoinType.InnerJoin)
|
||||
.Add(Restrictions.In(nameof(Team2Customer.TeamOid), teamOids.ToArray()))
|
||||
.List<Customer>();
|
||||
}
|
||||
|
||||
public List<Customer> FindCustomersForPaginatedQb(int firstResult, int maxResults, bool checkTeamCustomerRights, DateTime start, DateTime end, out int rowCount)
|
||||
{
|
||||
var user = LoggedInUserOperationContextExt.Current?.User ?? SessionFacade.LoggedInUser;
|
||||
|
||||
var rights = new List<UserRightType>();
|
||||
foreach(var userGroup in user.UserGroups)
|
||||
{
|
||||
rights.AddRangeIfElementsNotIn(userGroup.Rights.Select(rightRelation => rightRelation.RightType));
|
||||
}
|
||||
|
||||
var hasRightCustomerViewView = rights.Contains(UserRightType.CustomerView_View);
|
||||
var hasRightCustomerViewMyTeams = rights.Contains(UserRightType.Customer_ViewMyTeams);
|
||||
|
||||
List<Customer> customers = null;
|
||||
rowCount = 0;
|
||||
|
||||
if(!hasRightCustomerViewView)
|
||||
{
|
||||
customers = new List<Customer>();
|
||||
|
||||
ICriteria criteria;
|
||||
if(checkTeamCustomerRights && hasRightCustomerViewMyTeams)
|
||||
{
|
||||
criteria = CreateCriteriaIsActiveOrArchived<Customer>()
|
||||
.CreateCriteria(nameof(Customer.Team2CustomerList), JoinType.InnerJoin)
|
||||
.Add(Restrictions.In(nameof(Team2Customer.TeamOid), user.Employee.LeadingTeams.Select(team => team.Oid.Value).ToArray()));
|
||||
|
||||
rowCount = GetRowCountForQuittierungsbelegPagination(criteria.List<Customer>().Select(c => c.Oid.Value).Distinct().ToArray(), start, end);
|
||||
|
||||
var teamCustomers = criteria
|
||||
.CreateAlias(nameof(Customer.Person), "p", JoinType.InnerJoin)
|
||||
.AddOrder(Order.Asc($"p.{nameof(Person.LastName)}"))
|
||||
.SetFirstResult(firstResult)
|
||||
.SetMaxResults(maxResults)
|
||||
.Future<Customer>()
|
||||
.ToList();
|
||||
|
||||
customers.AddRangeIfElementsNotIn(teamCustomers);
|
||||
}
|
||||
else
|
||||
{
|
||||
var allOwnCustomerOids = user.Employee.Employee2CustomerList.Select(e2C => e2C.Customer.Oid.Value).ToList();
|
||||
|
||||
criteria = CreateCriteria<Customer>()
|
||||
.Add(Restrictions.In(nameof(BeWoEntityBase.Oid), allOwnCustomerOids));
|
||||
|
||||
rowCount = GetRowCountForQuittierungsbelegPagination(criteria.List<Customer>().Select(customer => customer.Oid.Value).Distinct().ToArray(), start, end);
|
||||
|
||||
var paginatedOwnCustomers = criteria
|
||||
.CreateAlias(nameof(Customer.Person), "p", JoinType.InnerJoin)
|
||||
.AddOrder(Order.Asc($"p.{nameof(Person.LastName)}"))
|
||||
.SetFirstResult(firstResult)
|
||||
.SetMaxResults(maxResults)
|
||||
.Future<Customer>()
|
||||
.ToList();
|
||||
|
||||
customers.AddRangeIfElementsNotIn(paginatedOwnCustomers);
|
||||
}
|
||||
}
|
||||
|
||||
if(customers != null)
|
||||
{
|
||||
return customers;
|
||||
}
|
||||
|
||||
var customerOids = CreateCriteriaIsActive<Customer>().List<Customer>().Select(customer => customer.Oid.Value).Distinct().ToArray();
|
||||
|
||||
rowCount = GetRowCountForQuittierungsbelegPagination(customerOids, start, end);
|
||||
|
||||
customers = CreateCriteriaIsActive<Customer>()
|
||||
.CreateAlias(nameof(Customer.Person), "p", JoinType.InnerJoin)
|
||||
.AddOrder(Order.Asc($"p.{nameof(Person.LastName)}"))
|
||||
.SetFirstResult(firstResult)
|
||||
.SetMaxResults(maxResults)
|
||||
.Future<Customer>()
|
||||
.ToList();
|
||||
|
||||
return customers;
|
||||
}
|
||||
|
||||
public List<Customer> FindCustomersForPaginatedQbByOids(int firstResult, int maxResults, long[] customerOids, DateTime start, DateTime end, out int rowCount)
|
||||
{
|
||||
rowCount = GetRowCountForQuittierungsbelegPagination(customerOids, start, end);
|
||||
|
||||
return CreateCriteriaIsActive<Customer>()
|
||||
.Add(Restrictions.In(nameof(BeWoEntityBase.Oid), customerOids))
|
||||
.CreateAlias(nameof(Customer.Person), "p", JoinType.InnerJoin)
|
||||
.AddOrder(Order.Asc($"p.{nameof(Person.LastName)}"))
|
||||
.SetFirstResult(firstResult)
|
||||
.SetMaxResults(maxResults)
|
||||
.Future<Customer>()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
private int GetRowCountForQuittierungsbelegPagination(long[] customerOids, DateTime start, DateTime end)
|
||||
{
|
||||
var customerCountWithQuittierungsbelegInSpan = CreateCriteriaIsActive<Customer>()
|
||||
.Add(Restrictions.In(nameof(BeWoEntityBase.Oid), customerOids))
|
||||
.CreateAlias(nameof(Customer.ServiceRecordList), "sr", JoinType.InnerJoin)
|
||||
.Add(Restrictions.Between($"sr.{nameof(ServiceRecord.Start)}", start, end))
|
||||
.SetProjection(Projections.CountDistinct(nameof(BeWoEntityBase.Oid))).FutureValue<int>().Value;
|
||||
|
||||
return customerCountWithQuittierungsbelegInSpan;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,6 @@ namespace BeWo.Data.Entities
|
||||
{
|
||||
public class Signature : BeWoEntityBase
|
||||
{
|
||||
|
||||
public static string PropertyName_Latitute = "Latitute";
|
||||
|
||||
public static string PropertyName_Longitute = "Longitute";
|
||||
|
||||
public static string PropertyName_Zeitstempel = "Zeitstempel";
|
||||
|
||||
private string _DataBild;
|
||||
|
||||
private DateTime _Zeitstempel;
|
||||
@@ -24,85 +17,72 @@ namespace BeWo.Data.Entities
|
||||
|
||||
private long? _BargeldtransaktionsOid;
|
||||
|
||||
public Signature()
|
||||
{
|
||||
_Tid = TableID.SignatureTable;
|
||||
}
|
||||
|
||||
public virtual string DataBild
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._DataBild;
|
||||
}
|
||||
get => _DataBild;
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._DataBild, value))
|
||||
if(AreDifferent(_DataBild, value))
|
||||
{
|
||||
this._DataBild = value;
|
||||
_DataBild = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual DateTime Zeitstempel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Zeitstempel;
|
||||
}
|
||||
get => _Zeitstempel;
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Zeitstempel, value))
|
||||
if(AreDifferent(_Zeitstempel, value))
|
||||
{
|
||||
this._Zeitstempel = value;
|
||||
_Zeitstempel = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public virtual string Latitute
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Latitute;
|
||||
}
|
||||
get => _Latitute;
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Latitute, value))
|
||||
if(AreDifferent(_Latitute, value))
|
||||
{
|
||||
this._Latitute = value;
|
||||
_Latitute = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string Longitute
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._Longitute;
|
||||
}
|
||||
get => _Longitute;
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Longitute, value))
|
||||
if(AreDifferent(_Longitute, value))
|
||||
{
|
||||
this._Longitute = value;
|
||||
_Longitute = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual long? ServiceRecordOid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._ServiceRecordOid;
|
||||
}
|
||||
get => _ServiceRecordOid;
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._ServiceRecordOid, value))
|
||||
if(AreDifferent(_ServiceRecordOid, value))
|
||||
{
|
||||
this._ServiceRecordOid = value;
|
||||
_ServiceRecordOid = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
<id name="Oid" column ="Oid" unsaved-value="null">
|
||||
<generator class="identity" />
|
||||
</id>
|
||||
<version type="Int64" column="Version" name="Version" />
|
||||
<property name="ServiceRecordOid" column="ServiceRecordOid" />
|
||||
<property name="InsTs" />
|
||||
<property name="InsUser" />
|
||||
<property column="Tid" type="BS.Shared.TableID, BS.Shared" name="_Tid" access="field" />
|
||||
<property name="UdpUser" />
|
||||
<version type="Int64" name="Version" />
|
||||
<property name="ServiceRecordOid" type="Int64" />
|
||||
<property name="InsTs" type="DateTime" />
|
||||
<property name="InsUser" type="String" />
|
||||
<property name="_Tid" type="BS.Shared.TableID, BS.Shared" column="Tid" access="field" />
|
||||
<property name="UdpUser" type="String" />
|
||||
<property name="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" />
|
||||
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
|
||||
<property name="Notice" />
|
||||
<property name="Latitute" column="Latitute" />
|
||||
<property name="Longitute" column="Longitute" />
|
||||
<property name="Zeitstempel" column="Zeitstempel" />
|
||||
<property name="DataBild" column="DataBild" />
|
||||
<property name="BargeldtransaktionsOid" />
|
||||
<property name="Notice" type="String" />
|
||||
<property name="Latitute" type="String" />
|
||||
<property name="Longitute" type="String" />
|
||||
<property name="Zeitstempel" type="DateTime" />
|
||||
<property name="DataBild" type="String" />
|
||||
<property name="BargeldtransaktionsOid" type="Int64" />
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
|
||||
using BeWo.Data.Entities;
|
||||
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
using NHibernate;
|
||||
|
||||
@@ -25,14 +25,19 @@ namespace BeWo.Data.Utils
|
||||
var start = intervalStart;
|
||||
var end = start.MergeDatesByDate(intervalEnd);
|
||||
|
||||
while (end <= intervalEnd)
|
||||
while(end <= intervalEnd)
|
||||
{
|
||||
end = start.MergeDatesByDate(intervalEnd);
|
||||
end = start.Date.Equals(intervalEnd.Date) ? start.MergeDatesByDate(intervalEnd) : new DateTime(start.Year, start.Month, start.Day, 23, 59, 59);
|
||||
|
||||
if (skipWeekends && (start.Date.DayOfWeek == DayOfWeek.Saturday || start.Date.DayOfWeek == DayOfWeek.Sunday))
|
||||
if(!start.Date.Equals(intervalStart.Date))
|
||||
{
|
||||
start = new DateTime(start.Year, start.Month, start.Day);
|
||||
}
|
||||
|
||||
if(skipWeekends && (start.Date.DayOfWeek == DayOfWeek.Saturday || start.Date.DayOfWeek == DayOfWeek.Sunday))
|
||||
{
|
||||
start = start.AddDays(1);
|
||||
end = start.MergeDatesByDate(intervalEnd);
|
||||
end = start.Date.Equals(intervalEnd.Date) ? start.MergeDatesByDate(intervalEnd) : new DateTime(start.Year, start.Month, start.Day, 23, 59, 59);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -115,7 +120,7 @@ namespace BeWo.Data.Utils
|
||||
|
||||
var unsortedDictionary = new Dictionary<DateTime, List<DateTimeSpan>>();
|
||||
|
||||
foreach (var grouping in groupedIntervals)
|
||||
foreach(var grouping in groupedIntervals)
|
||||
{
|
||||
var orderedList = grouping.OrderBy(dateTimeSpan => dateTimeSpan.StartDate).ToList();
|
||||
|
||||
@@ -124,7 +129,7 @@ namespace BeWo.Data.Utils
|
||||
|
||||
var keys = unsortedDictionary.Keys.OrderBy(key => key.Date).ToList();
|
||||
|
||||
foreach (var key in keys)
|
||||
foreach(var key in keys)
|
||||
{
|
||||
result.Add(key, unsortedDictionary[key]);
|
||||
}
|
||||
@@ -136,31 +141,28 @@ namespace BeWo.Data.Utils
|
||||
{
|
||||
var result = new List<DateTimeSpan>();
|
||||
|
||||
if (duration > 0 && intervalStart < intervalEnd && intervalBuffer > 10)
|
||||
if(duration > 0 && intervalStart < intervalEnd && intervalBuffer > 10)
|
||||
{
|
||||
var timeSpan = intervalEnd - intervalStart;
|
||||
|
||||
var totalDays = Convert.ToInt32(Math.Ceiling(timeSpan.TotalDays));
|
||||
|
||||
for (var i = 0; i < totalDays; i++)
|
||||
for(var i = 0; i < totalDays; i++)
|
||||
{
|
||||
var start = intervalStart.AddDays(i).MergeDatesByDate(intervalStart);
|
||||
|
||||
if (skipWeekends && (start.DayOfWeek == DayOfWeek.Saturday || start.DayOfWeek == DayOfWeek.Sunday))
|
||||
if(skipWeekends && (start.DayOfWeek == DayOfWeek.Saturday || start.DayOfWeek == DayOfWeek.Sunday))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
DateTime e;
|
||||
// Beim Intervall (z.B. 04.12.2023 15:00 und 06.12.2023 12:00) wird nur zwischen Start- und Enduhrzeit geprüft.
|
||||
// Startdatum+Enduhrzeit
|
||||
// -> end = 04.12.2023 12:00
|
||||
//var end = start.MergeDatesByDate(intervalEnd);
|
||||
|
||||
var end = intervalEnd;
|
||||
|
||||
while ((e = start.AddMinutes(duration)) <= end && start <= end.AddMinutes(-1 * duration))
|
||||
while((e = start.AddMinutes(duration)) <= end && start <= end.AddMinutes(-1 * duration))
|
||||
{
|
||||
result.Add(new DateTimeSpan(start, e));
|
||||
result.Add(new DateTimeSpan(start, e, true));
|
||||
|
||||
start = start.AddMinutes(intervalBuffer);
|
||||
}
|
||||
@@ -202,7 +204,7 @@ namespace BeWo.Data.Utils
|
||||
var s = start;
|
||||
DateTime e;
|
||||
|
||||
for (var i = 0; i < limit; i++)
|
||||
for(var i = 0; i < limit; i++)
|
||||
{
|
||||
e = s.AddDays(5);
|
||||
|
||||
@@ -211,7 +213,7 @@ namespace BeWo.Data.Utils
|
||||
s = e.AddDays(1);
|
||||
}
|
||||
|
||||
if (rest > 0)
|
||||
if(rest > 0)
|
||||
{
|
||||
e = s.AddDays(rest);
|
||||
|
||||
@@ -304,28 +306,133 @@ namespace BeWo.Data.Utils
|
||||
|
||||
var dayCount = Convert.ToInt32(Math.Ceiling((endDate - startDate).TotalDays));
|
||||
|
||||
if (dayCount <= 0)
|
||||
if(dayCount <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
for (var i = 0; i < dayCount; i++)
|
||||
{
|
||||
var start = startDate.AddDays(i);
|
||||
var startTimeBeforeEndTime = startDate >= startDate.MergeDatesByDate(endDate);
|
||||
|
||||
if (skipWeekends && (start.DayOfWeek == DayOfWeek.Saturday || start.DayOfWeek == DayOfWeek.Sunday))
|
||||
if(startTimeBeforeEndTime || startDate.Date == endDate.Date)
|
||||
{
|
||||
return CalculateRecurrences(appointments, startDate, endDate, changedOccurrences, deletedOccurrences);
|
||||
}
|
||||
|
||||
var start = startDate;
|
||||
|
||||
for(var i = 0; i < dayCount; i++)
|
||||
{
|
||||
if(skipWeekends && (start.DayOfWeek == DayOfWeek.Saturday || start.DayOfWeek == DayOfWeek.Sunday))
|
||||
{
|
||||
start = start.AddDays(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
var end = start.MergeDatesByDate(endDate);
|
||||
var end = i == dayCount - 1
|
||||
? start.MergeDatesByDate(endDate)
|
||||
: start.AddDays(1).MergeDatesByDate(start.Date);
|
||||
|
||||
start = i == 0
|
||||
? start
|
||||
: start.MergeDatesByDate(start.Date);
|
||||
|
||||
var calculatedRecurrences = CalculateRecurrences(appointments, start, end, changedOccurrences, deletedOccurrences);
|
||||
|
||||
result.AddRange(calculatedRecurrences);
|
||||
|
||||
start = start.AddDays(1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> CreateFreeIntervals(List<DateTimeSpan> freeIntervals, DateTime intervalStart, DateTime intervalEnd, int buffer, int durationInMinutes)
|
||||
{
|
||||
var result = new Dictionary<DateTimeSpan, Dictionary<DateTime, bool>>();
|
||||
|
||||
if(intervalEnd < intervalStart)
|
||||
{
|
||||
(intervalEnd, intervalStart) = (intervalStart, intervalEnd);
|
||||
}
|
||||
|
||||
if(durationInMinutes <= 0)
|
||||
{
|
||||
durationInMinutes = 60;
|
||||
}
|
||||
|
||||
if(buffer < 30)
|
||||
{
|
||||
buffer = 30;
|
||||
}
|
||||
|
||||
var possibleIntervals = CalculatePossibleIntervals(intervalStart, intervalEnd, buffer, durationInMinutes);
|
||||
|
||||
var days = freeIntervals.Select(dateTimeSpan => dateTimeSpan.StartDate.Date).Distinct().ToList();
|
||||
|
||||
foreach(var possibleInterval in possibleIntervals)
|
||||
{
|
||||
foreach(var day in days)
|
||||
{
|
||||
var hasFreeSlot = freeIntervals.Any(freeInterval =>
|
||||
{
|
||||
var isTimeEqual = freeInterval.EqualTimes(possibleInterval);
|
||||
var isDayEqual = freeInterval.StartDate.Date.Equals(day);
|
||||
|
||||
return isTimeEqual && isDayEqual;
|
||||
});
|
||||
|
||||
if(result.Keys.Any(key => key.EqualTimes(possibleInterval)))
|
||||
{
|
||||
result[possibleInterval].AddAndIgnoreDuplicates(day, hasFreeSlot);
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Add(possibleInterval, new Dictionary<DateTime, bool> { { day, hasFreeSlot } });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static List<DateTimeSpan> CalculatePossibleIntervals(DateTime intervalStart, DateTime intervalEnd, int buffer, int durationInMinutes)
|
||||
{
|
||||
var possibleIntervals = new List<DateTimeSpan>();
|
||||
|
||||
if(intervalEnd < intervalStart)
|
||||
{
|
||||
(intervalEnd, intervalStart) = (intervalStart, intervalEnd);
|
||||
}
|
||||
|
||||
if(durationInMinutes <= 0)
|
||||
{
|
||||
durationInMinutes = 60;
|
||||
}
|
||||
|
||||
if(buffer < 30)
|
||||
{
|
||||
buffer = 30;
|
||||
}
|
||||
|
||||
var start = intervalStart;
|
||||
var end = intervalStart.AddMinutes(durationInMinutes);
|
||||
|
||||
while(end < intervalEnd)
|
||||
{
|
||||
if(possibleIntervals.Any(timeSpan => timeSpan.StartDate.CompareTime(start)))
|
||||
{
|
||||
start = start.AddMinutes(buffer);
|
||||
end = start.AddMinutes(durationInMinutes);
|
||||
continue;
|
||||
}
|
||||
|
||||
possibleIntervals.Add(new DateTimeSpan(start, end, true));
|
||||
|
||||
start = start.AddMinutes(buffer);
|
||||
end = start.AddMinutes(durationInMinutes);
|
||||
}
|
||||
|
||||
return possibleIntervals.OrderBy(dateTimeSpan => dateTimeSpan.StartDate.Hour).ThenBy(dateTimeSpan => dateTimeSpan.StartDate.Minute).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE `servicerecord` ADD FOREIGN KEY (SignatureOID) REFERENCES signature(Oid);
|
||||
@@ -183,135 +183,85 @@ namespace BeWo.Report.ReportObjects
|
||||
|
||||
// private CostBearer2SupportConceptData CostBearer2SupportConceptData { get; set; }
|
||||
|
||||
public static List<ServicesOverviewRO> CreateAlt(int pMonth, int pYear, long orgaOid, long empOid, int startDay,
|
||||
int endDay, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true)
|
||||
public static List<ServicesOverviewRO> CreateAlt(int pMonth, int pYear, long orgaOid, long empOid, int startDay, int endDay, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true)
|
||||
{
|
||||
return Create(pMonth, pYear, orgaOid, empOid, startDay, endDay, false, serviceCategoryOid,
|
||||
disableEmptySupportConcepts);
|
||||
return Create(pMonth, pYear, orgaOid, empOid, startDay, endDay, false, serviceCategoryOid, disableEmptySupportConcepts);
|
||||
}
|
||||
|
||||
public static List<ServicesOverviewRO> Create(int pMonth, int pYear, long orgaOid, long empOid, int startDay,
|
||||
int endDay, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true, bool checkQbStatus = false)
|
||||
public static List<ServicesOverviewRO> Create(int pMonth, int pYear, long orgaOid, long empOid, int startDay, int endDay, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true, bool checkQbStatus = false)
|
||||
{
|
||||
return Create(pMonth, pYear, orgaOid, empOid, startDay, endDay, false, serviceCategoryOid,
|
||||
disableEmptySupportConcepts, false, checkQbStatus);
|
||||
return Create(pMonth, pYear, orgaOid, empOid, startDay, endDay, false, serviceCategoryOid, disableEmptySupportConcepts, false, checkQbStatus);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<ServicesOverviewRO> Create(int pMonth, int pYear, long orgaOid, long empOid, int startDay, int endDay, bool searchServiceRecordsByEndDate, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true, bool checkTeamCustomerRights = false, bool checkQbStatus = false)
|
||||
{
|
||||
var roList = new List<ServicesOverviewRO>();
|
||||
|
||||
List<Customer> customers = null;
|
||||
|
||||
ApplicationUser loggedInUser = null;
|
||||
|
||||
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
|
||||
var loggedInUser = LoggedInUserOperationContextExt.Current?.User ?? SessionFacade.LoggedInUser;
|
||||
|
||||
if(loggedInUser?.Employee != null)
|
||||
{
|
||||
loggedInUser = LoggedInUserOperationContextExt.Current.User;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
loggedInUser = SessionFacade.LoggedInUser;
|
||||
}
|
||||
|
||||
if (loggedInUser != null && loggedInUser.Employee != null)
|
||||
{
|
||||
|
||||
if (!HasRight(loggedInUser, UserRightType.CustomerView_View))
|
||||
if(!HasRight(loggedInUser, UserRightType.CustomerView_View))
|
||||
{
|
||||
customers = new List<Customer>();
|
||||
Dictionary<long, bool> customerOidDict = new Dictionary<long, bool>();
|
||||
|
||||
if (checkTeamCustomerRights && HasRight(loggedInUser, UserRightType.Customer_ViewMyTeams))
|
||||
if(checkTeamCustomerRights && HasRight(loggedInUser, UserRightType.Customer_ViewMyTeams))
|
||||
{
|
||||
// var teams = DAOFactory.SearchDAO.FindTeamsOfEmployee(loggedInUser.Employee.Oid.Value);
|
||||
|
||||
//foreach (var t in teams)
|
||||
//{
|
||||
// var teamCustomers = DAOFactory.SearchDAO.FindCustomerOfTeam(t.Oid.Value);
|
||||
// foreach (var c in teamCustomers)
|
||||
// {
|
||||
// if (!customerOidDict.ContainsKey(c.Oid.Value))
|
||||
// {
|
||||
// customers.Add(c);
|
||||
// customerOidDict.Add(c.Oid.Value, true);
|
||||
// }
|
||||
// }
|
||||
|
||||
//}
|
||||
foreach (var t in loggedInUser.Employee.LeadingTeams)
|
||||
{
|
||||
var teamCustomers = DAOFactory.SearchDAO.FindCustomerOfTeam(t.Oid.Value);
|
||||
foreach (var c in teamCustomers)
|
||||
{
|
||||
if (!customerOidDict.ContainsKey(c.Oid.Value))
|
||||
{
|
||||
customers.Add(c);
|
||||
customerOidDict.Add(c.Oid.Value, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
var teamCustomers = DAOFactory.SearchDAO.FindCustomersOfTeams(loggedInUser.Employee.LeadingTeams.Select(team => team.Oid.Value));
|
||||
customers.AddRangeIfElementsNotIn(teamCustomers);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var e2c in loggedInUser.Employee.Employee2CustomerList)
|
||||
foreach (var employee2Customer in loggedInUser.Employee.Employee2CustomerList)
|
||||
{
|
||||
customers.Add(e2c.Customer);
|
||||
customers.Add(employee2Customer.Customer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (customers == null)
|
||||
if(customers is null)
|
||||
{
|
||||
customers = DAOFactory.GenericDAO.GetAllActive<Customer>().OrderBy(ob => ob.Person.LastName + ", " + ob.Person.FirstName).ToList();
|
||||
}
|
||||
|
||||
|
||||
if (startDay > endDay)
|
||||
if(startDay > endDay)
|
||||
{
|
||||
int temp = startDay;
|
||||
startDay = endDay;
|
||||
endDay = temp;
|
||||
(startDay, endDay) = (endDay, startDay);
|
||||
}
|
||||
var pSpan = new DateTimeSpan();
|
||||
pSpan.StartDateTime = new DateTime(pYear, pMonth, startDay);
|
||||
|
||||
var pSpan = new DateTimeSpan
|
||||
{
|
||||
StartDateTime = new DateTime(pYear, pMonth, startDay)
|
||||
};
|
||||
|
||||
pSpan.EndDateTime = pSpan.StartDateTime.AddDays(endDay - startDay + 1).AddTicks(-1);
|
||||
|
||||
// IList<Customer> customers = DAOFactory.SearchDAO.GetAllCustomerWithServiceRecordsInSpan(pSpan).OrderBy(ob => ob.Person.LastName + ", " + ob.Person.FirstName).ToList();
|
||||
foreach (Customer customer in customers)
|
||||
foreach(var customer in customers)
|
||||
{
|
||||
ServicesOverviewRO ro = Create(customer, pSpan, disableEmptySupportConcepts, orgaOid, empOid, searchServiceRecordsByEndDate, serviceCategoryOid, checkQbStatus);
|
||||
if (ro != null)
|
||||
var servicesOverviewRO = Create(customer, pSpan, disableEmptySupportConcepts, orgaOid, empOid, searchServiceRecordsByEndDate, serviceCategoryOid, checkQbStatus);
|
||||
if (servicesOverviewRO != null)
|
||||
{
|
||||
roList.Add(ro);
|
||||
roList.Add(servicesOverviewRO);
|
||||
}
|
||||
}
|
||||
|
||||
QBSortOrderEnum sortOrder = QBSortOrderEnum.NachKlient;
|
||||
var sortOrder = QBSortOrderEnum.NachKlient;
|
||||
|
||||
if (HttpContext.Current != null)
|
||||
if(HttpContext.Current != null)
|
||||
{
|
||||
var so = HttpContext.Current.Request.Params["sortorder"];
|
||||
if (!String.IsNullOrWhiteSpace(so))
|
||||
if (!string.IsNullOrWhiteSpace(so))
|
||||
{
|
||||
sortOrder = (QBSortOrderEnum)(Int32.Parse(so));
|
||||
sortOrder = (QBSortOrderEnum) int.Parse(so);
|
||||
}
|
||||
}
|
||||
if (sortOrder == QBSortOrderEnum.NachHauptbetreuung)
|
||||
{
|
||||
return roList.OrderBy(r => r.MainAttendant).ToList();
|
||||
}
|
||||
//else if (sortOrder == QBSortOrderEnum.NachTeam)
|
||||
//{
|
||||
// return roList.OrderBy(r => r.em).ToList();
|
||||
//}
|
||||
return roList;
|
||||
// return DAOFactory.SearchDAO.FindSupportConceptsInSpan(pSpan).OrderBy(ob => ob.Customer.Person.LastName + ", " + ob.Customer.Person.FirstName).Select(
|
||||
// sc => Create(sc.Customer.Oid.Value, pMonth, pYear, true)).ToList();
|
||||
|
||||
return sortOrder == QBSortOrderEnum.NachHauptbetreuung ? roList.OrderBy(r => r.MainAttendant).ToList() : roList;
|
||||
}
|
||||
|
||||
|
||||
@@ -363,6 +313,77 @@ namespace BeWo.Report.ReportObjects
|
||||
return Create(lCustomer, pSpan, disableEmptySupportConcepts, orgaOid, empOid, searchServiceRecordsByEndDate, serviceCategoryOid, checkQbStatus);
|
||||
}
|
||||
|
||||
public static List<ServicesOverviewRO> CreatePaginated(int firstResult, int maxResults, long[] customerOids, int month, int year, bool disableEmptySupportConcepts, long organizationOid, long employeeOid, int start, int end, out int rowCount, long? serviceCategoryOid = null, bool checkQbStatus = false)
|
||||
{
|
||||
var reportObjects = new List<ServicesOverviewRO>();
|
||||
|
||||
var dateTimeSpan = new DateTimeSpan();
|
||||
if(start > end)
|
||||
{
|
||||
(start, end) = (end, start);
|
||||
}
|
||||
|
||||
dateTimeSpan.StartDateTime = new DateTime(year, month, start);
|
||||
dateTimeSpan.EndDateTime = new DateTime(year, month, end);
|
||||
|
||||
var customers = DAOFactory.SearchDAO.FindCustomersForPaginatedQbByOids(firstResult, maxResults, customerOids, dateTimeSpan.StartDate, dateTimeSpan.EndDate, out rowCount);
|
||||
|
||||
foreach(var customer in customers)
|
||||
{
|
||||
var servicesOverviewRO = Create(customer, dateTimeSpan, disableEmptySupportConcepts, organizationOid, employeeOid, false, serviceCategoryOid, checkQbStatus);
|
||||
|
||||
if(servicesOverviewRO is null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
reportObjects.Add(servicesOverviewRO);
|
||||
}
|
||||
|
||||
return reportObjects;
|
||||
}
|
||||
|
||||
public static List<ServicesOverviewRO> CreatePaginated(int firstResult, int maxCount, int month, int year, long organizationOid, long employeeOid, int startDay, int endDay, out int rowCount, long? serviceCategoryOid = null, bool disableEmptySupportConcepts = true, bool checkQbStatus = false)
|
||||
{
|
||||
var reportObjects = new List<ServicesOverviewRO>();
|
||||
|
||||
if(startDay > endDay)
|
||||
{
|
||||
(startDay, endDay) = (endDay, startDay);
|
||||
}
|
||||
|
||||
var dateTimeSpan = new DateTimeSpan
|
||||
{
|
||||
StartDateTime = new DateTime(year, month, startDay)
|
||||
};
|
||||
|
||||
dateTimeSpan.EndDateTime = dateTimeSpan.StartDateTime.AddDays(endDay - startDay + 1).AddTicks(-1);
|
||||
|
||||
var customers = DAOFactory.SearchDAO.FindCustomersForPaginatedQb(firstResult, maxCount, false, dateTimeSpan.StartDate, dateTimeSpan.EndDate, out rowCount);
|
||||
|
||||
foreach(var customer in customers)
|
||||
{
|
||||
var servicesOverviewRO = Create(customer, dateTimeSpan, disableEmptySupportConcepts, organizationOid, employeeOid, false, serviceCategoryOid, checkQbStatus);
|
||||
if(servicesOverviewRO != null)
|
||||
{
|
||||
reportObjects.Add(servicesOverviewRO);
|
||||
}
|
||||
}
|
||||
|
||||
var sortOrder = QBSortOrderEnum.NachKlient;
|
||||
|
||||
if(HttpContext.Current != null)
|
||||
{
|
||||
var so = HttpContext.Current.Request.Params["sortorder"];
|
||||
if(!string.IsNullOrWhiteSpace(so))
|
||||
{
|
||||
sortOrder = (QBSortOrderEnum) int.Parse(so);
|
||||
}
|
||||
}
|
||||
|
||||
return sortOrder == QBSortOrderEnum.NachHauptbetreuung ? reportObjects.OrderBy(r => r.MainAttendant).ToList() : reportObjects;
|
||||
}
|
||||
|
||||
public void CalculateFLSSollIst()
|
||||
{
|
||||
if (this.SupportConceptCostBearer != null && this.SupportConceptCostBearer.CostBearer2SupportConceptOid != null)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v23.2, Version=23.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
protected override bool AreDCAndEntityEqual(SignatureDC pDC, Signature pEntity)
|
||||
{
|
||||
if (pDC.ServiceRecordOid is null)
|
||||
if (pDC.SignatureOid is null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.ServiceRecordOid == pEntity.ServiceRecordOid;
|
||||
return pDC.SignatureOid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "7622428090"; // Freie gemeinnützige Beratungsstelle für Psychotherapie e.V. (BfpDus) (Panama)
|
||||
//t = "0206140343"; // Lebenswelt Gabriel
|
||||
//t = "6916712798"; // LH Rodenkirchen Bewo
|
||||
//t = "6255521162"; // KCM GmbH
|
||||
t = "6255521162"; // KCM GmbH
|
||||
//t = "2697528233"; // Diakonisches Werk Wesel
|
||||
//t = "2547623489"; // Sprungbrett
|
||||
//t = "5076807716"; // Psychosoziale Hilfen Bochum e.V.
|
||||
@@ -340,7 +340,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "2986016022"; // Ev Verein für Wohnraumhilfe Frankfurt a.M.
|
||||
//t = "2181497347"; // BetreuungsserviceFuerAlltagUndWohnen (BAW Aachen)
|
||||
//t = "5433105975"; // aha e.V.
|
||||
t = "7396826106"; // SKF Sozialdienst katholischer Frauen e.V. Leverkusen
|
||||
//t = "7396826106"; // SKF Sozialdienst katholischer Frauen e.V. Leverkusen
|
||||
//t = "4748304562"; // BeWo Darmstadt
|
||||
//t = "5315865694"; // Wismarer Werkstätten GmbH
|
||||
//t = "6971328056"; // SKM Krefeld
|
||||
|
||||
@@ -268,5 +268,9 @@ namespace BeWo.Service.ServiceContracts
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Dictionary<SchedulerAppointmentDC, bool> OverlappingAppointmentsExistForMultiple(List<SchedulerAppointmentDC> appointments);
|
||||
|
||||
[FaultContract(typeof(BeWoFault))]
|
||||
[OperationContract]
|
||||
Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> FindAppointmentsInRangeForIntervalFinder(int duration, DateTime startDate, DateTime endDate, List<long> resourceOids, List<long> customerOids, List<long> employeeOids, long loggedInEmployeeOid, int intervalBuffer = 30, bool skipWeekends = true);
|
||||
}
|
||||
}
|
||||
@@ -3344,38 +3344,38 @@ namespace BeWo.Service.ServiceImplementations
|
||||
if (statementType.Equals(StatementType.Insert) && serviceRecordOidList != null)
|
||||
{
|
||||
var iterator = 0;
|
||||
foreach (var history in lOriginals.Select(serviceRecordOriginal => new ServiceRecordHistory
|
||||
foreach(var history in lOriginals.Select(serviceRecordOriginal => new ServiceRecordHistory
|
||||
{
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = statementType,
|
||||
CostBearer2SupportConcept = serviceRecordOriginal.CostBearer2SupportConcept,
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = statementType,
|
||||
CostBearer2SupportConcept = serviceRecordOriginal.CostBearer2SupportConcept,
|
||||
CostBearer2SupportConceptOid = serviceRecordOriginal.CostBearer2SupportConceptOid,
|
||||
Customer = serviceRecordOriginal.Customer,
|
||||
CustomerOid = serviceRecordOriginal.CustomerOid,
|
||||
Employee = serviceRecordOriginal.Employee,
|
||||
EmployeeOid = serviceRecordOriginal.EmployeeOid,
|
||||
End = serviceRecordOriginal.End,
|
||||
Group = serviceRecordOriginal.Group,
|
||||
GroupEmployeeCount = serviceRecordOriginal.GroupEmployeeCount,
|
||||
GroupOid = serviceRecordOriginal.GroupOid,
|
||||
GroupPersonCount = serviceRecordOriginal.GroupPersonCount,
|
||||
GroupRoundedDuration = serviceRecordOriginal.GroupRoundedDuration,
|
||||
IP = serviceRecordOriginal.IP,
|
||||
IsActive = serviceRecordOriginal.IsActive,
|
||||
Notice = serviceRecordOriginal.Notice,
|
||||
ServiceRecordOid = serviceRecordOidList.ElementAt(iterator),
|
||||
RoundedDuration = serviceRecordOriginal.RoundedDuration,
|
||||
ServiceDescription = serviceRecordOriginal.ServiceDescription,
|
||||
ServiceRecordType = serviceRecordOriginal.ServiceRecordType,
|
||||
ServiceRecordInsTs = serviceRecordOriginal.InsTs,
|
||||
ServiceRecordVersion = serviceRecordOriginal.Version ?? 0,
|
||||
ServiceRecordInsUser = serviceRecordOriginal.InsUser,
|
||||
ServiceRecordUdpUser = serviceRecordOriginal.UdpUser,
|
||||
Start = serviceRecordOriginal.Start,
|
||||
SupportConcept = serviceRecordOriginal.SupportConcept,
|
||||
SystemEntryID = serviceRecordOriginal.SystemEntryID,
|
||||
DistanceInMeter = serviceRecordOriginal.DistanceInMeter,
|
||||
IsCreatedInMobileClient = serviceRecordOriginal.IsCreatedInMobileClient
|
||||
Customer = serviceRecordOriginal.Customer,
|
||||
CustomerOid = serviceRecordOriginal.CustomerOid,
|
||||
Employee = serviceRecordOriginal.Employee,
|
||||
EmployeeOid = serviceRecordOriginal.EmployeeOid,
|
||||
End = serviceRecordOriginal.End,
|
||||
Group = serviceRecordOriginal.Group,
|
||||
GroupEmployeeCount = serviceRecordOriginal.GroupEmployeeCount,
|
||||
GroupOid = serviceRecordOriginal.GroupOid,
|
||||
GroupPersonCount = serviceRecordOriginal.GroupPersonCount,
|
||||
GroupRoundedDuration = serviceRecordOriginal.GroupRoundedDuration,
|
||||
IP = serviceRecordOriginal.IP,
|
||||
IsActive = serviceRecordOriginal.IsActive,
|
||||
Notice = serviceRecordOriginal.Notice,
|
||||
ServiceRecordOid = serviceRecordOidList.ElementAt(iterator),
|
||||
RoundedDuration = serviceRecordOriginal.RoundedDuration,
|
||||
ServiceDescription = serviceRecordOriginal.ServiceDescription,
|
||||
ServiceRecordType = serviceRecordOriginal.ServiceRecordType,
|
||||
ServiceRecordInsTs = serviceRecordOriginal.InsTs,
|
||||
ServiceRecordVersion = serviceRecordOriginal.Version ?? 0,
|
||||
ServiceRecordInsUser = serviceRecordOriginal.InsUser,
|
||||
ServiceRecordUdpUser = serviceRecordOriginal.UdpUser,
|
||||
Start = serviceRecordOriginal.Start,
|
||||
SupportConcept = serviceRecordOriginal.SupportConcept,
|
||||
SystemEntryID = serviceRecordOriginal.SystemEntryID,
|
||||
DistanceInMeter = serviceRecordOriginal.DistanceInMeter,
|
||||
IsCreatedInMobileClient = serviceRecordOriginal.IsCreatedInMobileClient
|
||||
}))
|
||||
{
|
||||
iterator++;
|
||||
@@ -3384,7 +3384,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var original in lOriginals)
|
||||
foreach(var original in lOriginals)
|
||||
{
|
||||
SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
|
||||
|
||||
@@ -3395,41 +3395,41 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
serviceRecordHistoryEntries.AddIfNotIn(new ServiceRecordHistory
|
||||
{
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = statementType,
|
||||
CostBearer2SupportConcept = original.CostBearer2SupportConcept,
|
||||
CostBearer2SupportConceptOid = original.CostBearer2SupportConceptOid,
|
||||
Customer = original.Customer,
|
||||
CustomerOid = original.CustomerOid,
|
||||
Employee = original.Employee,
|
||||
EmployeeOid = original.EmployeeOid,
|
||||
End = original.End,
|
||||
Group = original.Group,
|
||||
GroupEmployeeCount = original.GroupEmployeeCount,
|
||||
GroupOid = original.GroupOid,
|
||||
GroupPersonCount = original.GroupPersonCount,
|
||||
GroupRoundedDuration = original.GroupRoundedDuration,
|
||||
IP = original.IP,
|
||||
IsActive = original.IsActive,
|
||||
Notice = original.Notice,
|
||||
ServiceRecordOid = original.Oid,
|
||||
RoundedDuration = original.RoundedDuration,
|
||||
ServiceDescription = original.ServiceDescription,
|
||||
ServiceRecordType = original.ServiceRecordType,
|
||||
ServiceRecordInsTs = original.InsTs,
|
||||
ServiceRecordVersion = original.Version ?? 0,
|
||||
ServiceRecordInsUser = original.InsUser,
|
||||
ServiceRecordUdpUser = original.UdpUser,
|
||||
Start = original.Start,
|
||||
SupportConcept = original.SupportConcept,
|
||||
SystemEntryID = original.SystemEntryID,
|
||||
DistanceInMeter = original.DistanceInMeter,
|
||||
IsCreatedInMobileClient = original.IsCreatedInMobileClient,
|
||||
ServiceRecordSignatureStateType = previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = statementType,
|
||||
CostBearer2SupportConcept = original.CostBearer2SupportConcept,
|
||||
CostBearer2SupportConceptOid = original.CostBearer2SupportConceptOid,
|
||||
Customer = original.Customer,
|
||||
CustomerOid = original.CustomerOid,
|
||||
Employee = original.Employee,
|
||||
EmployeeOid = original.EmployeeOid,
|
||||
End = original.End,
|
||||
Group = original.Group,
|
||||
GroupEmployeeCount = original.GroupEmployeeCount,
|
||||
GroupOid = original.GroupOid,
|
||||
GroupPersonCount = original.GroupPersonCount,
|
||||
GroupRoundedDuration = original.GroupRoundedDuration,
|
||||
IP = original.IP,
|
||||
IsActive = original.IsActive,
|
||||
Notice = original.Notice,
|
||||
ServiceRecordOid = original.Oid,
|
||||
RoundedDuration = original.RoundedDuration,
|
||||
ServiceDescription = original.ServiceDescription,
|
||||
ServiceRecordType = original.ServiceRecordType,
|
||||
ServiceRecordInsTs = original.InsTs,
|
||||
ServiceRecordVersion = original.Version ?? 0,
|
||||
ServiceRecordInsUser = original.InsUser,
|
||||
ServiceRecordUdpUser = original.UdpUser,
|
||||
Start = original.Start,
|
||||
SupportConcept = original.SupportConcept,
|
||||
SystemEntryID = original.SystemEntryID,
|
||||
DistanceInMeter = original.DistanceInMeter,
|
||||
IsCreatedInMobileClient = original.IsCreatedInMobileClient,
|
||||
ServiceRecordSignatureStateType = previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
|
||||
CustomerConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
|
||||
EmployeeConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
|
||||
CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
|
||||
EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
|
||||
CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
|
||||
EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -4001,7 +4001,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var oidList = InsertNewServiceRecords(dcList);
|
||||
var serviceRecordOid = oidList[0];
|
||||
|
||||
if (!string.IsNullOrEmpty(sig.DataBild))
|
||||
if(!string.IsNullOrEmpty(sig.DataBild))
|
||||
{
|
||||
var lSignature = MapperFactory.SignatureDC_Signature.MapToNewEntity(sig);
|
||||
|
||||
@@ -4013,9 +4013,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
|
||||
return serviceRecordOid;
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch(Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -8089,11 +8088,11 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
serviceRecordOidsWithSignatures = new List<long>();
|
||||
|
||||
foreach (var crs in signatures)
|
||||
foreach(var crs in signatures)
|
||||
{
|
||||
foreach (var sr in crs.ServiceRecords)
|
||||
foreach(var sr in crs.ServiceRecords)
|
||||
{
|
||||
if (sr.Oid.HasValue && serviceRecordOids.Contains(sr.Oid.Value))
|
||||
if(sr.Oid.HasValue && serviceRecordOids.Contains(sr.Oid.Value))
|
||||
{
|
||||
serviceRecordOidsWithSignatures.AddIfNotIn(sr.Oid.Value);
|
||||
}
|
||||
@@ -8102,7 +8101,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(signatures);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch(Exception e)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(e);
|
||||
}
|
||||
@@ -8112,15 +8111,15 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
try
|
||||
{
|
||||
var lOriginals = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(confirmationReceiptSignatures2Update.Where(w => w.ConfirmationReceiptSignatureOid.HasValue).Select(confirmationReceiptSignatur => confirmationReceiptSignatur.ConfirmationReceiptSignatureOid.Value));
|
||||
var originalConfirmationReceiptSignatures = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(confirmationReceiptSignatures2Update.Where(w => w.ConfirmationReceiptSignatureOid.HasValue).Select(confirmationReceiptSignatur => confirmationReceiptSignatur.ConfirmationReceiptSignatureOid.Value));
|
||||
|
||||
MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MergeWithEntitys(confirmationReceiptSignatures2Update, lOriginals);
|
||||
MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MergeWithEntitys(confirmationReceiptSignatures2Update, originalConfirmationReceiptSignatures);
|
||||
|
||||
DAOFactory.GenericDAO.Update(lOriginals);
|
||||
DAOFactory.GenericDAO.Update(originalConfirmationReceiptSignatures);
|
||||
|
||||
lOriginals = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(confirmationReceiptSignatures2Update.Where(w => w.ConfirmationReceiptSignatureOid.HasValue).Select(confirmationReceiptSignatur => confirmationReceiptSignatur.ConfirmationReceiptSignatureOid.Value));
|
||||
originalConfirmationReceiptSignatures = DAOFactory.GenericDAO.LoadByIDs<ConfirmationReceiptSignature>(confirmationReceiptSignatures2Update.Where(w => w.ConfirmationReceiptSignatureOid.HasValue).Select(confirmationReceiptSignatur => confirmationReceiptSignatur.ConfirmationReceiptSignatureOid.Value));
|
||||
|
||||
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(lOriginals);
|
||||
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(originalConfirmationReceiptSignatures);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -8228,19 +8227,19 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var orderedOldOnes = oldServiceRecords.Where(x => x.Oid.HasValue).OrderBy(x => x.Oid.Value).ToList();
|
||||
var orderedNewOnes = serviceRecordsToUpdate.Where(x => x.ServiceRecordOid.HasValue).OrderBy(x => x.ServiceRecordOid.Value).ToList();
|
||||
|
||||
foreach (var oldSr in orderedOldOnes)
|
||||
foreach(var oldSr in orderedOldOnes)
|
||||
{
|
||||
var newSr = orderedNewOnes.FirstOrDefault(f => f.ServiceRecordOid == oldSr.Oid);
|
||||
|
||||
if (newSr != null)
|
||||
if(newSr != null)
|
||||
{
|
||||
oldVsNew.Add(oldSr, newSr);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var kvp in oldVsNew)
|
||||
foreach(var kvp in oldVsNew)
|
||||
{
|
||||
if (kvp.Value.ServiceRecordOid.HasValue && (kvp.Key.Start != kvp.Value.Start || kvp.Key.End != kvp.Value.End || isDeleting))
|
||||
if(kvp.Value.ServiceRecordOid.HasValue && (kvp.Key.Start != kvp.Value.Start || kvp.Key.End != kvp.Value.End || isDeleting))
|
||||
{
|
||||
serviceRecordOids.AddIfNotIn(kvp.Value.ServiceRecordOid.Value);
|
||||
}
|
||||
@@ -8251,17 +8250,16 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var confirmationReceiptSignatures2Delete = new List<ConfirmationReceiptSignature>();
|
||||
var confirmationReceiptSignatures2Update = new List<ConfirmationReceiptSignature>();
|
||||
|
||||
foreach (var signature in confirmationReceiptSignatures)
|
||||
foreach(var signature in confirmationReceiptSignatures)
|
||||
{
|
||||
var signatures2Keep = signature.ServiceRecords.Where(sr => sr.Oid.HasValue && !serviceRecordOids.Contains(sr.Oid.Value)).ToList();
|
||||
|
||||
if (signatures2Keep.Count == 0)
|
||||
if(signatures2Keep.Count == 0)
|
||||
{
|
||||
confirmationReceiptSignatures2Delete.AddIfNotIn(signature);
|
||||
continue;
|
||||
}
|
||||
|
||||
signature.ServiceRecords.Clear();
|
||||
signature.ServiceRecords = signatures2Keep;
|
||||
|
||||
confirmationReceiptSignatures2Update.AddIfNotIn(signature);
|
||||
@@ -8272,7 +8270,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
var oids2Versions = new Dictionary<long, long>();
|
||||
confirmationReceiptSignatures2Delete.DoForEach(signature =>
|
||||
{
|
||||
if (signature.Oid is null || signature.Version is null)
|
||||
if(signature.Oid is null || signature.Version is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -8286,9 +8284,9 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
var mostRecentSignatureStatusInfos = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecords(serviceRecordOids);
|
||||
|
||||
if (confirmationReceiptSignatures2Update.Any())
|
||||
if(confirmationReceiptSignatures2Update.Any())
|
||||
{
|
||||
foreach (var serviceRecord in timeAlteredServiceRecords)
|
||||
foreach(var serviceRecord in timeAlteredServiceRecords)
|
||||
{
|
||||
SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
|
||||
|
||||
@@ -8311,25 +8309,25 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var confirmationReceiptSignature in confirmationReceiptSignatures2Delete)
|
||||
foreach(var confirmationReceiptSignature in confirmationReceiptSignatures2Delete)
|
||||
{
|
||||
var first = confirmationReceiptSignature.ServiceRecords.FirstOrDefault();
|
||||
|
||||
// Eine Unterschrift, die in der confirmationReceiptSignatures2Delete ist, hat nur noch den einen ServiceRecord, der gerade in der Zeit bearbeitet wird!
|
||||
if (first != null)
|
||||
if(first != null && confirmationReceiptSignature.Oid.HasValue)
|
||||
{
|
||||
var signatureOid = confirmationReceiptSignature.Oid.Value;
|
||||
|
||||
var formerlySignedServiceRecords = DAOFactory.SearchDAO.FindFormerlyLinkedServiceRecordsBySignatureOid(signatureOid);
|
||||
|
||||
var blah = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecords(formerlySignedServiceRecords.Select(sr => sr.Oid.Value).ToList());
|
||||
var blah = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecords(formerlySignedServiceRecords.Where(sr => sr.Oid.HasValue).Select(sr => sr.Oid.Value).ToList());
|
||||
|
||||
mostRecentSignatureStatusInfos.AddAndIgnoreDuplicates(blah);
|
||||
|
||||
confirmationReceiptSignature.ServiceRecords.AddRangeIfElementsNotIn(formerlySignedServiceRecords);
|
||||
}
|
||||
|
||||
foreach (var serviceRecord in confirmationReceiptSignature.ServiceRecords)
|
||||
foreach(var serviceRecord in confirmationReceiptSignature.ServiceRecords)
|
||||
{
|
||||
var previousServiceRecord2SignatureStates = result.FirstOrDefault(f => f.ServiceRecord.Equals(serviceRecord));
|
||||
|
||||
@@ -8340,11 +8338,11 @@ namespace BeWo.Service.ServiceImplementations
|
||||
SignatureStateType.None
|
||||
);
|
||||
|
||||
if (previousServiceRecord2SignatureStates is null)
|
||||
if(previousServiceRecord2SignatureStates is null)
|
||||
{
|
||||
SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
|
||||
|
||||
if (serviceRecord.Oid.HasValue && mostRecentSignatureStatusInfos.ContainsKey(serviceRecord.Oid.Value))
|
||||
if(serviceRecord.Oid.HasValue && mostRecentSignatureStatusInfos.ContainsKey(serviceRecord.Oid.Value))
|
||||
{
|
||||
previousRecordHistorySignatureInfo = mostRecentSignatureStatusInfos[serviceRecord.Oid.Value];
|
||||
}
|
||||
@@ -8409,15 +8407,13 @@ namespace BeWo.Service.ServiceImplementations
|
||||
/// <param name="serviceRecords">Die Zeiterfassungseinträge, die gelöscht werden und eventuell mit Monatsunterschriften verknüpft sind.</param>
|
||||
private static void RemoveServiceRecordsFromConfirmationReceiptSignatureForDeletion(IEnumerable<ServiceRecord> serviceRecords)
|
||||
{
|
||||
var serviceRecordOids = serviceRecords.Select(serviceRecord => serviceRecord.Oid.Value).ToList();
|
||||
var serviceRecordOids = serviceRecords.Where(serviceRecord => serviceRecord.Oid.HasValue).Select(serviceRecord => serviceRecord.Oid.Value).ToList();
|
||||
|
||||
var confirmationReceiptSignatures = DAOFactory.SearchDAO.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(serviceRecordOids);
|
||||
|
||||
foreach (var signature in confirmationReceiptSignatures)
|
||||
{
|
||||
var serviceRecords2Keep = signature.ServiceRecords.Where(serviceRecord => serviceRecord.Oid.HasValue && !serviceRecordOids.Contains(serviceRecord.Oid.Value)).ToList();
|
||||
signature.ServiceRecords.Clear();
|
||||
signature.ServiceRecords = serviceRecords2Keep;
|
||||
signature.ServiceRecords = signature.ServiceRecords.Where(serviceRecord => serviceRecord.Oid.HasValue && !serviceRecordOids.Contains(serviceRecord.Oid.Value)).ToList();
|
||||
}
|
||||
|
||||
DAOFactory.GenericDAO.Update(confirmationReceiptSignatures);
|
||||
@@ -8487,6 +8483,8 @@ namespace BeWo.Service.ServiceImplementations
|
||||
/// <param name="originals"></param>
|
||||
private static List<ServiceRecord> DeleteSignaturesFromServiceRecords(IEnumerable<ServiceRecordDC> serviceRecords, List<ServiceRecord> originals)
|
||||
{
|
||||
// ToDo: Nur noch ServiceRecords aktualisieren, weil es jetzt einen Fremdschlüssel gibt!
|
||||
|
||||
var result = new List<ServiceRecord>();
|
||||
var oldVsNew = new Dictionary<ServiceRecord, ServiceRecordDC>();
|
||||
var orderedOldOnes = originals.Where(x => x.Oid.HasValue).OrderBy(x => x.Oid.Value).ToList();
|
||||
@@ -8662,22 +8660,6 @@ namespace BeWo.Service.ServiceImplementations
|
||||
{
|
||||
var serviceRecord = DAOFactory.GenericDAO.LoadByID<ServiceRecord>(serviceRecordOid);
|
||||
|
||||
var signature = DAOFactory.GenericDAO.LoadByID<Signature>(signatureOid);
|
||||
|
||||
if (signature?.Oid is null || serviceRecord?.SignatureOid is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!serviceRecord.SignatureOid.Value.Equals(signature.Oid.Value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MapperFactory.SignatureDC_Signature.ConcurrencyCheck(signature.Version, signature);
|
||||
|
||||
DAOFactory.GenericDAO.Delete(signature);
|
||||
|
||||
serviceRecord.SignatureOid = null;
|
||||
DAOFactory.GenericDAO.Update(serviceRecord);
|
||||
|
||||
@@ -8712,48 +8694,48 @@ namespace BeWo.Service.ServiceImplementations
|
||||
// Alten Unterschriftenstatus aus ServiceRecordHistory laden
|
||||
SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
|
||||
|
||||
if (serviceRecord.Oid.HasValue)
|
||||
if(serviceRecord.Oid.HasValue)
|
||||
{
|
||||
previousRecordHistorySignatureInfo = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecordOid(serviceRecord.Oid.Value);
|
||||
}
|
||||
|
||||
var seviceRecordHistoryEntry = new ServiceRecordHistory
|
||||
{
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = StatementType.Signature,
|
||||
CostBearer2SupportConcept = serviceRecord.CostBearer2SupportConcept,
|
||||
CostBearer2SupportConceptOid = serviceRecord.CostBearer2SupportConceptOid,
|
||||
Customer = serviceRecord.Customer,
|
||||
CustomerOid = serviceRecord.CustomerOid,
|
||||
Employee = serviceRecord.Employee,
|
||||
EmployeeOid = serviceRecord.EmployeeOid,
|
||||
End = serviceRecord.End,
|
||||
Group = serviceRecord.Group,
|
||||
GroupEmployeeCount = serviceRecord.GroupEmployeeCount,
|
||||
GroupOid = serviceRecord.GroupOid,
|
||||
GroupPersonCount = serviceRecord.GroupPersonCount,
|
||||
GroupRoundedDuration = serviceRecord.GroupRoundedDuration,
|
||||
IP = serviceRecord.IP,
|
||||
IsActive = serviceRecord.IsActive,
|
||||
Notice = serviceRecord.Notice,
|
||||
ServiceRecordOid = serviceRecord.Oid,
|
||||
RoundedDuration = serviceRecord.RoundedDuration,
|
||||
ServiceDescription = serviceRecord.ServiceDescription,
|
||||
ServiceRecordType = serviceRecord.ServiceRecordType,
|
||||
ServiceRecordInsTs = serviceRecord.InsTs,
|
||||
ServiceRecordVersion = serviceRecord.Version.Value,
|
||||
ServiceRecordInsUser = serviceRecord.InsUser,
|
||||
ServiceRecordUdpUser = serviceRecord.UdpUser,
|
||||
Start = serviceRecord.Start,
|
||||
SupportConcept = serviceRecord.SupportConcept,
|
||||
SystemEntryID = serviceRecord.SystemEntryID,
|
||||
DistanceInMeter = serviceRecord.DistanceInMeter,
|
||||
IsCreatedInMobileClient = serviceRecord.IsCreatedInMobileClient,
|
||||
TimeStamp = DateTime.Now,
|
||||
ChangeType = StatementType.Signature,
|
||||
CostBearer2SupportConcept = serviceRecord.CostBearer2SupportConcept,
|
||||
CostBearer2SupportConceptOid = serviceRecord.CostBearer2SupportConceptOid,
|
||||
Customer = serviceRecord.Customer,
|
||||
CustomerOid = serviceRecord.CustomerOid,
|
||||
Employee = serviceRecord.Employee,
|
||||
EmployeeOid = serviceRecord.EmployeeOid,
|
||||
End = serviceRecord.End,
|
||||
Group = serviceRecord.Group,
|
||||
GroupEmployeeCount = serviceRecord.GroupEmployeeCount,
|
||||
GroupOid = serviceRecord.GroupOid,
|
||||
GroupPersonCount = serviceRecord.GroupPersonCount,
|
||||
GroupRoundedDuration = serviceRecord.GroupRoundedDuration,
|
||||
IP = serviceRecord.IP,
|
||||
IsActive = serviceRecord.IsActive,
|
||||
Notice = serviceRecord.Notice,
|
||||
ServiceRecordOid = serviceRecord.Oid,
|
||||
RoundedDuration = serviceRecord.RoundedDuration,
|
||||
ServiceDescription = serviceRecord.ServiceDescription,
|
||||
ServiceRecordType = serviceRecord.ServiceRecordType,
|
||||
ServiceRecordInsTs = serviceRecord.InsTs,
|
||||
ServiceRecordVersion = serviceRecord.Version.Value,
|
||||
ServiceRecordInsUser = serviceRecord.InsUser,
|
||||
ServiceRecordUdpUser = serviceRecord.UdpUser,
|
||||
Start = serviceRecord.Start,
|
||||
SupportConcept = serviceRecord.SupportConcept,
|
||||
SystemEntryID = serviceRecord.SystemEntryID,
|
||||
DistanceInMeter = serviceRecord.DistanceInMeter,
|
||||
IsCreatedInMobileClient = serviceRecord.IsCreatedInMobileClient,
|
||||
CustomerConfirmationReceiptSignatureStateType = customerMonthlySignatureStateType ?? previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
|
||||
EmployeeConfirmationReceiptSignatureStateType = employeeMonthlySignatureStateType ?? previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
|
||||
ServiceRecordSignatureStateType = singleSignatureStateType ?? previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
|
||||
CustomerConfirmationReceiptSignatureOid = customerConfirmationReceiptSignatureOid ?? previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
|
||||
EmployeeConfirmationReceiptSignatureOid = employeeConfirmationReceiptsignatureOid ?? previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
|
||||
ServiceRecordSignatureStateType = singleSignatureStateType ?? previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
|
||||
CustomerConfirmationReceiptSignatureOid = customerConfirmationReceiptSignatureOid ?? previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
|
||||
EmployeeConfirmationReceiptSignatureOid = employeeConfirmationReceiptsignatureOid ?? previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
|
||||
};
|
||||
|
||||
DAOFactory.GenericDAO.Insert(seviceRecordHistoryEntry);
|
||||
@@ -8989,7 +8971,7 @@ namespace BeWo.Service.ServiceImplementations
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is ServiceRecord2SignatureStates sr2Ss && !(sr2Ss.ServiceRecord is null))
|
||||
if (obj is ServiceRecord2SignatureStates sr2Ss && sr2Ss.ServiceRecord != null)
|
||||
{
|
||||
return ServiceRecord?.Equals(sr2Ss.ServiceRecord) ?? false;
|
||||
}
|
||||
|
||||
@@ -2649,6 +2649,18 @@ namespace BeWo.Service.ServiceImplementations
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<DateTimeSpan, Dictionary<DateTime, bool>> FindAppointmentsInRangeForIntervalFinder(int duration, DateTime startDate, DateTime endDate, List<long> resourceOids, List<long> customerOids, List<long> employeeOids, long loggedInEmployeeOid, int intervalBuffer = 30, bool skipWeekends = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
return DAOFactory.SearchDAO.FindAppointmentsInRangeForIntervalFinder(duration, startDate, endDate, resourceOids, customerOids, employeeOids, loggedInEmployeeOid, intervalBuffer, skipWeekends);
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
throw Utils.CreateBeWoFaultException(exception);
|
||||
}
|
||||
}
|
||||
|
||||
public List<AbsenceTimeDC> GetAllActiveCustomersAbsenceTimesInInterval(DateTime start, DateTime end, long employeeOid, List<long> selectedCustomerOids)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -176,7 +176,8 @@ namespace BS.Shared
|
||||
WohneinheitBelegung = 169,
|
||||
CustomerFalldaten = 170,
|
||||
Image = 171,
|
||||
TwoFactorCode = 172
|
||||
TwoFactorCode = 172,
|
||||
SignatureDeletionHistory = 173
|
||||
}
|
||||
|
||||
public enum SystemEntryID
|
||||
|
||||
@@ -51,6 +51,13 @@ namespace BS.Shared.Core
|
||||
_EndDate = ende;
|
||||
}
|
||||
|
||||
public DateTimeSpan(DateTime start, DateTime end, bool isCalculatingHoursAndMinutesByDates)
|
||||
{
|
||||
IsCalculatingHoursAndMinutesByDates = isCalculatingHoursAndMinutesByDates;
|
||||
StartDate = start;
|
||||
EndDate = end;
|
||||
}
|
||||
|
||||
public DateTime EndDate
|
||||
{
|
||||
get { return _EndDate; }
|
||||
@@ -340,5 +347,13 @@ namespace BS.Shared.Core
|
||||
}
|
||||
|
||||
public bool IsCalculatingHoursAndMinutesByDates { get; set; }
|
||||
|
||||
public bool EqualTimes(DateTimeSpan dateTimeSpan)
|
||||
{
|
||||
return StartHours.Equals(dateTimeSpan.StartHours) &&
|
||||
StartMinutes.Equals(dateTimeSpan.StartMinutes) &&
|
||||
EndHours.Equals(dateTimeSpan.EndHours) &&
|
||||
EndMinutes.Equals(dateTimeSpan.EndMinutes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
public static string IsEndDateVisible => "IsEndDateVisible";
|
||||
public static string IsZeiterfassungInStdMin => "IsZeiterfassungInStdMin";
|
||||
|
||||
public static string EinheitZeiterfassung => "EinheitZeiterfassung";
|
||||
public static string EinheitZeiterfassung => "EinheitZeiterfassung";
|
||||
public static string HilfeplanAuslaufAuswahl => "HilfeplanAuslaufAuswahl";
|
||||
public static string AnzTageZeiterfassErfolgt => "AnzTageZeiterfassErfolgt";
|
||||
public static string MaxDaysEditServiceRecordsAllowed => "MaxDaysEditServiceRecordsAllowed";
|
||||
@@ -79,7 +79,7 @@
|
||||
public static string ShowMultipleResourceColors => "ShowMultipleResourceColors";
|
||||
|
||||
public static string AllowStorno => "AllowStorno";
|
||||
public static string UseDistanceApi => "UseDistanceApi";
|
||||
public static string UseDistanceApi => "UseDistanceApi";
|
||||
|
||||
// Keys Für die Web.config von Host
|
||||
public static string FileRootDirectory => "FileRootDirectory";
|
||||
@@ -87,8 +87,8 @@
|
||||
public static string ShowKlientenBetreuungszeiten => "ShowKlientenBetreuungszeiten";
|
||||
public static string ShowInfoButtonInCalender => "ShowInfoButtonInCalender";
|
||||
public static string ShowHilfeplanStatistikReport => "ShowHilfeplanStatistikReport";
|
||||
public static string ShowAI => "ShowAI";
|
||||
public static string ShowAIInternal => "ShowAIInternal";
|
||||
public static string ShowAI => "ShowAI";
|
||||
public static string ShowAIInternal => "ShowAIInternal";
|
||||
|
||||
public static string MoKSessionTimeout => "MoKSessionTimeout";
|
||||
|
||||
@@ -102,5 +102,7 @@
|
||||
|
||||
public static string DontUpdateApprovalPeriodDates => "DontUpdateApprovalPeriodDates";
|
||||
|
||||
// Keys für das neue Kalendermodul
|
||||
public static string SchedulingViewType => "SchedulingViewType";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System.Runtime.Serialization;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace BS.Shared.DataContracts
|
||||
{
|
||||
[Serializable]
|
||||
[DataContract]
|
||||
public partial class AbsenceReasonDC : IDataContract
|
||||
{
|
||||
|
||||
7
Shared/DataContracts/ClientPartials/IMoKSearchableDC.cs
Normal file
7
Shared/DataContracts/ClientPartials/IMoKSearchableDC.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace BS.Shared.DataContracts.ClientPartials
|
||||
{
|
||||
public interface IMoKSearchableDC
|
||||
{
|
||||
long EntityOid { get; }
|
||||
}
|
||||
}
|
||||
@@ -92,8 +92,6 @@ namespace BS.Shared.DataContracts.ClientPartials
|
||||
|
||||
public string Name => DetailDescription;
|
||||
|
||||
|
||||
|
||||
public SupportConceptGoalDC ParentGoal { get; set; }
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using BS.Shared.DataContracts.ClientPartials;
|
||||
|
||||
namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
public partial class CompactCustomerDC : IFilterableDC, IInvoiceRecipient
|
||||
public partial class CompactCustomerDC : IFilterableDC, IInvoiceRecipient, IMoKSearchableDC
|
||||
{
|
||||
public string AddressString
|
||||
{
|
||||
@@ -105,15 +106,6 @@ namespace BS.Shared.DataContracts.Compact
|
||||
}
|
||||
}
|
||||
|
||||
public long? Oid
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.CustomerOid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
|
||||
|
||||
public string SimpleDescription
|
||||
@@ -187,6 +179,8 @@ namespace BS.Shared.DataContracts.Compact
|
||||
get { return ToString(); }
|
||||
}
|
||||
|
||||
|
||||
public long? Oid => CustomerOid;
|
||||
|
||||
public long EntityOid => CustomerOid;
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,6 @@ namespace BS.Shared.DataContracts.Compact
|
||||
return Name;
|
||||
}
|
||||
|
||||
public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
|
||||
public SolidColorBrush FilterableBrush => new SolidColorBrush(Colors.Transparent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,35 @@
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media;
|
||||
using BS.Shared.DataContracts.ClientPartials;
|
||||
|
||||
namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
public partial class CompactEmployeeDC : IFilterableDC
|
||||
public partial class CompactEmployeeDC : IFilterableDC, IMoKSearchableDC
|
||||
{
|
||||
public long EntityOid => EmployeeOid;
|
||||
|
||||
public string DetailDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
var text = LastName + ", " + FirstName;
|
||||
var text = $"{LastName}, {FirstName}";
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(PersonnelNumber))
|
||||
if(!string.IsNullOrWhiteSpace(PersonnelNumber))
|
||||
{
|
||||
text += String.Format(" ({0})", PersonnelNumber);
|
||||
text += $" ({PersonnelNumber})";
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string FilterRelevants => String.Format("{0} {1} {2} {3} {4} {5}", FirstName, LastName, PersonnelNumber, Details2, Details3, Teams);
|
||||
public string FilterRelevants => $"{FirstName} {LastName} {PersonnelNumber} {Details2} {Details3} {Teams}";
|
||||
|
||||
public string IconPath => @"..\..\Ressources\Icons\UserBusinessMaleDisabled.png";
|
||||
|
||||
public string SimpleDescription => LastName + ", " + FirstName;
|
||||
|
||||
public string Teams => this.RelatedTeams;
|
||||
public string Teams => RelatedTeams;
|
||||
|
||||
public bool SupportsActivationType => true;
|
||||
|
||||
|
||||
@@ -88,6 +88,5 @@ namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,61 +1,53 @@
|
||||
using System.Windows.Media;
|
||||
using BS.Shared.DataContracts.ClientPartials;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
public partial class CompactOrganisationDC : IFilterableDC
|
||||
public partial class CompactOrganisationDC : IFilterableDC, IMoKSearchableDC
|
||||
{
|
||||
|
||||
public long EntityOid => OrganisationOid;
|
||||
|
||||
public bool IsArchived
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ActivationType == ActivationTypeId.Archived;
|
||||
}
|
||||
}
|
||||
public bool IsArchived => ActivationType == ActivationTypeId.Archived;
|
||||
|
||||
public bool IsDeleted
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ActivationType == ActivationTypeId.Deleted;
|
||||
}
|
||||
}
|
||||
public bool IsDeleted => ActivationType == ActivationTypeId.Deleted;
|
||||
|
||||
public string AddressString
|
||||
{
|
||||
get
|
||||
{
|
||||
string address = this.Street;
|
||||
if (address != null && address.Length > 0)
|
||||
var address = Street;
|
||||
if(!string.IsNullOrEmpty(address))
|
||||
{
|
||||
address += ", ";
|
||||
}
|
||||
|
||||
return address + this.PostalCode + " " + this.Town;
|
||||
return address + PostalCode + " " + Town;
|
||||
}
|
||||
}
|
||||
|
||||
public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
|
||||
public SolidColorBrush FilterableBrush => new SolidColorBrush(Colors.Transparent);
|
||||
|
||||
public string AddressSummaryInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
string address = this.Street;
|
||||
if (address != null && address.Length > 0)
|
||||
var address = Street;
|
||||
if(!string.IsNullOrEmpty(address))
|
||||
{
|
||||
address += "\n";
|
||||
}
|
||||
if (address == null)
|
||||
|
||||
if(address is null)
|
||||
{
|
||||
address = string.Empty;
|
||||
}
|
||||
address += this.PostalCode + " " + this.Town;
|
||||
|
||||
address += PostalCode + " " + Town;
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
set { }
|
||||
}
|
||||
|
||||
@@ -63,99 +55,65 @@ namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
get
|
||||
{
|
||||
string info = string.Empty;
|
||||
var info = string.Empty;
|
||||
|
||||
if (!string.IsNullOrEmpty(this.Communication1))
|
||||
info = "Tel.: " + this.Communication1;
|
||||
if (!string.IsNullOrEmpty(this.Communication2))
|
||||
if(!string.IsNullOrEmpty(Communication1))
|
||||
{
|
||||
info = "Tel.: " + Communication1;
|
||||
}
|
||||
|
||||
if(!string.IsNullOrEmpty(Communication2))
|
||||
{
|
||||
if (info.Length > 0)
|
||||
info += "\n";
|
||||
info += "Fax: " + this.Communication2;
|
||||
info += "Fax: " + Communication2;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.Communication3))
|
||||
|
||||
if(!string.IsNullOrEmpty(Communication3))
|
||||
{
|
||||
if (info.Length > 0)
|
||||
info += "\n";
|
||||
info += "E-Mail: " + this.Communication3;
|
||||
info += "E-Mail: " + Communication3;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.Communication4))
|
||||
|
||||
if(!string.IsNullOrEmpty(Communication4))
|
||||
{
|
||||
if (info.Length > 0)
|
||||
if(info.Length > 0)
|
||||
{
|
||||
info += "\n";
|
||||
info += "Internet: " + this.Communication4;
|
||||
}
|
||||
|
||||
info += "Internet: " + Communication4;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
set { }
|
||||
}
|
||||
|
||||
public string DetailDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
public string DetailDescription => Name;
|
||||
|
||||
public string FilterRelevants
|
||||
{
|
||||
get { return this.Name + " " + this.Function + " " + AddressSummaryInfo; }
|
||||
}
|
||||
public string FilterRelevants => Name + " " + Function + " " + AddressSummaryInfo;
|
||||
|
||||
public string IconPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return @"..\..\Ressources\Icons\OfficeBulidingBlackDisabled.png";
|
||||
}
|
||||
}
|
||||
public string IconPath => @"..\..\Ressources\Icons\OfficeBulidingBlackDisabled.png";
|
||||
|
||||
public string ServiceUnitName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.CostRatePeriods != null)
|
||||
{
|
||||
return CostRatePeriods.GetCurrentlyValidRate(CostRatePeriodType.MinutesPerServiceUnit).UnitName;
|
||||
}
|
||||
public string ServiceUnitName => CostRatePeriods != null ? CostRatePeriods.GetCurrentlyValidRate(CostRatePeriodType.MinutesPerServiceUnit).UnitName : "Stunden";
|
||||
|
||||
return "Stunden";
|
||||
}
|
||||
}
|
||||
public string SimpleDescription => Name;
|
||||
|
||||
public string SimpleDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
|
||||
public bool SupportsActivationType
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool SupportsActivationType => false;
|
||||
|
||||
public long Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.OrganisationVersion;
|
||||
}
|
||||
get => OrganisationVersion;
|
||||
|
||||
set
|
||||
{
|
||||
this.OrganisationVersion = value;
|
||||
}
|
||||
set => OrganisationVersion = value;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj is CompactOrganisationDC compactOrganisation)
|
||||
if(obj is CompactOrganisationDC compactOrganisation)
|
||||
{
|
||||
return OrganisationOid == compactOrganisation.OrganisationOid;
|
||||
}
|
||||
@@ -165,12 +123,12 @@ namespace BS.Shared.DataContracts.Compact
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return this.GetType().Name.GetHashCode() ^ this.OrganisationOid.GetHashCode();
|
||||
return GetType().Name.GetHashCode() ^ OrganisationOid.GetHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using System.Windows.Media;
|
||||
|
||||
namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
[Serializable]
|
||||
public partial class CompactSupportConceptDC : IFilterableDC
|
||||
{
|
||||
private List<string> _CostBearerDetailStrings;
|
||||
|
||||
@@ -1,72 +1,32 @@
|
||||
using System.Windows.Media;
|
||||
using BS.Shared.DataContracts.ClientPartials;
|
||||
|
||||
namespace BS.Shared.DataContracts.Compact
|
||||
{
|
||||
public partial class CompactTeamDC : IFilterableDC
|
||||
public partial class CompactTeamDC : IFilterableDC, IMoKSearchableDC
|
||||
{
|
||||
public ActivationTypeId ActivationType
|
||||
{
|
||||
get
|
||||
{
|
||||
return ActivationTypeId.Active;
|
||||
}
|
||||
get => ActivationTypeId.Active;
|
||||
|
||||
set
|
||||
{
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
public string DetailDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ToString();
|
||||
}
|
||||
}
|
||||
public string DetailDescription => ToString();
|
||||
|
||||
public string FilterRelevants
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Name + " " + this.LeaderString;
|
||||
}
|
||||
}
|
||||
public string FilterRelevants => Name + " " + LeaderString;
|
||||
|
||||
public string IconPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return @"..\..\Ressources\Icons\UserGroupBusinessDisabled.png";
|
||||
}
|
||||
}
|
||||
public string IconPath => @"..\..\Ressources\Icons\UserGroupBusinessDisabled.png";
|
||||
|
||||
public string SimpleDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
public string SimpleDescription => Name;
|
||||
|
||||
public bool SupportsActivationType
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool SupportsActivationType => false;
|
||||
|
||||
public long Version
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.TeamVersion;
|
||||
}
|
||||
get => TeamVersion;
|
||||
|
||||
set
|
||||
{
|
||||
this.TeamVersion = value;
|
||||
}
|
||||
set => TeamVersion = value;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
@@ -89,6 +49,8 @@ namespace BS.Shared.DataContracts.Compact
|
||||
return this.Name + ", Leitung: " + this.LeaderString;
|
||||
}
|
||||
|
||||
public SolidColorBrush FilterableBrush { get { return new SolidColorBrush(Colors.Transparent); } }
|
||||
public SolidColorBrush FilterableBrush => new SolidColorBrush(Colors.Transparent);
|
||||
|
||||
public long EntityOid => TeamOid;
|
||||
}
|
||||
}
|
||||
@@ -147,9 +147,6 @@ namespace BS.Shared.DataContracts
|
||||
|
||||
}
|
||||
|
||||
public virtual string LastNameFirstName
|
||||
{
|
||||
get => LastName + ", " + FirstName;
|
||||
}
|
||||
public virtual string LastNameFirstName => LastName + ", " + FirstName;
|
||||
}
|
||||
}
|
||||
@@ -715,5 +715,10 @@ namespace BS.Shared.Extensions
|
||||
$"{dateTime:dd.MM. HH:mm} - {endDate.Value:dd.MM.yyyy HH:mm}" :
|
||||
$"{dateTime:dd.MM.yyyy HH:mm} - {endDate.Value:dd.MM.yyyy HH:mm}";
|
||||
}
|
||||
|
||||
public static bool CompareTime(this DateTime date, DateTime date2)
|
||||
{
|
||||
return date.Hour == date2.Hour && date.Minute == date2.Minute && date.Second == date2.Second;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,7 @@
|
||||
<Compile Include="DataContracts\AdditionalServiceGroupOfPeopleRelationDC.cs" />
|
||||
<Compile Include="DataContracts\AdditionalServiceRegionDC.cs" />
|
||||
<Compile Include="DataContracts\AddressRouteDC.cs" />
|
||||
<Compile Include="DataContracts\ClientPartials\IMoKSearchableDC.cs" />
|
||||
<Compile Include="DataContracts\CustomerGemeinnutzigeArbeitDC.cs" />
|
||||
<Compile Include="DataContracts\Wohnhilfe\CustomerWohnhilfeDC.cs" />
|
||||
<Compile Include="DataContracts\ImageDC.cs" />
|
||||
|
||||
Reference in New Issue
Block a user