Termine in die Zeiterfassung übernehmen hat jetzt eine Link-Table, um das entsprechende Icon zuverlässig anzuzeigen.

MoK:
Löschen von Quittierungsbelegunterschriften eingebaut.
Bewerten von Zielen/Maßnahmen an das entsprechende Recht gekoppelt.
This commit is contained in:
2023-01-26 12:55:56 +01:00
parent 3d07aa38a8
commit 197c1b8da6
35 changed files with 1049 additions and 739 deletions

View File

@@ -806,6 +806,7 @@
<Compile Include="ProxyLoginView.xaml.cs">
<DependentUpon>ProxyLoginView.xaml</DependentUpon>
</Compile>
<Compile Include="Scheduler\Converter\AptToServRecsIconVisibilityConverter.cs" />
<Compile Include="Scheduler\Utils\AppointmentExtensions.cs" />
<Compile Include="Scheduler\Utils\Utils.cs" />
<Compile Include="Scheduler\ViewModel\CustomFieldStorage.cs" />

View File

@@ -2060,16 +2060,16 @@ namespace BeWo.Core
}
}
public static void CreateZeiterfassung(DateTime start, DateTime end, List<CompactCustomerDC> customer, List<CompactEmployeeDC> employees, String notice, Appointment appointment, Action schedulerCallback)
public static void CreateZeiterfassung(DateTime start, DateTime end, List<CompactCustomerDC> customer, List<CompactEmployeeDC> employees, string notice, Appointment appointment, Action<List<ServiceRecordDC>> schedulerCallback)
{
ChatDokumentationsView newView;
if (customer.Count == 0)
if(customer.Count == 0)
{
// Normale Buchung
newView = new ChatDokumentationsView(notice, null, start, end, null, schedulerCallback, appointment);
}
else if (customer.Count == 1 && employees.Count < 2)
else if(customer.Count == 1 && employees.Count < 2)
{
var compactKlient = ServiceFacade.DoCustomerServiceSync(s => s.GetCompactCustomerDC(customer[0].CustomerOid));
@@ -2079,7 +2079,7 @@ namespace BeWo.Core
}
else
{
if (employees.Count == 0)
if(employees.Count == 0)
{
employees.Add(BeWoApp.CompactLoggedOnEmployee);
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;
using BS.Shared.DataContracts;
namespace BeWo.Scheduler.Converter
{
public class AptToServRecsIconVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(value is List<ServiceRecordDC> serviceRecordList)
{
return serviceRecordList.Any() ? Visibility.Visible : Visibility.Collapsed;
}
return Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -111,6 +111,12 @@ namespace BeWo.Scheduler.Utils
return appointment.GetCustomFieldStorage()?.IsCustomerAbsenceTime ?? false;
}
public static List<ServiceRecordDC> CF_ServiceRecordList(this Appointment appointment)
{
return appointment.GetCustomFieldStorage()?.ServiceRecordList ?? new List<ServiceRecordDC>();
}
public static void CF_IsTask(this Appointment appointment, bool pIsTask)
{
appointment.GetCustomFieldStorage().IsTask = pIsTask;
@@ -194,5 +200,10 @@ namespace BeWo.Scheduler.Utils
{
appointment.GetCustomFieldStorage().HasServiceRecordEntry = hasServiceRecordEntry;
}
public static void CF_ServiceRecordList(this Appointment appointment, List<ServiceRecordDC> serviceRecords)
{
appointment.GetCustomFieldStorage().ServiceRecordList = serviceRecords;
}
}
}

View File

@@ -26,6 +26,7 @@
<view:AppointmentBorderZusageConverter x:Key="AppointmentBorderZusageConverter" />
<view:NichtNochEinConverter x:Key="NichtNochEinConverter" />
<view:InformationButtonVisibilityConverter x:Key="InformationButtonVisibilityConverter" />
<localSchConv:AptToServRecsIconVisibilityConverter x:Key="AptToServRecsIconVisibilityConverter" />
<!-- Region Appointment Templates -->
<!-- Region VerticalAppointmentTemplate -->
@@ -145,7 +146,8 @@
<TextBlock Grid.Row="1" Text="{Binding Location}" TextWrapping="Wrap" Margin="6,0,0,3" Foreground="{Binding Path=CustomViewInfo[CustomFieldStorage].ForegroundColor}" />
</Grid>
<dxschint:AppointmentImagesControl Grid.Column="1" ViewInfo="{Binding}" Orientation="Vertical" SnapsToDevicePixels="True" />
<Image Grid.Row="0" Grid.Column="2" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].HasServiceRecordEntry, Converter={StaticResource BoolVisibilityConverter}}" Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png" SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
<!-- ToDo: Neuen Converter schreiben, der prüft, ob in der Liste ServiceRecords sind -->
<Image Grid.Row="0" Grid.Column="2" Visibility="{Binding Path=CustomViewInfo[CustomFieldStorage].ServiceRecordList, Converter={StaticResource AptToServRecsIconVisibilityConverter}}" Source="/BeWoPlaner;component/Ressources/Icons/HistoryDisabled.png" SnapsToDevicePixels="True" Height="20" Width="20" VerticalAlignment="Top" />
</Grid>
</DataTemplate>
<!--Endregion-->
@@ -1020,19 +1022,19 @@
<dxsch:SchedulerControl.AppointmentMenuCustomizations>
<dxb:RemoveBarItemAndLinkAction ItemName="{x:Static dxsch:SchedulerMenuItemName.RestoreOccurrence}" />
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="RestoreAppointmentButtonItem" Content="Serientermin wiederherstellen" ItemClick="RestoreAppointmentButtonItem_OnItemClick" />
<dxb:BarButtonItem Name="RestoreAppointmentButtonItem" Content="Serientermin wiederherstellen" ItemClick="RestoreAppointmentButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:BarItemSeparator Name="ZusagenStackSeperatorTop"></dxb:BarItemSeparator>
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="ZusagenButtonItem" Content="Zusagen" ItemClick="ZusagenButtonItem_OnItemClick" />
<dxb:BarButtonItem Name="ZusagenButtonItem" Content="Zusagen" ItemClick="ZusagenButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="MitVorbehaltButtonItem" Content="Mit Vorbehalt zusagen" ItemClick="MitVorbehaltButtonItem_OnItemClick" />
<dxb:BarButtonItem Name="MitVorbehaltButtonItem" Content="Mit Vorbehalt zusagen" ItemClick="MitVorbehaltButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="AbsagenButtonItem" Content="Absagen" ItemClick="AbsagenButtonItem_OnItemClick" />
<dxb:BarButtonItem Name="AbsagenButtonItem" Content="Absagen" ItemClick="AbsagenButtonItem_OnItemClick" />
</dxb:AddBarItemAction>
<dxb:BarItemSeparator Name="ZusagenStackSeperatorBottom"></dxb:BarItemSeparator>
<dxb:BarItemSeparator Name="ZusagenStackSeperatorBottom"></dxb:BarItemSeparator>
<dxb:AddBarItemAction>
<dxb:BarButtonItem Name="ZeiterfassungButtonItem" Content="{markup:Translate In Zeiterfassung übertragen}" ItemClick="ZeiterfassungButtonItem_OnItemClick" />
</dxb:AddBarItemAction>

View File

@@ -37,7 +37,6 @@ using DevExpress.Xpf.Scheduler;
using DevExpress.Xpf.Scheduler.Reporting;
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.Compatibility;
using DevExpress.XtraScheduler.Forms;
using DevExpress.XtraScheduler.iCalendar;
using DevExpress.XtraScheduler.Services;
using Microsoft.Win32;
@@ -45,7 +44,6 @@ using Appointment = DevExpress.XtraScheduler.Appointment;
using AppointmentViewInfoCustomizingEventArgs = DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs;
using ColorConverter = System.Windows.Media.ColorConverter;
using DateTime = System.DateTime;
using DeleteRecurrentAppointmentFormEventArgs = DevExpress.Xpf.Scheduler.DeleteRecurrentAppointmentFormEventArgs;
using InplaceEditorEventArgs = DevExpress.Xpf.Scheduler.InplaceEditorEventArgs;
using SchedulerControl = DevExpress.Xpf.Scheduler.SchedulerControl;
@@ -1856,7 +1854,7 @@ namespace BeWo.Scheduler.View
var appointment = Scheduler.SelectedAppointments.FirstOrDefault();
if(appointment == null)
if(appointment is null)
{
return;
}
@@ -1866,7 +1864,7 @@ namespace BeWo.Scheduler.View
var employeeList = employee2SchedulerAppointmentList.Select(employee2SchedulerAppointment => employee2SchedulerAppointment.Employee).ToList();
BeWoUtils.CreateZeiterfassung(appointment.Start, appointment.End, customerList, employeeList, appointment.Subject, appointment, () =>
BeWoUtils.CreateZeiterfassung(appointment.Start, appointment.End, customerList, employeeList, appointment.Subject, appointment, serviceRecords =>
{
try
{
@@ -1874,12 +1872,13 @@ namespace BeWo.Scheduler.View
IgnoreChangeEvents = true;
var schedulerAppointment = (SchedulerAppointmentVM) appointment.GetSourceObject(Scheduler.GetCoreStorage());
schedulerAppointment?.ServiceRecordList.AddRange(serviceRecords);
var appointmentOid = schedulerAppointment?.CommitToDataContract().SchedulerAppointmentOid;
if(appointmentOid.HasValue)
{
appointment.CF_HasServiceRecordEntry(true);
appointment.CF_ServiceRecordList(serviceRecords);
ViewModel.ActiveAppointmentViewModel.SaveAppointments(Scheduler, new List<Appointment> {appointment});
@@ -1895,18 +1894,17 @@ namespace BeWo.Scheduler.View
var apt = appointment.RecurrencePattern.CreateException(AppointmentType.ChangedOccurrence, appointment.RecurrenceIndex);
apt.Duration = appointment.Duration;
apt.End = apt.Start.Add(appointment.Duration);
apt.Subject = appointment.Subject;
apt.Location = appointment.Location;
apt.Duration = appointment.Duration;
apt.End = apt.Start.Add(appointment.Duration);
apt.Subject = appointment.Subject;
apt.Location = appointment.Location;
apt.Description = appointment.Description;
Scheduler.Storage.AppointmentStorage.CreateCustomFields(apt);
apt.CustomFields[nameof(CustomFieldStorage)] = appointment.CustomFields[nameof(CustomFieldStorage)];
apt.CF_HasServiceRecordEntry(true);
appointment.CF_ServiceRecordList(serviceRecords);
ViewModel.ActiveAppointmentViewModel.InsertAppointments(Scheduler, new List<Appointment> {apt});

View File

@@ -118,6 +118,7 @@ namespace BeWo.Scheduler.ViewModel
AbsenceTimeOid = pAppointment.AbsenceTimeOid;
IsCustomerAbsenceTime = pAppointment.IsCustomerAbsenceTime;
ServiceRecordList = pAppointment.ServiceRecordList;
}
public CustomFieldStorage(SchedulerAppointmentDC pAppointment)
@@ -183,6 +184,8 @@ namespace BeWo.Scheduler.ViewModel
public Visibility ToolTipZusageVisibility => IsTask ? Visibility.Collapsed : Visibility.Visible;
public bool HasServiceRecordEntry { get; set; }
public List<ServiceRecordDC> ServiceRecordList { get; set; } = new List<ServiceRecordDC>();
}
public class InternalInfo

View File

@@ -64,6 +64,7 @@ namespace BeWo.Scheduler.ViewModel
private bool _IsArchived;
private long? _AbsenceTimeOid;
private bool _IsCustomerAbsenceTime;
private List<ServiceRecordDC> _ServiceRecordList;
public bool HasServiceRecordEntry
@@ -119,19 +120,19 @@ namespace BeWo.Scheduler.ViewModel
var customFieldStorage = (CustomFieldStorage) value[nameof(CustomFieldStorage)];
EmployeeList = customFieldStorage.EmployeeList;
CustomerList = customFieldStorage.CustomerList;
ResourceList = customFieldStorage.ResourceList;
Originator = customFieldStorage.Originator;
IsPrivate = customFieldStorage.IsPrivate;
IsTask = customFieldStorage.IsTask;
DueDate = customFieldStorage.DueDate;
TaskDescription = customFieldStorage.TaskDescription;
CompletedDate = customFieldStorage.CompletedDate;
CompletedNotice = customFieldStorage.CompletedNotice;
CompletedUser = customFieldStorage.CompletedUser;
SupportConceptList = customFieldStorage.SupportConceptList;
AbsenceTimeOid = customFieldStorage.AbsenceTimeOid;
EmployeeList = customFieldStorage.EmployeeList;
CustomerList = customFieldStorage.CustomerList;
ResourceList = customFieldStorage.ResourceList;
Originator = customFieldStorage.Originator;
IsPrivate = customFieldStorage.IsPrivate;
IsTask = customFieldStorage.IsTask;
DueDate = customFieldStorage.DueDate;
TaskDescription = customFieldStorage.TaskDescription;
CompletedDate = customFieldStorage.CompletedDate;
CompletedNotice = customFieldStorage.CompletedNotice;
CompletedUser = customFieldStorage.CompletedUser;
SupportConceptList = customFieldStorage.SupportConceptList;
AbsenceTimeOid = customFieldStorage.AbsenceTimeOid;
IsCustomerAbsenceTime = customFieldStorage.IsCustomerAbsenceTime;
}
}
@@ -620,16 +621,16 @@ namespace BeWo.Scheduler.ViewModel
// Wird für Abwesenheiten genutzt
public SchedulerAppointmentVM(bool pAllDay, string pSubject, DateTime pStart, DateTime pEnd, CompactEmployeeDC pOriginator, DateTime? absenceTimeStart, DateTime? absenceTimeEnd, long absenceTimeOid, bool isCustomerAbsenceTime)
{
_AllDay = pAllDay;
_Subject = pSubject;
_Start = pStart;
_End = pEnd;
_AllDay = pAllDay;
_Subject = pSubject;
_Start = pStart;
_End = pEnd;
_Originator = pOriginator;
AbsenceTimeStart = absenceTimeStart;
AbsenceTimeEnd = absenceTimeEnd;
IsAbsenceTime = true;
AbsenceTimeOid = absenceTimeOid;
AbsenceTimeEnd = absenceTimeEnd;
IsAbsenceTime = true;
AbsenceTimeOid = absenceTimeOid;
IsCustomerAbsenceTime = isCustomerAbsenceTime;
@@ -663,10 +664,11 @@ namespace BeWo.Scheduler.ViewModel
_IsTask = pDataContract.IsTask;
_TaskDescription = pDataContract.TaskDescription;
_CompletedNotice = pDataContract.CompletedNotice;
_CompletedUser = pDataContract.CompletedUser;
_CompletedUser = pDataContract.CompletedUser;
_CompletedDate = pDataContract.CompletedDate;
_SupportConceptList = pDataContract.SupportConceptList ?? new List<CompactSupportConceptDC>();
_HasServiceRecordEntry = pDataContract.HasServiceRecordEntry;
_ServiceRecordList = pDataContract.ServiceRecordList ?? new List<ServiceRecordDC>();
_IsArchived = pDataContract.ActivationType == ActivationTypeId.Archived;
CanBeEdited = pDataContract.CanBeEdited;
@@ -698,11 +700,12 @@ namespace BeWo.Scheduler.ViewModel
pDataContract.IsTask = _IsTask;
pDataContract.TaskDescription = _TaskDescription;
pDataContract.CompletedNotice = _CompletedNotice;
pDataContract.CompletedUser = _CompletedUser;
pDataContract.CompletedUser = _CompletedUser;
pDataContract.CompletedDate = _CompletedDate;
pDataContract.SupportConceptList = _SupportConceptList;
pDataContract.HasServiceRecordEntry = _HasServiceRecordEntry;
pDataContract.ActivationType = _IsArchived ? ActivationTypeId.Archived : ActivationTypeId.Active;
pDataContract.ServiceRecordList = _ServiceRecordList;
if(_DueDate.HasValue && _DueTime.HasValue)
{
@@ -811,5 +814,28 @@ namespace BeWo.Scheduler.ViewModel
}
public long? LabelKey { get; set; }
}
public List<ServiceRecordDC> ServiceRecordList
{
get => _ServiceRecordList ?? (ServiceRecordList = new List<ServiceRecordDC>());
set
{
if(!AreDifferent(_ServiceRecordList, value))
{
return;
}
_ServiceRecordList = value;
if(IsAbsenceTime)
{
return;
}
StoreDirtyInformation(AreDifferent(DataContract.ServiceRecordList, value), nameof(ServiceRecordList));
FirePropertyChanged(nameof(ServiceRecordList));
}
}
}
}

View File

@@ -63,7 +63,7 @@
</Grid.RowDefinitions>
<!--<ComboBox x:Name="customerComboBox" IsSynchronizedWithCurrentItem="True" AlternationCount="-1" ItemTemplate="{DynamicResource CustomerComboBoxItemTemplate}" SelectionChanged="customerComboBox_SelectionChanged" Height="62" ItemsPanel="{DynamicResource CustomerComboBoxItemsPanelTemplate}" Background="{DynamicResource SupportConceptListBrush}" HorizontalContentAlignment="Stretch" Style="{DynamicResource ObjectComboBoxStyle}" />-->
<localViewControls:SingleSupportConceptSelectionControl x:Name="supportConceptSelectionControl"
ItemSelected="supportConceptSelectionControl_ItemSelected" Height="62" VerticalAlignment="Top"
ItemSelected="SupportConceptSelectionControl_ItemSelected" Height="62" VerticalAlignment="Top"
HorizontalContentAlignment="Stretch" />
<!--Grid Grid.Row="1" Margin="0,0,0,0" >
<Grid.ColumnDefinitions>
@@ -89,7 +89,7 @@
</Grid.RowDefinitions>
<Label x:Name="lblEmployee" Grid.Column="0" Grid.Row="0" Content="{t:Translate MitarbeiterSingular}" />
<uc:PopUpEdit IsReadOnly="True" x:Name="popupedit_employee"
DeleteButtonVisibility="Collapsed" PopUpClick="popupedit_employee_PopUpClick"
DeleteButtonVisibility="Collapsed" PopUpClick="PopupEdit_Employee_PopUpClick"
HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Height="23"
Grid.Column="1" Grid.ColumnSpan="1" Grid.Row="0" Margin="3,0,3,3"
PreviewMouseDoubleClick="Popupedit_employee_OnPreviewMouseDoubleClick"

View File

@@ -106,18 +106,22 @@ namespace BeWo.View.Detail.Zeiterfassung
public ServiceRecordListVM ViewModel { get; set; }
public ServiceRecordDC ServiceRecord => _ServiceRecordVM?.CommitToDataContract();
public void InitView(ServiceRecordListVM pListViewModel, ServiceRecordVM pSCViewModel, bool hideCustomerCombo)
{
InitializeComponent();
if (!hideCustomerCombo)
if(!hideCustomerCombo)
{
supportConceptSelectionControl.Loaded += (s, e) => SetSelectedCustomerNode();
combobox_services.SelectionChanged += (s, e) =>
{
if (combobox_services.SelectedIndex == -1)
if(combobox_services.SelectedIndex == -1)
{
combobox_services.SelectedIndex = 0;
}
};
}
else
@@ -126,14 +130,13 @@ namespace BeWo.View.Detail.Zeiterfassung
customerComboColumn.Width = new GridLength(0);
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember))
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherTeamMember))
{
lblEmployee.Visibility = Visibility.Collapsed;
popupedit_employee.Visibility = Visibility.Collapsed;
}
if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees))
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreationForOtherEmployees))
{
employeeSearchView.SearchMode = SearchMode.OnlyTeamMember;
}
@@ -157,12 +160,12 @@ namespace BeWo.View.Detail.Zeiterfassung
DataContext = _ServiceRecordVM;
if (_ServiceRecordVM.Employee != null)
if(_ServiceRecordVM.Employee != null)
{
popupedit_employee.Text = _ServiceRecordVM.Employee.ToString();
}
if (!hideCustomerCombo)
if(!hideCustomerCombo)
{
var node = SupportConceptService.CreateFlatSupportConceptItem(pSCViewModel.SupportConcept, pSCViewModel.CostBearer);
@@ -172,25 +175,17 @@ namespace BeWo.View.Detail.Zeiterfassung
SetSearchText(node.CustomerName);
}
if (BeWoApp.AppSettings.ShowMarker)
if(BeWoApp.AppSettings.ShowMarker)
{
chkServiceRecordTypeContent.Content = "Marker";
chkServiceRecordTypeContent.Visibility = Visibility.Visible;
}
else
{
if (BeWoApp.Mandator.BeWoClientType == 3)
{
//Köln Ring
chkServiceRecordTypeContent.Visibility = Visibility.Visible;
}
else
{
chkServiceRecordTypeContent.Visibility = Visibility.Collapsed;
}
}
{
//Köln Ring (BeWoClientType 3)
chkServiceRecordTypeContent.Visibility = BeWoApp.Mandator.BeWoClientType == 3 ? Visibility.Visible : Visibility.Collapsed;
}
//pListViewModel.SelectedVMForEditing = clone;
ViewModel = pListViewModel;
Focus();
@@ -206,7 +201,6 @@ namespace BeWo.View.Detail.Zeiterfassung
if(BeWoApp.AppSettings.ShowRtfTextfield)
{
ConfigureRTFDocTypes();
//LoadNoticeInRTFTxte();
}
else
{
@@ -215,11 +209,11 @@ namespace BeWo.View.Detail.Zeiterfassung
IsEndDateVisible(pSCViewModel.ServiceRecordFormat, pSCViewModel.DauerEinheit);
if (!pSCViewModel.EditAllowed)
if(!pSCViewModel.EditAllowed)
{
GridOben.IsEnabled = false;
TextboxNotice.IsEnabled = false;
TextboxNotice.IsEnabled = false;
TextboxNotice2.IsEnabled = false;
TextboxNotice3.IsEnabled = false;
TextboxNotice4.IsEnabled = false;
@@ -228,7 +222,7 @@ namespace BeWo.View.Detail.Zeiterfassung
btnSave.Visibility = Visibility.Hidden;
}
if (_ServiceRecordVM != null)
if(_ServiceRecordVM != null)
{
ExpandCheckedGoals(_ServiceRecordVM.GoalTree);
}
@@ -239,42 +233,48 @@ namespace BeWo.View.Detail.Zeiterfassung
}
}
private void CheckRecursive(List<SupportConceptGoalDC> goalTree, bool wert)
private static void CheckRecursive(List<SupportConceptGoalDC> goalTree, bool wert)
{
if (goalTree != null)
if(goalTree is null)
{
foreach (var goal in goalTree)
{
goal.CheckRecursive = wert;
CheckRecursive(goal.Children, wert);
}
return;
}
foreach(var goal in goalTree)
{
goal.CheckRecursive = wert;
CheckRecursive(goal.Children, wert);
}
}
private void ExpandCheckedGoals(List<SupportConceptGoalDC> goalTree)
private static void ExpandCheckedGoals(List<SupportConceptGoalDC> goalTree)
{
if (goalTree != null)
if(goalTree is null)
{
foreach (var scg in goalTree)
{
if (scg.IsChecked)
{
ExpandParent(scg);
}
return;
}
ExpandCheckedGoals(scg.Children);
foreach(var scg in goalTree)
{
if(scg.IsChecked)
{
ExpandParent(scg);
}
ExpandCheckedGoals(scg.Children);
}
}
private static void ExpandParent(SupportConceptGoalDC scg)
{
if (scg.ParentGoal != null)
if(scg.ParentGoal is null)
{
scg.ParentGoal.IsExpanded = true;
ExpandParent(scg.ParentGoal);
return;
}
scg.ParentGoal.IsExpanded = true;
ExpandParent(scg.ParentGoal);
}
public void SetSearchText(string text)
@@ -307,33 +307,34 @@ namespace BeWo.View.Detail.Zeiterfassung
//{
if (scv == ServiceRecordFormate.ZeiterfassungMitEndDatum) //Settings.IsEndDateVisible)
if(scv == ServiceRecordFormate.ZeiterfassungMitEndDatum) //Settings.IsEndDateVisible)
{
GridMitEnddatum.Visibility = Visibility.Visible;
GridOhneEnddatum.Visibility = Visibility.Collapsed;
//GridMitJahrMonat.Visibility = Visibility.Collapsed;
if (settings.IsZeiterfassungInStdMin || zsd == ZeiterfassungsDauer.Stunden)
if(!settings.IsZeiterfassungInStdMin && zsd != ZeiterfassungsDauer.Stunden)
{
ComboBoxDauerEinheitMitEndDatum.Visibility = Visibility.Visible;
DauerLabelMitEndDatum.SetValue(Grid.ColumnProperty, 0);
DauerLabelMitEndDatum.Content = "Dauer";
SpinEditDurationMitEndDatum.SetValue(Grid.ColumnProperty, 1);
if (zsd == ZeiterfassungsDauer.Stunden)
{
SpinEditDurationMitEndDatum.IsFloatValue = true;
SpinEditDurationMitEndDatum.Mask = "########0.00";
}
else
{
SpinEditDurationMitEndDatum.IsFloatValue = false;
SpinEditDurationMitEndDatum.Mask = "########0";
}
return;
}
ComboBoxDauerEinheitMitEndDatum.Visibility = Visibility.Visible;
DauerLabelMitEndDatum.SetValue(Grid.ColumnProperty, 0);
DauerLabelMitEndDatum.Content = "Dauer";
SpinEditDurationMitEndDatum.SetValue(Grid.ColumnProperty, 1);
if(zsd == ZeiterfassungsDauer.Stunden)
{
SpinEditDurationMitEndDatum.IsFloatValue = true;
SpinEditDurationMitEndDatum.Mask = "########0.00";
}
else
{
SpinEditDurationMitEndDatum.IsFloatValue = false;
SpinEditDurationMitEndDatum.Mask = "########0";
}
}
else
{
@@ -341,60 +342,61 @@ namespace BeWo.View.Detail.Zeiterfassung
GridMitEnddatum.Visibility = Visibility.Collapsed;
//GridMitJahrMonat.Visibility = Visibility.Collapsed;
if (settings.IsZeiterfassungInStdMin || zsd == ZeiterfassungsDauer.Stunden)
if(!settings.IsZeiterfassungInStdMin && zsd != ZeiterfassungsDauer.Stunden)
{
ComboBoxDauerEinheitOhneEndDatum.Visibility = Visibility.Visible;
DauerLabelOhneEndDatum.SetValue(Grid.ColumnProperty, 0);
DauerLabelOhneEndDatum.Content = "Dauer";
SpinEditDurationOhneEndDatum.SetValue(Grid.ColumnProperty, 1);
if (zsd == ZeiterfassungsDauer.Stunden)
{
SpinEditDurationOhneEndDatum.IsFloatValue = true;
SpinEditDurationOhneEndDatum.Mask = "########0.00";
}
else
{
SpinEditDurationOhneEndDatum.IsFloatValue = false;
SpinEditDurationOhneEndDatum.Mask = "########0";
}
return;
}
ComboBoxDauerEinheitOhneEndDatum.Visibility = Visibility.Visible;
DauerLabelOhneEndDatum.SetValue(Grid.ColumnProperty, 0);
DauerLabelOhneEndDatum.Content = "Dauer";
SpinEditDurationOhneEndDatum.SetValue(Grid.ColumnProperty, 1);
if(zsd == ZeiterfassungsDauer.Stunden)
{
SpinEditDurationOhneEndDatum.IsFloatValue = true;
SpinEditDurationOhneEndDatum.Mask = "########0.00";
}
else
{
SpinEditDurationOhneEndDatum.IsFloatValue = false;
SpinEditDurationOhneEndDatum.Mask = "########0";
}
}
//}
}
public bool IsCustomerChangeAllowed()
{
var lAllowed = true;
if (_OriginalNode != null)
{
if (_ServiceRecordVM.Customer != null && _OriginalNode.SupportConceptTreeNodeDC.Customer != null && _ServiceRecordVM.Customer.CustomerOid != _OriginalNode.SupportConceptTreeNodeDC.Customer.CustomerOid)
{
if (MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf Klient {0} umbuchen?", _ServiceRecordVM.Customer.FirstName + " " + _ServiceRecordVM.Customer.LastName), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
else if (_ServiceRecordVM.SupportConcept != null && _OriginalNode.SupportConceptTreeNodeDC.SupportConcept != null && _ServiceRecordVM.SupportConcept.SupportConceptOid != _OriginalNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid)
{
if (MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf einen anderen Hilfeplan umbuchen?"), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
else if (_ServiceRecordVM.CostBearer != null && _OriginalNode.SupportConceptTreeNodeDC.CostBearer != null && _ServiceRecordVM.CostBearer.CostBearerOid != _OriginalNode.SupportConceptTreeNodeDC.CostBearer.CostBearerOid)
{
if (MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf den Kostenträger {0} umbuchen?", _ServiceRecordVM.CostBearer.Name), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
}
if(_OriginalNode is null)
{
return lAllowed;
}
if(_ServiceRecordVM.Customer != null && _OriginalNode.SupportConceptTreeNodeDC.Customer != null && _ServiceRecordVM.Customer.CustomerOid != _OriginalNode.SupportConceptTreeNodeDC.Customer.CustomerOid)
{
if(MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf Klient {0} umbuchen?", _ServiceRecordVM.Customer.FirstName + " " + _ServiceRecordVM.Customer.LastName), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
else if(_ServiceRecordVM.SupportConcept != null && _OriginalNode.SupportConceptTreeNodeDC.SupportConcept != null && _ServiceRecordVM.SupportConcept.SupportConceptOid != _OriginalNode.SupportConceptTreeNodeDC.SupportConcept.SupportConceptOid)
{
if(MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf einen anderen Hilfeplan umbuchen?"), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
else if(_ServiceRecordVM.CostBearer != null && _OriginalNode.SupportConceptTreeNodeDC.CostBearer != null && _ServiceRecordVM.CostBearer.CostBearerOid != _OriginalNode.SupportConceptTreeNodeDC.CostBearer.CostBearerOid)
{
if(MessageBox.Show(Translator.Translate("Möchten Sie diese Leistung wirklich auf den Kostenträger {0} umbuchen?", _ServiceRecordVM.CostBearer.Name), "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
{
lAllowed = false;
}
}
return lAllowed;
}
@@ -476,72 +478,95 @@ namespace BeWo.View.Detail.Zeiterfassung
protected override void Save()
{
if (IsDirty)
if(!IsDirty)
{
//var valid = ServiceFacade.DoOperationsServiceSync(s => s.CheckExistingSettlementInvoices(_OriginalVM.CommitToDataContract()));
return;
}
//var valid = ServiceFacade.DoOperationsServiceSync(s => s.CheckExistingSettlementInvoices(_OriginalVM.CommitToDataContract()));
//if (valid.Contains(ServiceRecordValidationResult.SettlementInvoiceAlreadyExisting))
//if (valid.Contains(ServiceRecordValidationResult.SettlementInvoiceAlreadyExisting))
//{
// MessageBox.Show("Es existiert bereits eine Spitzabrechnung. Um die Änderungen zu berücksichtigen muss gegebenenfalls eine neue Spitzabrechnung erstellt werden.",
// "Speichern", MessageBoxButton.OK, MessageBoxImage.Warning);
// //return;
//}
//ViewModel.SelectedVMForEditing.CopyTo(_OriginalVM);
//if (!_HideCustomers)
// _ServiceRecordVM.ChoosenNode = _SelectedNode;
//if (!_HideCustomers && _ServiceRecordVM.ServiceDescription.Category != null && _ServiceRecordVM.ServiceDescription.Category.IsBillable && _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer != null)
// {
// Calculations calc = Calculations.GetInstance(_ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer.CostBearerID);
// var roundedDuration = calc.GetRoundedDuration(
// _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer.ActualMinuteIntervall,
// _ServiceRecordVM.Duration.Value);
// _ServiceRecordVM.RoundedDuration = roundedDuration;
// }
// else
// {
// _ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration.Value;
// }
//if (BeWoApp.AppSettings.ShowRtfTextfield)
//{
// SetRTFDaten();
//}
_ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration;
if (_SelectedEmployee != null)
{
_ServiceRecordVM.Employee = _SelectedEmployee;
}
var lDC = _ServiceRecordVM.CommitToDataContract();
if(!_HideCustomers)
{
if(_ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
{
lDC.CostBearer2SupportConceptOid = _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.CostBearer2SupportConceptOid;
}
}
var list = new List<ServiceRecordDC> {lDC};
if(lDC.ServiceRecordOid.HasValue)
{
ServiceFacade.DoOperationsServiceSync(s => s.UpdateServiceRecords(list));
}
else
{
var insertedOids = ServiceFacade.DoOperationsServiceSync(s => s.InsertNewServiceRecords(list));
if(!insertedOids.Any())
{
return;
}
var oid = insertedOids.First();
ServiceRecordDC serviceRecord = null;
ServiceFacade.DoOperationsServiceSync(s => serviceRecord = s.GetServiceRecordById(oid));
if(!(serviceRecord is null))
{
_ServiceRecordVM = new ServiceRecordVM(serviceRecord, _ServiceRecordVM.Category2Services, _ServiceRecordVM.AllGoalCategories, _ServiceRecordVM.AllGoals);
}
//ServiceFacade.DoOperationsServiceAsync(s => s.GetServiceRecordById(oid), serviceRecord =>
//{
// MessageBox.Show("Es existiert bereits eine Spitzabrechnung. Um die Änderungen zu berücksichtigen muss gegebenenfalls eine neue Spitzabrechnung erstellt werden.",
// "Speichern", MessageBoxButton.OK, MessageBoxImage.Warning);
// //return;
//}
//ViewModel.SelectedVMForEditing.CopyTo(_OriginalVM);
//if (!_HideCustomers)
// _ServiceRecordVM.ChoosenNode = _SelectedNode;
//if (!_HideCustomers && _ServiceRecordVM.ServiceDescription.Category != null && _ServiceRecordVM.ServiceDescription.Category.IsBillable && _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer != null)
// {
// Calculations calc = Calculations.GetInstance(_ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer.CostBearerID);
// var roundedDuration = calc.GetRoundedDuration(
// _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.CostBearer.ActualMinuteIntervall,
// _ServiceRecordVM.Duration.Value);
// _ServiceRecordVM.RoundedDuration = roundedDuration;
// }
// else
// {
// _ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration.Value;
// }
//if (BeWoApp.AppSettings.ShowRtfTextfield)
//{
// SetRTFDaten();
//}
_ServiceRecordVM.RoundedDuration = _ServiceRecordVM.Duration;
if (_SelectedEmployee != null)
{
_ServiceRecordVM.Employee = _SelectedEmployee;
}
var lDC = _ServiceRecordVM.CommitToDataContract();
if (!_HideCustomers)
{
if (_ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC != null)
{
lDC.CostBearer2SupportConceptOid = _ServiceRecordVM.ChoosenNode.SupportConceptTreeNodeDC.SupportConceptCostBearerRelDC.CostBearer2SupportConceptOid;
}
}
var list = new List<ServiceRecordDC> {lDC};
if (lDC.ServiceRecordOid.HasValue)
{
ServiceFacade.DoOperationsServiceSync(s => s.UpdateServiceRecords(list));
}
else
{
ServiceFacade.DoOperationsServiceSync(s => s.InsertNewServiceRecords(list));
}
// this.Dispatch(() =>
// {
// _ServiceRecordVM = new ServiceRecordVM(serviceRecord, _ServiceRecordVM.Category2Services, _ServiceRecordVM.AllGoalCategories, _ServiceRecordVM.AllGoals);
// });
//});
}
}
@@ -580,7 +605,7 @@ namespace BeWo.View.Detail.Zeiterfassung
//ViewModel.SelectedVMForEditing.ChoosenNode = _SelectedNode;
}
private void supportConceptSelectionControl_ItemSelected(object sender, EventArgs<FlatSupportConceptTreeNodeDC> e)
private void SupportConceptSelectionControl_ItemSelected(object sender, EventArgs<FlatSupportConceptTreeNodeDC> e)
{
if (!_HideCustomers)
{
@@ -590,7 +615,7 @@ namespace BeWo.View.Detail.Zeiterfassung
}
}
private void popupedit_employee_PopUpClick(object sender, RoutedEventArgs e)
private void PopupEdit_Employee_PopUpClick(object sender, RoutedEventArgs e)
{
popup_employee.IsOpen = true;
}

View File

@@ -91,7 +91,7 @@ namespace BeWo.View.Detail.Zeiterfassung
}
}
private ServiceRecordListVM ViewModel { get; set; }
private ServiceRecordListVM _ViewModel;
public void InitView(ServiceRecordListVM pListViewModel, ServiceRecordVM pSelectedViewModel, ServiceRecordGroupDC group)
{
@@ -117,7 +117,7 @@ namespace BeWo.View.Detail.Zeiterfassung
DataContext = _ServiceRecordVM;
ViewModel = pListViewModel;
_ViewModel = pListViewModel;
numerictb_distance.Visibility = BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
lblDistance.Visibility = BeWoApp.AppSettings.ShowDistanceFields ? Visibility.Visible : Visibility.Collapsed;
@@ -172,7 +172,7 @@ namespace BeWo.View.Detail.Zeiterfassung
public bool IsCustomerChangeAllowed()
{
// FlatSupportConceptTreeNodeDC selectedNode = ViewModel.SelectedVMForEditing.ChoosenNode;
// FlatSupportConceptTreeNodeDC selectedNode = _ViewModel.SelectedVMForEditing.ChoosenNode;
bool lAllowed = true;
// if (_OriginalVM.Customer != null && selectedNode.SupportConceptTreeNodeDC.Customer != null &&
@@ -228,7 +228,7 @@ namespace BeWo.View.Detail.Zeiterfassung
var vm = SupportConceptService.CreateFlatSupportConceptItem(sc, null);
var copyVm = _ServiceRecordVM.Clone();
copyVm.DataContract.ServiceRecordOid = _ServiceRecordVM.DataContract.ServiceRecordOid;
lValid = BeWoUtils.ValidateServiceRecordVM(copyVm, null, vm, false, ViewModel.SelectedEmployee, employeeOids, cb2scOids);
lValid = BeWoUtils.ValidateServiceRecordVM(copyVm, null, vm, false, _ViewModel.SelectedEmployee, employeeOids, cb2scOids);
}
}
@@ -331,170 +331,7 @@ namespace BeWo.View.Detail.Zeiterfassung
protected override void Save()
{
if(!IsDirty)
{
return;
}
UpdateServiceRecordGroup();
var dc = _ServiceRecordVM.CommitToDataContract();
// Runden
var roundDuration = true;
var minuteInterval = 0;
CompactOrganisationDC org = null;
Calculations calc = null;
var cb2scOids = new List<long>();
foreach(var scdc in multiSupportConceptControl.SelectedSupportConcepts)
{
if(scdc.CostBearerList.Count > 0)
{
cb2scOids.Add(scdc.CostBearerList[0].CostBearer2SupportConceptOid);
if(org == null)
{
org = scdc.CostBearerList[0].Organisation;
if(org != null)
{
minuteInterval = org.ActualMinuteIntervall;
}
}
else
{
if(scdc.CostBearerList[0].Organisation == null || !org.Equals(scdc.CostBearerList[0].Organisation))
{
roundDuration = false;
}
}
}
}
decimal duration;
if(_ServiceRecordVM.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr)
{
duration = _ServiceRecordVM.DurationMonthYearGes.Value;
}
else
{
duration = _ServiceRecordVM.Duration;
}
var lRoundedDuration = duration;
var personCount = multiSupportConceptControl.SelectedSupportConcepts.Count;
var employeeCount = multiEmployeeControl.SelectedEmployees.Count;
decimal groupDuration;
decimal roundedDuration;
var gd = ServiceRecordListVM.CalculateGroupDuration(personCount, employeeCount, lRoundedDuration, cb2scOids);
if (gd != null)
{
groupDuration = gd.TotalDuration;
roundedDuration = gd.SingleDuration;
}
else
{
//if (personCount > 2 && (BeWoApp.Tenant == "9893557471") || (BeWoApp.Tenant == "2918696314"))
// //Caritas Frankfurt
//{
// decimal groupRoundedDuration = lRoundedDuration;
// roundedDuration = ((groupRoundedDuration*employeeCount)/personCount) + 10;
// groupDuration = groupRoundedDuration;
//}
//else if (personCount > 1 && BeWoApp.Tenant == "5653806613") //Feid&Kollegen
//{
// decimal groupRoundedDuration = lRoundedDuration;
// roundedDuration = ((groupRoundedDuration*employeeCount)/personCount);
// groupDuration = groupRoundedDuration;
//}
//else
//{
if (minuteInterval > 0 && roundDuration)
{
lRoundedDuration = duration%minuteInterval != 0 ? duration + (minuteInterval - (duration%minuteInterval)) : duration;
}
groupDuration = lRoundedDuration;
roundedDuration = Math.Round(groupDuration/multiSupportConceptControl.SelectedSupportConcepts.Count, 0, MidpointRounding.AwayFromZero);
// if (BeWoApp.Tenant == "0216265667") //Lebenshilfe Hannover
// {
// roundedDuration += 10;
// }
//}
}
_ServiceRecordVM.RoundedDuration = roundedDuration;
_ServiceRecordVM.GroupRoundedDuration = groupDuration;
_Group.Notice = dc.Notice;
_Group.Notice2 = dc.Notice2;
_Group.Notice3 = dc.Notice3;
_Group.Notice4 = dc.Notice4;
_Group.Notice5 = dc.Notice5;
_Group.RoundedDuration = groupDuration;
_Group.StartDate = dc.Start;
_Group.EndDate = dc.End;
_Group.EmployeeCount = multiEmployeeControl.SelectedEmployees.Count;
_Group.CustomerCount = multiSupportConceptControl.SelectedSupportConcepts.Count;
foreach (ServiceRecordDC item in _Group.ServiceRecordList)
{
item.Notice = dc.Notice;
item.Notice2 = dc.Notice2;
item.Notice3 = dc.Notice3;
item.Notice4 = dc.Notice4;
item.Notice5 = dc.Notice5;
item.End = dc.End;
item.Start = dc.Start;
item.RoundedDuration = roundedDuration;
item.DistanceInMeter = dc.DistanceInMeter;
item.DistanceInMeterDecimal = dc.DistanceInMeterDecimal;
item.Betrag = dc.Betrag;
item.ServiceDescription = dc.ServiceDescription;
item.ServiceRecordFormat = dc.ServiceRecordFormat;
item.DurationInStunden = dc.DurationInStunden;
item.ServiceDescription = item.ServiceDescription ?? dc.ServiceDescription;
item.GroupEmployeeCount = _Group.EmployeeCount;
item.GroupPersonCount = _Group.CustomerCount;
item.GroupOid = dc.GroupOid;
item.GroupRoundedDuration = groupDuration;
CompactOrganisationDC i1 = item.CostBearer;
long? i2 = item.CostBearer.CostBearerOid;
CompactSupportConceptDC i3 = item.SupportConcept;
if (item.SupportConcept != null && item.SupportConcept.CostBearerList != null && item.SupportConcept.CostBearerList.Count > 0)
{
CompactCostBearerDC i4 = item.SupportConcept.CostBearerList[0];
long i5 = i4.CostBearerOid;
}
if (item.CostBearer != null && item.CostBearer.CostBearerOid == null && item.SupportConcept != null && item.SupportConcept.CostBearerList.Count > 0)
item.CostBearer.CostBearerOid = item.SupportConcept.CostBearerList[0].CostBearerOid;
}
if (dc.GroupOid.HasValue)
{
ServiceFacade.DoOperationsServiceAsync(s => s.UpdateServiceRecordGroup(_Group), UpdateViewModel);
}
else
{
ServiceFacade.DoOperationsServiceAsync(s => s.InsertNewServiceRecordGroup(_Group), UpdateViewModel);
}
SaveWithCallback(null);
}
private void InitSelectionList()
@@ -681,11 +518,10 @@ namespace BeWo.View.Detail.Zeiterfassung
DispatcherPriority.Normal,
(Action)delegate
{
var deleteList = ViewModel.VMList.Where(item => item.GroupOid != null &&
item.GroupOid.Value == _ServiceRecordVM.GroupOid.Value).ToList();
var deleteList = _ViewModel.VMList.Where(item => item.GroupOid != null && item.GroupOid.Value == _ServiceRecordVM.GroupOid.Value).ToList();
foreach (var item in deleteList)
ViewModel.VMList.Remove(item);
_ViewModel.VMList.Remove(item);
var customerOids = new Dictionary<long, long>();
foreach (var item in newGroupDC.ServiceRecordList)
@@ -694,8 +530,8 @@ namespace BeWo.View.Detail.Zeiterfassung
continue;
// ###AddServiceRecord
var newVM = ViewModel.CreateNewVM(item);
ViewModel.VMList.Add(newVM);
var newVM = _ViewModel.CreateNewVM(item);
_ViewModel.VMList.Add(newVM);
customerOids.Add(item.Customer.CustomerOid, 1);
// if (item.GroupOid != null && item.GroupOid.Value == _OriginalVM.GroupOid.Value)
@@ -716,7 +552,7 @@ namespace BeWo.View.Detail.Zeiterfassung
// }
}
ViewModel.RefreshServiceRecordsForSelectedTreeNode(false);
_ViewModel.RefreshServiceRecordsForSelectedTreeNode(false);
});
}
@@ -738,7 +574,7 @@ namespace BeWo.View.Detail.Zeiterfassung
TabitemRtf4Note.Visibility = Visibility.Visible;
TabitemRtf5Note.Visibility = Visibility.Visible;
int i = ViewModel.AllDocTypes.Count;
int i = _ViewModel.AllDocTypes.Count;
if (i == 0)
{
@@ -751,7 +587,7 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 1)
{
TabitemRtf1Note.Header = ViewModel.AllDocTypes[0].ToString();
TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Visibility = Visibility.Collapsed;
TabitemRtf3Note.Visibility = Visibility.Collapsed;
@@ -760,8 +596,8 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 2)
{
TabitemRtf1Note.Header = ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = ViewModel.AllDocTypes[1].ToString();
TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
TabitemRtf3Note.Visibility = Visibility.Collapsed;
TabitemRtf4Note.Visibility = Visibility.Collapsed;
@@ -769,29 +605,29 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 3)
{
TabitemRtf1Note.Header = ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = ViewModel.AllDocTypes[1].ToString();
TabitemRtf2Note.Header = ViewModel.AllDocTypes[2].ToString();
TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
TabitemRtf2Note.Header = _ViewModel.AllDocTypes[2].ToString();
TabitemRtf4Note.Visibility = Visibility.Collapsed;
TabitemRtf5Note.Visibility = Visibility.Collapsed;
}
else if (i == 4)
{
TabitemRtf1Note.Header = ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = ViewModel.AllDocTypes[1].ToString();
TabitemRtf3Note.Header = ViewModel.AllDocTypes[2].ToString();
TabitemRtf4Note.Header = ViewModel.AllDocTypes[3].ToString();
TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
TabitemRtf5Note.Visibility = Visibility.Collapsed;
}
else if (i == 5)
{
TabitemRtf1Note.Header = ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = ViewModel.AllDocTypes[1].ToString();
TabitemRtf3Note.Header = ViewModel.AllDocTypes[2].ToString();
TabitemRtf4Note.Header = ViewModel.AllDocTypes[3].ToString();
TabitemRtf5Note.Header = ViewModel.AllDocTypes[4].ToString();
TabitemRtf1Note.Header = _ViewModel.AllDocTypes[0].ToString();
TabitemRtf2Note.Header = _ViewModel.AllDocTypes[1].ToString();
TabitemRtf3Note.Header = _ViewModel.AllDocTypes[2].ToString();
TabitemRtf4Note.Header = _ViewModel.AllDocTypes[3].ToString();
TabitemRtf5Note.Header = _ViewModel.AllDocTypes[4].ToString();
}
@@ -803,7 +639,7 @@ namespace BeWo.View.Detail.Zeiterfassung
barManager.Visibility = Visibility.Collapsed;
TabBorder.Background = null;
//Tabs und Tabelle
int i = ViewModel.AllDocTypes.Count;
int i = _ViewModel.AllDocTypes.Count;
if (i == 0)
{
@@ -816,7 +652,7 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 1)
{
TabItem1_Notice.Header = ViewModel.AllDocTypes[0].ToString();
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Visibility = Visibility.Collapsed;
TabItem3_Notice.Visibility = Visibility.Collapsed;
@@ -826,8 +662,8 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 2)
{
TabItem1_Notice.Header = ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = ViewModel.AllDocTypes[1].ToString();
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Visibility = Visibility.Collapsed;
TabItem4_Notice.Visibility = Visibility.Collapsed;
@@ -836,9 +672,9 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 3)
{
TabItem1_Notice.Header = ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = ViewModel.AllDocTypes[2].ToString();
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = _ViewModel.AllDocTypes[2].ToString();
TabItem4_Notice.Visibility = Visibility.Collapsed;
TabItem5_Notice.Visibility = Visibility.Collapsed;
@@ -846,21 +682,21 @@ namespace BeWo.View.Detail.Zeiterfassung
}
else if (i == 4)
{
TabItem1_Notice.Header = ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = ViewModel.AllDocTypes[2].ToString();
TabItem4_Notice.Header = ViewModel.AllDocTypes[3].ToString();
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = _ViewModel.AllDocTypes[2].ToString();
TabItem4_Notice.Header = _ViewModel.AllDocTypes[3].ToString();
TabItem5_Notice.Visibility = Visibility.Collapsed;
}
else if (i == 5)
{
TabItem1_Notice.Header = ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = ViewModel.AllDocTypes[2].ToString();
TabItem4_Notice.Header = ViewModel.AllDocTypes[3].ToString();
TabItem5_Notice.Header = ViewModel.AllDocTypes[4].ToString();
TabItem1_Notice.Header = _ViewModel.AllDocTypes[0].ToString();
TabItem2_Notice.Header = _ViewModel.AllDocTypes[1].ToString();
TabItem3_Notice.Header = _ViewModel.AllDocTypes[2].ToString();
TabItem4_Notice.Header = _ViewModel.AllDocTypes[3].ToString();
TabItem5_Notice.Header = _ViewModel.AllDocTypes[4].ToString();
}
}
@@ -1115,5 +951,193 @@ namespace BeWo.View.Detail.Zeiterfassung
}
}
public void SaveGroupBookingFromAppointmentCallback(Action<List<ServiceRecordDC>> callback)
{
if(!BeWoApp.HasLoggedOnUserRight(this.GetSaveDemands()))
{
MessageBox.Show("Sie besitzen nicht die nötigen Rechte um zu speichern. Bitte wenden Sie sich an den Administrator!", "Autorisierung fehlgeschlagen", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}
var lValid = ValidationTrigger.Validate(this.ValidationOnSaveRootElement);
if(lValid)
{
SaveWithCallback(callback);
}
else
{
MessageBox.Show("Bitte füllen Sie alle Pflichtfelder aus!", "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}
public void SaveWithCallback(Action<List<ServiceRecordDC>> callback)
{
if(!IsDirty)
{
return;
}
UpdateServiceRecordGroup();
var dc = _ServiceRecordVM.CommitToDataContract();
// Runden
var roundDuration = true;
var minuteInterval = 0;
CompactOrganisationDC org = null;
Calculations calc = null;
var cb2scOids = new List<long>();
foreach(var scdc in multiSupportConceptControl.SelectedSupportConcepts)
{
if(scdc.CostBearerList.Count > 0)
{
cb2scOids.Add(scdc.CostBearerList[0].CostBearer2SupportConceptOid);
if(org is null)
{
org = scdc.CostBearerList[0].Organisation;
if(org != null)
{
minuteInterval = org.ActualMinuteIntervall;
}
}
else
{
if(scdc.CostBearerList[0].Organisation is null || !org.Equals(scdc.CostBearerList[0].Organisation))
{
roundDuration = false;
}
}
}
}
decimal duration;
duration = _ServiceRecordVM.ServiceRecordFormat == ServiceRecordFormate.ZeiterfassungMitMonatJahr ? _ServiceRecordVM.DurationMonthYearGes.Value : _ServiceRecordVM.Duration;
var lRoundedDuration = duration;
var personCount = multiSupportConceptControl.SelectedSupportConcepts.Count;
var employeeCount = multiEmployeeControl.SelectedEmployees.Count;
decimal groupDuration;
decimal roundedDuration;
var gd = ServiceRecordListVM.CalculateGroupDuration(personCount, employeeCount, lRoundedDuration, cb2scOids);
if(gd != null)
{
groupDuration = gd.TotalDuration;
roundedDuration = gd.SingleDuration;
}
else
{
//if (personCount > 2 && (BeWoApp.Tenant == "9893557471") || (BeWoApp.Tenant == "2918696314"))
// //Caritas Frankfurt
//{
// decimal groupRoundedDuration = lRoundedDuration;
// roundedDuration = ((groupRoundedDuration*employeeCount)/personCount) + 10;
// groupDuration = groupRoundedDuration;
//}
//else if (personCount > 1 && BeWoApp.Tenant == "5653806613") //Feid&Kollegen
//{
// decimal groupRoundedDuration = lRoundedDuration;
// roundedDuration = ((groupRoundedDuration*employeeCount)/personCount);
// groupDuration = groupRoundedDuration;
//}
//else
//{
if(minuteInterval > 0 && roundDuration)
{
lRoundedDuration = duration % minuteInterval != 0 ? duration + (minuteInterval - (duration % minuteInterval)) : duration;
}
groupDuration = lRoundedDuration;
roundedDuration = Math.Round(groupDuration / multiSupportConceptControl.SelectedSupportConcepts.Count, 0, MidpointRounding.AwayFromZero);
// if (BeWoApp.Tenant == "0216265667") //Lebenshilfe Hannover
// {
// roundedDuration += 10;
// }
//}
}
_ServiceRecordVM.RoundedDuration = roundedDuration;
_ServiceRecordVM.GroupRoundedDuration = groupDuration;
_Group.Notice = dc.Notice;
_Group.Notice2 = dc.Notice2;
_Group.Notice3 = dc.Notice3;
_Group.Notice4 = dc.Notice4;
_Group.Notice5 = dc.Notice5;
_Group.RoundedDuration = groupDuration;
_Group.StartDate = dc.Start;
_Group.EndDate = dc.End;
_Group.EmployeeCount = multiEmployeeControl.SelectedEmployees.Count;
_Group.CustomerCount = multiSupportConceptControl.SelectedSupportConcepts.Count;
foreach(var item in _Group.ServiceRecordList)
{
item.Notice = dc.Notice;
item.Notice2 = dc.Notice2;
item.Notice3 = dc.Notice3;
item.Notice4 = dc.Notice4;
item.Notice5 = dc.Notice5;
item.End = dc.End;
item.Start = dc.Start;
item.RoundedDuration = roundedDuration;
item.DistanceInMeter = dc.DistanceInMeter;
item.DistanceInMeterDecimal = dc.DistanceInMeterDecimal;
item.Betrag = dc.Betrag;
item.ServiceDescription = dc.ServiceDescription;
item.ServiceRecordFormat = dc.ServiceRecordFormat;
item.DurationInStunden = dc.DurationInStunden;
item.ServiceDescription = item.ServiceDescription ?? dc.ServiceDescription;
item.GroupEmployeeCount = _Group.EmployeeCount;
item.GroupPersonCount = _Group.CustomerCount;
item.GroupOid = dc.GroupOid;
item.GroupRoundedDuration = groupDuration;
var i1 = item.CostBearer;
var i2 = item.CostBearer.CostBearerOid;
var i3 = item.SupportConcept;
if(item.SupportConcept?.CostBearerList != null && item.SupportConcept.CostBearerList.Count > 0)
{
var i4 = item.SupportConcept.CostBearerList[0];
var i5 = i4.CostBearerOid;
}
if(item.CostBearer != null && item.CostBearer.CostBearerOid is null && item.SupportConcept != null && item.SupportConcept.CostBearerList.Count > 0)
{
item.CostBearer.CostBearerOid = item.SupportConcept.CostBearerList[0].CostBearerOid;
}
}
if(dc.GroupOid.HasValue)
{
ServiceFacade.DoOperationsServiceAsync(s => s.UpdateServiceRecordGroup(_Group), srg =>
{
UpdateViewModel(srg);
callback?.Invoke(srg.ServiceRecordList);
});
}
else
{
ServiceFacade.DoOperationsServiceAsync(s => s.InsertNewServiceRecordGroup(_Group), srg =>
{
UpdateViewModel(srg);
callback?.Invoke(srg.ServiceRecordList);
});
}
}
}
}

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Windows;
@@ -16,8 +15,6 @@ using BS.Shared.DataContracts;
using BS.Shared.DataContracts.ClientPartials;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using DevExpress.Xpf.Editors.Helpers;
using DevExpress.XtraEditors.Filtering.Templates;
using Brush = System.Windows.Media.Brush;
using Brushes = System.Windows.Media.Brushes;
using Color = System.Windows.Media.Color;
@@ -232,9 +229,8 @@ namespace BeWo.ViewModel
public ServiceRecordVM()
{
DataContract = new ServiceRecordDC {Notice = ""};
if (_Duration == null)
_Duration = 0;
DataContract = new ServiceRecordDC { Notice = "" };
_Duration = 0;
}
public ServiceRecordVM(

View File

@@ -9,7 +9,6 @@ using System.Windows.Threading;
using System.Collections.Generic;
using BeWo.Core.Service;
using BeWo.View;
using BeWo.View.Detail;
using BeWo.ViewModel.ListViewModel;
using BS.Shared;
using BS.Shared.DataContracts;
@@ -105,7 +104,7 @@ namespace BeWo.ownChat
//}
//Konstruktor für Kalender
public ChatDokumentationsView(string notice, CompactCustomerDC _compactCustomer, DateTime firstTime, DateTime lastTime, CompactEmployeeDC employee, Action schedulerCallback = null, Appointment appointment = null)
public ChatDokumentationsView(string notice, CompactCustomerDC _compactCustomer, DateTime firstTime, DateTime lastTime, CompactEmployeeDC employee, Action<List<ServiceRecordDC>> schedulerCallback = null, Appointment appointment = null)
{
InitializeComponent();
@@ -122,36 +121,32 @@ namespace BeWo.ownChat
vm.DispatcherObject = this;
var dc = SupportConceptService.ErstelleServiceRecordDC(firstTime, lastTime, customerCompact, scList);
if (employee != null)
if(employee != null)
{
dc.Employee = employee;
}
//####
long? scOid = null;
long? scOid = null;
long? customerOid = null;
long? cb2scOid = null;
if (customerCompact != null)
long? cb2ScOid = null;
if(customerCompact != null)
{
customerOid = customerCompact.Oid;
}
if (dc.SupportConcept != null)
if(dc.SupportConcept != null)
{
scOid = dc.SupportConcept.SupportConceptOid;
if (dc.SupportConcept.CostBearerRelOids.Count > 0)
if(dc.SupportConcept.CostBearerRelOids.Count > 0)
{
cb2scOid = dc.SupportConcept.CostBearerRelOids[0];
cb2ScOid = dc.SupportConcept.CostBearerRelOids[0];
}
}
if (customerOid != null && scOid != null)
{
var infoDC = ServiceFacade.DoOperationsServiceSync(s => s.GetSupportConceptTreeNodeDetailInfo(customerOid.Value, scOid, cb2scOid));
if(customerOid != null && scOid != null)
{
var infoDC = ServiceFacade.DoOperationsServiceSync(s => s.GetSupportConceptTreeNodeDetailInfo(customerOid.Value, scOid, cb2ScOid));
if (infoDC.SupportConceptGoals != null && infoDC.SupportConceptGoals.Count > 0)
{
@@ -179,18 +174,14 @@ namespace BeWo.ownChat
vm.PrototypeVM.ChangeGoalTree(copyGoalCats, copyGoals);
}
vm.PrototypeVM.UpdateServiceAccountings(infoDC.ServiceAccountings, vm.PrototypeVM.Category2Services, true);
}
else
{
vm.PrototypeVM.UpdateServiceAccountings(null, vm.PrototypeVM.Category2Services, customerCompact != null);
}
//####
//vm.PrototypeVM.ChangeGoalTree()
if(vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
{
var cat1 = vm.PrototypeVM.SortedCategories[0];
@@ -198,9 +189,14 @@ namespace BeWo.ownChat
dc.ServiceDescription = vm.PrototypeVM.Category2Services[cat1][0];
}
_ServiceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals) {Notice = notice};
_ServiceRecord.ATEST = "NEW Service Record";
_ServiceRecord = new ServiceRecordVM(dc, vm.PrototypeVM.Category2Services, vm.PrototypeVM.AllGoalCategories, vm.PrototypeVM.AllGoals)
{
Notice = notice,
ATEST = "NEW Service Record"
};
_ServiceRecord.SetInsertedOn(DateTime.Now);
var hideCustomerCombo = _ServiceRecord.SupportConcept == null;
serviceRecordEditView.InitView(vm, _ServiceRecord, hideCustomerCombo);
@@ -215,7 +211,7 @@ namespace BeWo.ownChat
//GruppenBuchung Konstruktor für Kalender
public ChatDokumentationsView(string notice, DateTime firstTime, DateTime lastTime, List<CompactCustomerDC> _compactCustomer, List<CompactEmployeeDC> _compactEmployee, Action schedulerCallback = null, Appointment appointment = null)
public ChatDokumentationsView(string notice, DateTime firstTime, DateTime lastTime, List<CompactCustomerDC> _compactCustomer, List<CompactEmployeeDC> _compactEmployee, Action<List<ServiceRecordDC>> schedulerCallback = null, Appointment appointment = null)
{
InitializeComponent();
@@ -240,13 +236,13 @@ namespace BeWo.ownChat
var serviceRecordList = new List<ServiceRecordDC>();
foreach (var emp in _compactEmployee)
foreach(var emp in _compactEmployee)
{
foreach (var cus in _compactCustomer)
foreach(var cus in _compactCustomer)
{
var supportConcept = SupportConceptService.HoleHilfeplanAusListe(scList, cus, firstTime, lastTime);
if (supportConcept != null)
if(supportConcept != null)
{
var serviceRecord = new ServiceRecordDC
{
@@ -259,14 +255,13 @@ namespace BeWo.ownChat
GroupPersonCount = _compactCustomer.Count
};
if (BeWoApp.AppSettings.IsEndDateVisible)
if(BeWoApp.AppSettings.IsEndDateVisible)
{
serviceRecord.ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitEndDatum;
}
else if (BeWoApp.AppSettings.IsOnlyYearMonthVisible)
else if(BeWoApp.AppSettings.IsOnlyYearMonthVisible)
{
serviceRecord.ServiceRecordFormat =
ServiceRecordFormate.ZeiterfassungMitMonatJahr;
serviceRecord.ServiceRecordFormat = ServiceRecordFormate.ZeiterfassungMitMonatJahr;
}
else
{
@@ -275,7 +270,7 @@ namespace BeWo.ownChat
serviceRecord.DurationInStunden = ZeiterfassungsDauer.Minuten;
if (serviceRecord.SupportConcept.CostBearerList != null && serviceRecord.SupportConcept.CostBearerList.Count > 0)
if(serviceRecord.SupportConcept.CostBearerList != null && serviceRecord.SupportConcept.CostBearerList.Count > 0)
{
serviceRecord.CostBearer = serviceRecord.SupportConcept.CostBearerList[0].Organisation;
}
@@ -285,7 +280,7 @@ namespace BeWo.ownChat
}
}
if (serviceRecordList.Count == 0)
if(serviceRecordList.Count == 0)
{
MessageBox.Show(
"Es wurden keine laufenden Hilfepläne für die ausgewählten Klienten gefunden. Die Übernahme in die Zeiterfassung ist nicht möglich.",
@@ -296,7 +291,7 @@ namespace BeWo.ownChat
serviceRecordGroup.ServiceRecordList = serviceRecordList;
if (vm.PrototypeVM.SortedCategories != null && vm.PrototypeVM.SortedCategories.Count > 0)
if(vm.PrototypeVM.SortedCategories?.Any() ?? false)
{
var cat1 = vm.PrototypeVM.SortedCategories[0];
@@ -307,14 +302,14 @@ namespace BeWo.ownChat
newView.InitView(vm, _ServiceRecord, serviceRecordGroup);
if (newView.CommandBindings.Count == 0)
if(newView.CommandBindings.Count == 0)
{
newView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Close,
(s, e) =>
{
if (!newView.DoSaveCheck())
if(!newView.DoSaveCheck())
{
return;
}
@@ -328,68 +323,76 @@ namespace BeWo.ownChat
{
var save = newView.IsValid();
if (!save)
if(!save)
{
return;
}
newView.SaveData();
schedulerCallback?.Invoke();
Close();
// ToDo: Hier die ServiceRecords der Gruppenbuchung übergeben. Muss das ändern wegen des asynchronen Aufrufs der Speichermethode
newView.SaveGroupBookingFromAppointmentCallback(srl =>
{
this.Dispatch(() =>
{
schedulerCallback?.Invoke(srl);
Close();
});
});
}));
}
popup_contentChat.Child = newView;
popup_contentChat.Visibility = Visibility.Visible;
})));
}
private void CommandBindingsCloseSave(ServiceRecordEditView newView, Action schedulerCallback)
private void CommandBindingsCloseSave(ServiceRecordEditView newView, Action<List<ServiceRecordDC>> schedulerCallback)
{
if (newView.CommandBindings.Count == 0)
if(newView.CommandBindings.Count != 0)
{
newView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Close,
(s, e) =>
{
if (!newView.DoSaveCheck())
{
return;
}
Close();
}));
newView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Save,
(s, e) =>
{
var isValid = newView.IsValid();
if (!isValid)
{
return;
}
// TODO: Callback einbauen, das den Termin verändert (vom Kalender übergeben)
if(newView.SaveData())
{
schedulerCallback?.Invoke();
}
Close();
}));
return;
}
newView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Close,
(s, e) =>
{
if(!newView.DoSaveCheck())
{
return;
}
Close();
}));
newView.CommandBindings.Add(
new CommandBinding(
ApplicationCommands.Save,
(s, e) =>
{
var isValid = newView.IsValid();
if(!isValid)
{
return;
}
// TODO: Callback einbauen, das den Termin verändert (vom Kalender übergeben)
if(newView.SaveData())
{
var sr = newView.ServiceRecord;
if(sr.ServiceRecordOid.HasValue)
{
schedulerCallback?.Invoke(new List<ServiceRecordDC> { sr });
}
}
Close();
}));
}
private void Popup_Content(UIElement serviceRecordEditView)
{
popup_contentChat.Child = serviceRecordEditView;
popup_contentChat.Child = serviceRecordEditView;
popup_contentChat.Visibility = Visibility.Visible;
}
@@ -404,19 +407,8 @@ namespace BeWo.ownChat
}
}
private DateTime ConvertToDateTimeStart(string startTime)
{
return DateTime.Parse(startTime);
}
private DateTime ConvertToDateTimeEnd(string endTime)
{
return DateTime.Parse(endTime);
}
#region Waitlayer
private WaitLayer2 _waitLayer = null;
private WaitLayer2 _WaitLayer;
public void StartWaiting()
{
@@ -425,15 +417,15 @@ namespace BeWo.ownChat
public void StartWaitingImmediately()
{
if (_waitLayer == null)
if(_WaitLayer is null)
{
_waitLayer = new WaitLayer2();
_WaitLayer = new WaitLayer2();
//Grid.SetColumnSpan(_waitLayer, 3);
//Grid.SetRowSpan(_waitLayer, 3);
DokumentGrid.Children.Add(_waitLayer);// wieder einkommentieren
Panel.SetZIndex(_waitLayer, int.MaxValue);
_waitLayer.RefreshChatUI();
DokumentGrid.Children.Add(_WaitLayer);// wieder einkommentieren
Panel.SetZIndex(_WaitLayer, int.MaxValue);
_WaitLayer.RefreshChatUI();
}
}
@@ -443,15 +435,14 @@ namespace BeWo.ownChat
DispatcherPriority.Background,
(Action)delegate
{
if (_waitLayer != null)
if(_WaitLayer != null)
{
DokumentGrid.Children.Remove(_waitLayer);// wieder einkommentieren
_waitLayer = null;
DokumentGrid.Children.Remove(_WaitLayer);// wieder einkommentieren
_WaitLayer = null;
}
});
}
#endregion
}
}

View File

@@ -17,7 +17,7 @@
<AssemblyName>BeWoPlanerMobil</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<UseIISExpress>false</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
@@ -1591,7 +1591,7 @@
<AutoAssignPort>False</AutoAssignPort>
<DevelopmentServerPort>8808</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:8808/</IISUrl>
<IISUrl>http://localhost/BeWoPlanerMobil</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>true</UseIISExpress>
<UseIISExpress>false</UseIISExpress>
<Use64BitIISExpress>false</Use64BitIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
@@ -28,7 +28,7 @@
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<StartPageUrl>http://localhost/BeWoPlanerMobil</StartPageUrl>
<StartAction>URL</StartAction>
<StartAction>CurrentPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<SilverlightDebugging>False</SilverlightDebugging>
<NativeDebugging>False</NativeDebugging>

View File

@@ -220,7 +220,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedSupportConceptListObject = Model.SupportConceptListObjects.FirstOrDefault(f => f.CostBearer2SupportConceptOid == "-1") ?? Model.SupportConceptListObjects.First();
Model.CostBearer2SupportConceptOid = -1;
Model.HasAnyRatingTypes = OperationsService.GetAllRatingTypes().Any();
Model.HasAnyRatingTypes = AbstractModel.HasRightToRateGoals && OperationsService.GetAllRatingTypes().Any();
}
if(!(Model.CostBearer2SupportConceptOid is null) && Model.CostBearer2SupportConceptOid != -1)
@@ -274,7 +274,7 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public void LoadGoalRatings()
{
if(Model is null)
if(Model is null || !AbstractModel.HasRightToRateGoals)
{
return;
}
@@ -287,7 +287,7 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
public string RateSelectedGoal(long? ratingTypeOid, long? goalOid)
{
if(Model is null || ratingTypeOid is null || goalOid is null)
if(Model is null || ratingTypeOid is null || goalOid is null || !AbstractModel.HasRightToRateGoals)
{
return _LeerzeichenFuerGetMethoden;
}
@@ -383,7 +383,7 @@ namespace BeWoPlanerMobil.Controllers
var supportConcept = Model.SupportConcepts.FirstOrDefault(sc => sc.CostBearerRelations.Any(sc2Cb => sc2Cb.CostBearer2SupportConceptOid.HasValue && sc2Cb.CostBearer2SupportConceptOid.Value.Equals(Model.CostBearer2SupportConceptOid.Value)));
if (supportConcept is null)
if(supportConcept is null)
{
return;
}
@@ -395,7 +395,7 @@ namespace BeWoPlanerMobil.Controllers
var missingParents = selectedGoals.Where(w => w.ParentOid != null && false == selectedGoals.Any(a => a.ValueListEntryOid.Equals(w.ParentOid))).Select(s => s.ParentOid).ToList();
_ParentGoals = new Dictionary<long, ValueListEntryDC>();
foreach (var oid in missingParents)
foreach(var oid in missingParents)
{
if(oid.HasValue)
{
@@ -417,7 +417,7 @@ namespace BeWoPlanerMobil.Controllers
var goalsWithRating = Model.SelectedServiceRecord?.Goals.Where(goal => goal.RatingTypeOid.HasValue).ToList() ?? new List<ValueListEntryDC>();
var ratingTypes = OperationsService.GetRatingTypesByOids(goalsWithRating.Where(goal => goal.RatingTypeOid.HasValue).Select(goal => goal.RatingTypeOid.Value).Distinct().ToList());
foreach (var ziel in ziele.Where(z => z.ValueListEntryOid.HasValue))
foreach(var ziel in ziele.Where(z => z.ValueListEntryOid.HasValue))
{
var treeItem = new GoalTreeItem { Children = new List<GoalTreeItem>(), Header = ziel.DisplayName ?? string.Empty, ParentOid = ziel.ParentOid, ValueListEntryOid = ziel.ValueListEntryOid };
@@ -450,12 +450,14 @@ namespace BeWoPlanerMobil.Controllers
}
var kind = new GoalTreeItem { Children = new List<GoalTreeItem>(), Header = ziel.DisplayName ?? string.Empty, IsLeaf = true, ValueListEntryOid = ziel.ValueListEntryOid, RatingName = ratingName};
if(ziel.ParentOid != null && goalTreeDic.ContainsKey(ziel.ParentOid.Value))
if(ziel.ParentOid is null || !goalTreeDic.ContainsKey(ziel.ParentOid.Value))
{
kind.ParentOid = goalTreeDic[ziel.ParentOid.Value].ParentOid;
goalTreeDic[ziel.ParentOid.Value].Children.Add(kind);
continue;
}
kind.ParentOid = goalTreeDic[ziel.ParentOid.Value].ParentOid;
goalTreeDic[ziel.ParentOid.Value].Children.Add(kind);
}
foreach(var item in goalTreeDic.Values)
@@ -466,33 +468,6 @@ namespace BeWoPlanerMobil.Controllers
}
}
/*
* var hasRatingTypes = Model.GoalRatingTypes.Any();
// TODO: Beim Editieren die Bewertungen laden!
if(hasRatingTypes && Model.IsInEditingMode && Model.SelectedServiceRecord != null)
{
var goalsWithRating = Model.SelectedServiceRecord.Goals.Where(goal => goal.RatingTypeOid.HasValue).ToList();
var ratingTypes = OperationsService.GetRatingTypesByOids(goalsWithRating.Where(goal => goal.RatingTypeOid.HasValue).Select(goal => goal.RatingTypeOid.Value).Distinct().ToList());
goalTree.DoForEach(treeItem =>
{
var goal = goalsWithRating.FirstOrDefault(g => g.ValueListEntryOid == treeItem.ValueListEntryOid);
if(goal != null)
{
var ratingType = ratingTypes.FirstOrDefault(rt => rt.RatingTypeOid == goal.RatingTypeOid);
if(ratingType != null)
{
treeItem.RatingName = ratingType.DisplayName;
}
}
});
}
*/
goalTree = goalTree.OrderBy(o => o.ValueListEntryOid).ToList();
foreach(var item in goalTree)
{

View File

@@ -10,6 +10,7 @@ using BS.Shared.DataContracts;
using BS.Shared.Extensions;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Web.Mvc;
@@ -44,6 +45,7 @@ namespace BeWoPlanerMobil.Controllers
}
}
// Veraltet, wird nicht mehr benutzt.
[Authorize]
public ActionResult Report()
{
@@ -62,6 +64,8 @@ namespace BeWoPlanerMobil.Controllers
return View(Model);
}
// ToDo: Wenn es bereits Einstellungen gibt, den Quittierungsbeleg neuerstellen
[Authorize]
public ActionResult InitReports()
{
@@ -107,6 +111,7 @@ namespace BeWoPlanerMobil.Controllers
Model.AllTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid);
CreateReport(null);
}
catch (Exception e)
{
@@ -116,6 +121,7 @@ namespace BeWoPlanerMobil.Controllers
return View("Report", Model);
}
[Authorize]
[HttpPost]
public ActionResult CreateServiceOverview(FormCollection formCollection)
@@ -130,7 +136,15 @@ namespace BeWoPlanerMobil.Controllers
return RedirectToActionPermanent("Report");
}
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
CreateReport(formCollection);
return RedirectToActionPermanent("Report");
}
[Authorize]
private void CreateReport(NameValueCollection formCollection)
{
if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.KlientenAuswahl)
{
var customerOidString = formCollection == null ? Model.SelectedCustomerOid.ToString() : formCollection[FormCollectionConstants.SelectedCustomerOidKey];
@@ -148,7 +162,7 @@ namespace BeWoPlanerMobil.Controllers
Model.SelectedCustomer = null;
}
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.TeamAuswahl)
if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.TeamAuswahl)
{
var teamOidString = formCollection == null ? Model.SelectedTeamOid.ToString() : formCollection[FormCollectionConstants.SelectedTeamOidKey];
@@ -171,13 +185,13 @@ namespace BeWoPlanerMobil.Controllers
var reportObjects = new List<ServicesOverviewRO>();
var organisationOid = Model.SelectedOrganisationOid ?? 0;
var employeeOid = Model.SelectedEmployeeOid ?? 0;
var organisationOid = Model.SelectedOrganisationOid ?? 0;
var employeeOid = Model.SelectedEmployeeOid ?? 0;
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
var teamOid = Model.SelectedTeamOid;
var customerOid = Model.SelectedCustomerOid ?? 0;
var teamOid = Model.SelectedTeamOid;
var customerOid = Model.SelectedCustomerOid ?? 0;
switch(Model.SelectedFilterItem.FilterEnum)
switch(Model.SelectedFilterItem?.FilterEnum)
{
case QBFilterEnum.AlleKlienten:
reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid);
@@ -191,7 +205,7 @@ namespace BeWoPlanerMobil.Controllers
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)};
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 = GetTeamCustomerOids(teamOid);
@@ -201,7 +215,7 @@ namespace BeWoPlanerMobil.Controllers
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>();
@@ -212,7 +226,7 @@ namespace BeWoPlanerMobil.Controllers
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 =>
{
@@ -220,7 +234,7 @@ namespace BeWoPlanerMobil.Controllers
}));
var hasEmployeeSignature = srOids.All(
a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
@@ -240,12 +254,12 @@ namespace BeWoPlanerMobil.Controllers
Model.ConfirmationReceiptObject = null;
Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
BuildInformationString(),
new List<QuittierungsbelegResult>(),
BuildInformationString(true),
GetTimeSpanString(),
hasEmployeeSignature,
employeeSignatures.ToList(),
BuildInformationString(),
new List<QuittierungsbelegResult>(),
BuildInformationString(true),
GetTimeSpanString(),
hasEmployeeSignature,
employeeSignatures.ToList(),
employeeSignatureState);
reportObjects.DoForEach(reportObject =>
@@ -263,8 +277,8 @@ namespace BeWoPlanerMobil.Controllers
}
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer) &&
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer) &&
serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a));
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
@@ -317,9 +331,9 @@ namespace BeWoPlanerMobil.Controllers
Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.Add(
item: new QuittierungsbelegResult
(
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
quittierungsbelegItems,
reportObject.CustomerOid,
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
quittierungsbelegItems,
reportObject.CustomerOid,
hasCustomerSignature,
customerSignatureOid,
customerSignatureState,
@@ -334,10 +348,15 @@ namespace BeWoPlanerMobil.Controllers
{
TempData["HasWarningMessage"] = true;
}
return RedirectToActionPermanent("Report");
}
/// <summary>
/// Ermittelt den Unterschriftenstatus, der besagt, ob für alle ausgewählten Zeiterfassungseinträge eine Unterschrift existiert.
/// </summary>
/// <param name="oids">Oids der ausgewählten Zeiterfassungseinträge</param>
/// <param name="serviceRecordOidsWithSignature">Oids der ausgewählten Zeiterfassungseinträge mit Unterschrift</param>
/// <param name="signatureType">Typ der Unterschrift; entweder von Mitarbeitern oder von Klienten</param>
/// <returns></returns>
private static SignatureState GetSignatureState(List<long> oids, Dictionary<SignatureType, List<long>> serviceRecordOidsWithSignature, SignatureType signatureType)
{
var hasSignatures = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(signatureType) &&
@@ -354,6 +373,11 @@ namespace BeWoPlanerMobil.Controllers
return hasSomeSignatures ? SignatureState.Some : SignatureState.None;
}
/// <summary>
/// Erzeugt den String, der in der Filterauswahl angezeigt wird.
/// </summary>
/// <param name="isDativ">Ob es sich um ein Dativ-Objekt handelt</param>
/// <returns>Grammatikalisch korrekten Satz für die Filterauswahl</returns>
private string BuildInformationString(bool isDativ = false)
{
var stringBuilder = new StringBuilder(isDativ ? string.Empty : "Einträge für ");
@@ -362,7 +386,7 @@ namespace BeWoPlanerMobil.Controllers
// Einträge für Grube, Clair von Fisher, George bei LWL und face-to-face vom 01.10. bis 31.10.2020
// Unterschrift für x erbrachte Leistungen von
switch(Model.SelectedFilterItem.FilterEnum)
switch(Model.SelectedFilterItem?.FilterEnum)
{
case QBFilterEnum.KlientenAuswahl:
stringBuilder.Append(Model.SelectedCustomer);
@@ -586,6 +610,11 @@ namespace BeWoPlanerMobil.Controllers
return _LeerzeichenFuerGetMethoden;
}
/// <summary>
/// Setzt den Quittierungsbelegsfilter; Alle Klienten, Nur Klienten meines Teams, Meine Klienten, Klient auswählen, oder Team auswählen
/// </summary>
/// <param name="filterEnumString">Der Enum, der dem ausgewählten Quittierungsbelegsfilter entspricht</param>
/// <returns>Das Leerzeichen für Get-Methoden. Ansonsten kann es zu Fehlern im JavaScript kommen.</returns>
[Authorize]
public string SetQbFilterEnum(string filterEnumString)
{
@@ -602,6 +631,16 @@ namespace BeWoPlanerMobil.Controllers
var selectedFilterEnum = (QBFilterEnum) filterEnumValue;
Model.SelectedFilterItem = new QbFilterItem(selectedFilterEnum);
if(selectedFilterEnum == QBFilterEnum.KlientenAuswahl && Model.SelectedCustomer is null)
{
var customer = Model.Customers.FirstOrDefault();
if(!(customer is null))
{
Model.SelectedCustomer = customer;
}
}
}
return _LeerzeichenFuerGetMethoden;
@@ -744,6 +783,10 @@ namespace BeWoPlanerMobil.Controllers
}
}
/// <summary>
/// Lädt die Übersicht über bereits geleistete oder fehlende Unterschriften für den ausgewählten Zeitraum
/// </summary>
/// <returns>Das QuittierungsbelegsResultPartial, das die Liste enthält</returns>
[Authorize]
public ActionResult LoadServiceOverview()
{
@@ -965,6 +1008,10 @@ namespace BeWoPlanerMobil.Controllers
return PartialView("QuittierungsbelegsResultPartial", Model);
}
/// <summary>
/// Erstellt den Zeitraum für die Auswahl
/// </summary>
/// <returns></returns>
private ReportTimeFrame GetReportTimeFrame()
{
var month = DateTime.Today.Month;
@@ -978,30 +1025,71 @@ namespace BeWoPlanerMobil.Controllers
[Authorize]
[HttpPost]
public ActionResult DeleteCustomerSignature()
public ActionResult DeleteCustomerSignature(FormCollection formCollection)
{
if(Model is null)
{
return Logout();
}
// ToDo: Unterschriften laden und gegebenenfalls Parameter einbauen
var info = formCollection["deleteCustomerSignaturesInfo"];
if(AbstractModel.HasRightToDeleteReceiptSignatures)
{
DeleteSignatures(info, true);
}
return RedirectToActionPermanent("InitReports", Model);
}
[Authorize]
[HttpPost]
public ActionResult DeleteEmployeeSignature()
public ActionResult DeleteEmployeeSignature(FormCollection formCollection)
{
if(Model is null)
if(Model?.ConfirmationReceiptObject is null)
{
return Logout();
}
// ToDo: Unterschrift laden und gebenenfalls Parameter einbauen
var info = formCollection["deleteEmployeeSignatureInfo"];
if(AbstractModel.HasRightToDeleteReceiptSignatures)
{
DeleteSignatures(info, false);
}
return RedirectToActionPermanent("InitReports", Model);
}
[Authorize]
private void DeleteSignatures(string guid, bool isCustomerSignature)
{
if(Model is null || !AbstractModel.HasRightToDeleteReceiptSignatures)
{
return;
}
if(!Guid.TryParse(guid, out var identifier))
{
return;
}
var list = Model.ConfirmationReceiptObject.ConfirmationReceiptResultList;
var confirmationReceiptResult = list.FirstOrDefault(obj => obj.Identifier.Equals(identifier));
if(confirmationReceiptResult is null)
{
return;
}
var signatureOids = isCustomerSignature
? confirmationReceiptResult.CustomerSignatureOids
: confirmationReceiptResult.EmployeeSignatureOids;
var signatures = OperationsService.GetConfirmationReceiptSignatures(signatureOids);
OperationsService.DeleteConfirmationReceiptSignatures(signatures.ToDictionary(s => s.ConfirmationReceiptSignatureOid.Value, s => s.ConfirmationReceiptSignatureVersion.Value));
}
}
}

View File

@@ -136,5 +136,9 @@ namespace BeWoPlanerMobil.Models
public static bool HasRightToViewTeams => CheckRight(UserRightType.TeamView_ViewMyTeams) || CheckRight(UserRightType.TeamView_ViewAll);
public static bool HasRightForMultiBooking => CheckRight(UserRightType.ServiceRecord_AllowCreatingMultiBooking);
public static bool HasRightToDeleteReceiptSignatures => CheckRight(UserRightType.ConfirmationReceiptSignatures_Delete);
public static bool HasRightToRateGoals => CheckRight(UserRightType.BewertenInZeiterfassung);
}
}

View File

@@ -119,9 +119,12 @@
<div class="custom-control custom-checkbox goal-card-header float-left" onclick="stopToggle(event)" >
<input type="checkbox" class="custom-control-input" value="@goalTreeItem.ValueListEntryOid" @isCheckedValue id="@goalTreeItem.ValueListEntryOid" onchange="updateSelectedGoals()" />
<label class="custom-control-label" for="@goalTreeItem.ValueListEntryOid">@goalTreeItem.Header</label>
<span id="goal-rating-@goalTreeItem.ValueListEntryOid" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
</span>
@if(AbstractModel.HasRightToRateGoals)
{
<span id="goal-rating-@goalTreeItem.ValueListEntryOid" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
</span>
}
</div>
<div class="btn-group float-right" role="group">
<span class="fas fa-chevron-down text-primary align-middle" id="goal-chevron-@goalTreeItem.ValueListEntryOid"></span>
@@ -143,9 +146,12 @@
<div class="custom-control custom-checkbox goal-text">
<input type="checkbox" class="custom-control-input" id="@goalTreeItem.ValueListEntryOid" @isCheckedValue onchange="updateSelectedGoals()">
<label for="@goalTreeItem.ValueListEntryOid" class="custom-control-label goal-name-label">@goalTreeItem.Header</label>
<span id="goal-rating-@goalTreeItem.ValueListEntryOid" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
</span>
@if(AbstractModel.HasRightToRateGoals)
{
<span id="goal-rating-@goalTreeItem.ValueListEntryOid" class="badge badge-bewo-goal-rating goal-rating-badge ml-1" onclick="showGoalRatingPopup(@goalTreeItem.ValueListEntryOid)">
@(ratingType?.DisplayName ?? goalTreeItem.RatingName)
</span>
}
</div>
}
}

View File

@@ -709,29 +709,33 @@
</div>
<!-- Bewertungspopup für Ziele -->
<div id="goal-rating-popup" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Bewertungsskala</h5>
<button class="close" type="button" data-dismiss="modal" onclick="hideGoalRatingPopup()">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<ul class="list-group">
@foreach(var ratingType in Model.GoalRatingTypes)
{
<li class="list-group-item" id="grt-@ratingType.RatingTypeOid" onclick="rateGoal(@ratingType.RatingTypeOid)">@ratingType.DisplayName</li>
}
</ul>
<input type="hidden" id="goal-to-rate-oid" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="hideGoalRatingPopup()">Zurück</button>
@if(AbstractModel.HasRightToRateGoals)
{
<div id="goal-rating-popup" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Bewertungsskala</h5>
<button class="close" type="button" data-dismiss="modal" onclick="hideGoalRatingPopup()">
<span>&times;</span>
</button>
</div>
<div class="modal-body">
<ul class="list-group">
@foreach(var ratingType in Model.GoalRatingTypes)
{
<li class="list-group-item" id="grt-@ratingType.RatingTypeOid" onclick="rateGoal(@ratingType.RatingTypeOid)">@ratingType.DisplayName</li>
}
</ul>
<input type="hidden" id="goal-to-rate-oid" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="hideGoalRatingPopup()">Zurück</button>
</div>
</div>
</div>
</div>
</div>
}
<input type="hidden" id="has-any-rating-types" value="@Model?.HasAnyRatingTypes ?? False" />

View File

@@ -1,4 +1,5 @@
@using BeWoPlanerMobil.Util.ReportUtils
@using BeWoPlanerMobil.Models
@using BeWoPlanerMobil.Util.ReportUtils
@model BeWoPlanerMobil.Models.ReportModel
<script>
@@ -6,8 +7,9 @@
try {
cardHeaderButtonClick(cardBodyId);
showMessagePopupWithCallback("Unterschriften löschen", "Sind Sie sicher, die Unterschriften von " + customerName + " im Zeitraum von " + 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();
}, false);
} catch(error) {
logError(error);
@@ -18,8 +20,9 @@
try {
cardHeaderButtonClick(cardBodyId);
showMessagePopupWithCallback("Unterschrift löschen", "Sind Sie sicher, die Unterschrift von " + employeeName + " für " + customerName + " im Zeitraum von " + 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();
}, false);
} catch(error) {
logError(error);
@@ -158,7 +161,6 @@
-->
@* Todo: Löschfunktionen implementieren (in Formulare umbauen!) *@
<div class="row">
<div class="col-sm-auto mr-auto">
<div class="input-group">
@@ -171,21 +173,36 @@
</div>
</div>
<div class="col-sm-auto">
@using(Html.BeginForm("DeleteCustomerSignature", "Report", FormMethod.Post, new { id = "delCSigForm-" + result.Identifier }))
{
<input type="hidden" name="deleteCustomerSignaturesInfo" value="@result.Identifier" />
}
@using(Html.BeginForm("DeleteEmployeeSignature", "Report", FormMethod.Post, new { id = "delESigForm-" + result.Identifier }))
{
<input type="hidden" name="deleteEmployeeSignatureInfo" value="@result.Identifier" />
}
<div class="btn-toolbar justify-content-between">
<div class="btn-group pr-1" role="group">
@*<button class="btn btn-danger" type="button" onclick="deleteCustomerSignatures('#collapse-result-@result.Identifier', '@result.Identifier', '@result.CustomerName', '@timeSpan_ssp')">
<span class="fas fa-trash"></span>
</button>*@
<div class="btn-group pr-1 customer-sig-group" role="group">
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.HasCustomerSignature)
{
<button class="btn btn-danger" type="button" onclick="deleteCustomerSignatures('#collapse-result-@result.Identifier', '@result.Identifier', '@result.CustomerName', '@timeSpan_ssp')">
<span class="fas fa-trash"></span>
</button>
}
<button class="btn btn-bewo-customers" type="button" onclick="@methodName">
<span class="fas fa-signature"></span>
<span class="fas fa-@customerIcon" style="color: @customerBtnColor !important"></span>
K
</button>
</div>
<div class="btn-group" role="group">
@*<button class="btn btn-danger" type="button" onclick="deleteEmployeeSignature('#collapse-result-@result.Identifier', '@result.Identifier', '@employeeName', '@result.CustomerName', '@timeSpan_ssp')">
<span class="fas fa-trash"></span>
</button>*@
<div class="btn-group employee-sig-group" role="group">
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.EmployeeSignatureOids.Any())
{
<button class="btn btn-danger" type="button" onclick="deleteEmployeeSignature('#collapse-result-@result.Identifier', '@result.Identifier', '@employeeName', '@result.CustomerName', '@timeSpan_ssp')">
<span class="fas fa-trash"></span>
</button>
}
<button class="btn btn-bewo-employee" type="button" onclick="@employeeMethodName">
<span class="fas fa-signature"></span>
<span class="fas fa-@employeeIcon" style="color: @employeeBtnColor !important"></span>

View File

@@ -4,6 +4,12 @@
ViewBag.Title = "Quittierungsbeleg";
}
<style type="text/css">
.btn-group {
width: 123px;
}
</style>
<script>
function getChangeDateSelectionUrl() {
return "@Url.Action("ChangeDateSelection")";
@@ -158,8 +164,6 @@
logError(error);
}
}
</script>
<div class="container-fluid my-3" id="report-form-container">

View File

@@ -226,6 +226,11 @@ namespace BeWo.Data.Access
return lResult;
}
public void RemoveServiceRecordsFromAppointments(IEnumerable<long> enumerable)
{
throw new NotImplementedException();
}
public List<ServiceRecord> FindServiceRecords(long? pEmployeeOid, long? pCostBearer2SupportConceptOid)
{
var c = CreateCriteria<ServiceRecord>()
@@ -3631,8 +3636,14 @@ namespace BeWo.Data.Access
var recurringAppointmentsCriteria = CreateRecurrenceCriteria(start, end).Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 1));
var recurringAppointments = recurringAppointmentsCriteria.List<SchedulerAppointment>().ToList();
if(recurringAppointments.Count == 0)
{
return resources;
}
recurringAppointments = recurringAppointments.Where(s => s.ResourceList.Any(r => r.Oid.HasValue && resourceOids.Contains(r.Oid.Value))).ToList();
// ToDo: Alle geänderten und gelöschten Termine der Serien laden?
var changedOccurrencesCriteria = CreateCriteriaIsActive<SchedulerAppointment>().Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 3));
var deletedOccurrencesCriteria = CreateCriteria<SchedulerAppointment>().Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 4));
@@ -3649,15 +3660,20 @@ namespace BeWo.Data.Access
deletedOccurrencesCriteria.Add(Restrictions.Not(Restrictions.Eq(nameof(BeWoEntityBase.Oid), selectedAppointmentOid.Value)));
}
var changedOccurrences = new List<SchedulerAppointment>();
var recurrenceIds = string.Empty;
recurringAppointments.DoForEach(appointment => recurrenceIds += $"'{appointment.GetRecurrenceId()}',");
recurrenceIds = recurrenceIds.Trim(',');
var changedCriteria = CreateCriteriaIsActive<SchedulerAppointment>()
.Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 3))
.Add(Expression.Sql($"RecurrenceInfo IS NOT NULL AND RecurrenceInfo LIKE '%Id%' AND SUBSTRING(RecurrenceInfo, LOCATE('Id', RecurrenceInfo) + 4, 36) IN ({recurrenceIds})"));
if(recurrenceIds.Any())
{
var changedCriteria = CreateCriteriaIsActive<SchedulerAppointment>()
.Add(Restrictions.Eq(nameof(SchedulerAppointment.Type), 3))
.Add(Expression.Sql($"RecurrenceInfo IS NOT NULL AND RecurrenceInfo LIKE '%Id%' AND SUBSTRING(RecurrenceInfo, LOCATE('Id', RecurrenceInfo) + 4, 36) IN ({recurrenceIds})"));
var changedOccurrences = changedCriteria.List<SchedulerAppointment>();
changedOccurrences = changedCriteria.List<SchedulerAppointment>().ToList();
}
//var changedOccurrences = changedOccurrencesCriteria.List<SchedulerAppointment>().Where(a => a.ResourceList.Any(r => r.Oid.HasValue && resourceOids.Contains(r.Oid.Value))).ToList();
var deletedOccurrences = deletedOccurrencesCriteria.List<SchedulerAppointment>().Where(a => a.ResourceList.Any(r => r.Oid.HasValue && resourceOids.Contains(r.Oid.Value))).ToList();
@@ -5079,5 +5095,15 @@ namespace BeWo.Data.Access
return result;
}
public List<SchedulerAppointment> LoadAppointmentsWithServiceRecords(List<long> serviceRecordOids)
{
var c = CreateCriteria<SchedulerAppointment>()
.CreateAlias(nameof(SchedulerAppointment.ServiceRecordList), "sr", JoinType.InnerJoin)
.Add(Restrictions.In($"sr.{nameof(BeWoEntityBase.Oid)}", serviceRecordOids.ToArray()))
.SetResultTransformer(new DistinctRootEntityResultTransformer());
return c.List<SchedulerAppointment>().ToList();
}
}
}

View File

@@ -47,6 +47,7 @@ namespace BeWo.Data.Entities
private string _Notice5;
private long? _FormerTaskOid;
private bool _HasServiceRecordEntry;
private IList<ServiceRecord> _ServiceRecordList;
public virtual bool HasServiceRecordEntry
{
@@ -316,5 +317,17 @@ namespace BeWo.Data.Entities
return null;
}
public virtual IList<ServiceRecord> ServiceRecordList
{
get => _ServiceRecordList ?? (_ServiceRecordList = new List<ServiceRecord>());
set
{
if(AreDifferent(_ServiceRecordList, value))
{
_ServiceRecordList = value;
}
}
}
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BeWo.Data.Entities.SchedulerAppointment, BeWo.Data" table="NewSchedulerAppointment">
<class name="BeWo.Data.Entities.SchedulerAppointment, BeWo.Data" table="NewSchedulerAppointment">
<id name="Oid" column="Oid" type="Int64" unsaved-value="null">
<generator class="identity" />
</id>
@@ -24,14 +24,14 @@
<property column="ReminderInfo" type="String" name="ReminderInfo" />
<property column="FormerBookingSequenceOid" type="Int64" name="FormerBookingSequenceOid" />
<property column="IsPrivate" type="Boolean" name="IsPrivate" />
<property column="IsTask" type="Boolean" name="IsTask" />
<property column="TaskDescription" type="String" name="TaskDescription" />
<property column="CompletedDate" type="DateTime" name="CompletedDate" />
<property column="IsTask" type="Boolean" name="IsTask" />
<property column="TaskDescription" type="String" name="TaskDescription" />
<property column="CompletedDate" type="DateTime" name="CompletedDate" />
<property column="CompletedUser" type="String" name="CompletedUser" />
<property column="CompletedNotice" type="String" name="CompletedNotice" />
<property column="DueDate" type="DateTime" name="DueDate" />
<property column="FormerTaskOid" type="Int64" name="FormerTaskOid" />
<property type="Boolean" name="HasServiceRecordEntry" />
<property column="CompletedNotice" type="String" name="CompletedNotice" />
<property column="DueDate" type="DateTime" name="DueDate" />
<property column="FormerTaskOid" type="Int64" name="FormerTaskOid" />
<property type="Boolean" name="HasServiceRecordEntry" />
<many-to-one name="Originator" column="OriginatorOid" class="BeWo.Data.Entities.Employee, BeWo.Data" cascade="none" />
@@ -50,9 +50,14 @@
<many-to-many column="ResourceOid" class="BeWo.Data.Entities.Resource, BeWo.Data" />
</bag>
<bag name="SupportConceptList" table="SupportConcept2NewSchApp" generic="true" cascade="none" batch-size="250">
<key column="NewSchAppOid" />
<many-to-many column="SupportConceptOid" class="BeWo.Data.Entities.SupportConcept, BeWo.Data" />
</bag>
<bag name="SupportConceptList" table="SupportConcept2NewSchApp" generic="true" cascade="none" batch-size="250">
<key column="NewSchAppOid" />
<many-to-many column="SupportConceptOid" class="BeWo.Data.Entities.SupportConcept, BeWo.Data" />
</bag>
<bag name="ServiceRecordList" table="ServiceRecord2NewSchApp" generic="true" cascade="none" batch-size="250">
<key column="NewSchAppOid" />
<many-to-many column="ServiceRecordOid" class="BeWo.Data.Entities.ServiceRecord, BeWo.Data" />
</bag>
</class>
</hibernate-mapping>

View File

@@ -0,0 +1,10 @@
CREATE TABLE `servicerecord2newschapp`(
`Oid` BIGINT NOT NULL AUTO_INCREMENT,
`ServiceRecordOid` BIGINT DEFAULT NULL,
`NewSchAppOid` BIGINT DEFAULT NULL,
PRIMARY KEY (`Oid`),
KEY `KEY_SERVICERECORD` (`ServiceRecordOid`),
KEY `KEY_NEWSCHAPP` (`NewSchAppOid`),
CONSTRAINT `FK_SERVICERECORD` FOREIGN KEY (`ServiceRecordOid`) REFERENCES `servicerecord` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `FK_NEWSCHAPP` FOREIGN KEY (`NewSchAppOid`) REFERENCES `newschedulerappointment` (`Oid`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=latin1;

View File

@@ -772,30 +772,32 @@ namespace BeWo.Report.DefaultReports
// xrLabel18
//
this.xrLabel18.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy,}")});
this.xrLabel18.LocationFloat = new DevExpress.Utils.PointFloat(129.4998F, 227F);
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy}")});
this.xrLabel18.LocationFloat = new DevExpress.Utils.PointFloat(49.3611F, 214.5F);
this.xrLabel18.Name = "xrLabel18";
this.xrLabel18.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel18.SizeF = new System.Drawing.SizeF(100F, 23F);
this.xrLabel18.SizeF = new System.Drawing.SizeF(137.3333F, 35.50002F);
this.xrLabel18.StylePriority.UseTextAlignment = false;
this.xrLabel18.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter;
this.xrLabel18.Visible = false;
//
// xrPictureBox2
//
this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "CustomerSignature")});
this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(230F, 214.5F);
this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(186.6944F, 214.5F);
this.xrPictureBox2.Name = "xrPictureBox2";
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(136.8472F, 35.50002F);
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F);
this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// lblUnterschriftKlient
//
this.lblUnterschriftKlient.Borders = DevExpress.XtraPrinting.BorderSide.Top;
this.lblUnterschriftKlient.Font = new System.Drawing.Font("Arial", 10F);
this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(94.99999F, 250F);
this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(49.3611F, 250F);
this.lblUnterschriftKlient.Name = "lblUnterschriftKlient";
this.lblUnterschriftKlient.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F);
this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(271.8472F, 20F);
this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(336.6944F, 20F);
this.lblUnterschriftKlient.StylePriority.UseBackColor = false;
this.lblUnterschriftKlient.StylePriority.UseBorders = false;
this.lblUnterschriftKlient.StylePriority.UseFont = false;
@@ -1206,13 +1208,16 @@ namespace BeWo.Report.DefaultReports
//
// xrLabel17
//
this.xrLabel17.BackColor = System.Drawing.Color.Transparent;
this.xrLabel17.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeSignatureDate", "{0:dd.MM.yyyy,}")});
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(435.1388F, 227F);
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeSignatureDate", "{0:dd.MM.yyyy}")});
this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(398.31F, 214.5F);
this.xrLabel17.Name = "xrLabel17";
this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel17.SizeF = new System.Drawing.SizeF(100F, 23F);
this.xrLabel17.Visible = false;
this.xrLabel17.SizeF = new System.Drawing.SizeF(136.8289F, 35.50002F);
this.xrLabel17.StylePriority.UseBackColor = false;
this.xrLabel17.StylePriority.UseTextAlignment = false;
this.xrLabel17.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter;
//
// fieldKontaktArt
//

View File

@@ -64,7 +64,6 @@ namespace BeWo.Report.DefaultReports
this.xrLabel17 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel();
this.xrTableCell49 = new DevExpress.XtraReports.UI.XRTableCell();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
this.formattingRuleStartDate = new DevExpress.XtraReports.UI.FormattingRule();
this.ReportHeader = new DevExpress.XtraReports.UI.ReportHeaderBand();
this.xrLabel7 = new DevExpress.XtraReports.UI.XRLabel();
@@ -80,6 +79,10 @@ namespace BeWo.Report.DefaultReports
this.topMarginBand1 = new DevExpress.XtraReports.UI.TopMarginBand();
this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand();
this.GroupFooter1 = new DevExpress.XtraReports.UI.GroupFooterBand();
this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel();
this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrLabel14 = new DevExpress.XtraReports.UI.XRLabel();
this.lblUnterschriftKlient = new DevExpress.XtraReports.UI.XRLabel();
this.lblUnterschriftMitarbeiter = new DevExpress.XtraReports.UI.XRLabel();
this.xrTableAbwesenheiten = new DevExpress.XtraReports.UI.XRTable();
@@ -115,16 +118,13 @@ namespace BeWo.Report.DefaultReports
this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel();
this.xrLabel1 = new DevExpress.XtraReports.UI.XRLabel();
this.fieldKontaktArt = new DevExpress.XtraReports.UI.CalculatedField();
this.xrLabel14 = new DevExpress.XtraReports.UI.XRLabel();
this.xrPictureBox2 = new DevExpress.XtraReports.UI.XRPictureBox();
this.xrLabel16 = new DevExpress.XtraReports.UI.XRLabel();
this.xrPictureBox1 = new DevExpress.XtraReports.UI.XRPictureBox();
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableAbwesenheiten)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
//
// Detail
@@ -573,10 +573,6 @@ namespace BeWo.Report.DefaultReports
this.xrTableCell49.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopCenter;
this.xrTableCell49.Weight = 0.44692737430167606D;
//
// bindingSource1
//
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// formattingRuleStartDate
//
this.formattingRuleStartDate.Condition = "[StartDate2] < [StartDate]";
@@ -772,14 +768,58 @@ namespace BeWo.Report.DefaultReports
this.GroupFooter1.KeepTogether = true;
this.GroupFooter1.Name = "GroupFooter1";
//
// xrLabel16
//
this.xrLabel16.BackColor = System.Drawing.Color.Transparent;
this.xrLabel16.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeSignatureDate", "{0:dd.MM.yyyy}")});
this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(398.31F, 214.5F);
this.xrLabel16.Name = "xrLabel16";
this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel16.SizeF = new System.Drawing.SizeF(136.8289F, 35.50002F);
this.xrLabel16.StylePriority.UseBackColor = false;
this.xrLabel16.StylePriority.UseTextAlignment = false;
this.xrLabel16.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter;
//
// xrPictureBox1
//
this.xrPictureBox1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "EmployeeSignature")});
this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(535.6389F, 214.5F);
this.xrPictureBox1.Name = "xrPictureBox1";
this.xrPictureBox1.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint";
this.xrPictureBox1.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F);
this.xrPictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// xrPictureBox2
//
this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "CustomerSignature")});
this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(186.6944F, 214.5F);
this.xrPictureBox2.Name = "xrPictureBox2";
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F);
this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// xrLabel14
//
this.xrLabel14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy}")});
this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(49.3611F, 214.5F);
this.xrLabel14.Name = "xrLabel14";
this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel14.SizeF = new System.Drawing.SizeF(137.3333F, 35.50008F);
this.xrLabel14.StylePriority.UseTextAlignment = false;
this.xrLabel14.TextAlignment = DevExpress.XtraPrinting.TextAlignment.BottomCenter;
this.xrLabel14.Visible = false;
//
// lblUnterschriftKlient
//
this.lblUnterschriftKlient.Borders = DevExpress.XtraPrinting.BorderSide.Top;
this.lblUnterschriftKlient.Font = new System.Drawing.Font("Arial", 10F);
this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(94.99999F, 250F);
this.lblUnterschriftKlient.LocationFloat = new DevExpress.Utils.PointFloat(49.3611F, 249.9999F);
this.lblUnterschriftKlient.Name = "lblUnterschriftKlient";
this.lblUnterschriftKlient.Padding = new DevExpress.XtraPrinting.PaddingInfo(3, 2, 0, 0, 100F);
this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(271.8472F, 20F);
this.lblUnterschriftKlient.SizeF = new System.Drawing.SizeF(336.6944F, 20F);
this.lblUnterschriftKlient.StylePriority.UseBackColor = false;
this.lblUnterschriftKlient.StylePriority.UseBorders = false;
this.lblUnterschriftKlient.StylePriority.UseFont = false;
@@ -1185,44 +1225,9 @@ namespace BeWo.Report.DefaultReports
this.fieldKontaktArt.FieldType = DevExpress.XtraReports.UI.FieldType.String;
this.fieldKontaktArt.Name = "fieldKontaktArt";
//
// xrLabel14
// bindingSource1
//
this.xrLabel14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "CustomerSignatureDate", "{0:dd.MM.yyyy,}")});
this.xrLabel14.LocationFloat = new DevExpress.Utils.PointFloat(130F, 227F);
this.xrLabel14.Name = "xrLabel14";
this.xrLabel14.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel14.SizeF = new System.Drawing.SizeF(100F, 23F);
this.xrLabel14.Visible = false;
//
// xrPictureBox2
//
this.xrPictureBox2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "CustomerSignature")});
this.xrPictureBox2.LocationFloat = new DevExpress.Utils.PointFloat(230F, 214.5F);
this.xrPictureBox2.Name = "xrPictureBox2";
this.xrPictureBox2.SizeF = new System.Drawing.SizeF(136.8472F, 35.50002F);
this.xrPictureBox2.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
//
// xrLabel16
//
this.xrLabel16.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Text", null, "EmployeeSignatureDate", "{0:dd.MM.yyyy,}")});
this.xrLabel16.LocationFloat = new DevExpress.Utils.PointFloat(435.1388F, 227F);
this.xrLabel16.Name = "xrLabel16";
this.xrLabel16.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F);
this.xrLabel16.SizeF = new System.Drawing.SizeF(100F, 23F);
this.xrLabel16.Visible = false;
//
// xrPictureBox1
//
this.xrPictureBox1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] {
new DevExpress.XtraReports.UI.XRBinding("Image", null, "EmployeeSignature")});
this.xrPictureBox1.LocationFloat = new DevExpress.Utils.PointFloat(535.6389F, 214.5F);
this.xrPictureBox1.Name = "xrPictureBox1";
this.xrPictureBox1.Scripts.OnBeforePrint = "xrPictureBox1_BeforePrint";
this.xrPictureBox1.SizeF = new System.Drawing.SizeF(199.3611F, 35.50002F);
this.xrPictureBox1.Sizing = DevExpress.XtraPrinting.ImageSizeMode.ZoomImage;
this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.ServicesOverviewRO);
//
// Quittierungsbeleg2
//
@@ -1250,10 +1255,10 @@ namespace BeWo.Report.DefaultReports
this.Version = "17.1";
((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableServiceRecords1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrTableAbwesenheiten)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.xrRichText1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this)).EndInit();
}

View File

@@ -14,7 +14,7 @@ namespace BeWo.Service.DCEntityMapper
{
public override SchedulerAppointmentDC MergeWithDC(SchedulerAppointment pEntity, SchedulerAppointmentDC pDataContract)
{
pDataContract.SchedulerAppointmentOid = pEntity.Oid;
pDataContract.SchedulerAppointmentOid = pEntity.Oid;
pDataContract.NewSchedulerAppointmentVersion = pEntity.Version;
pDataContract.AllDay = pEntity.AllDay;
@@ -36,7 +36,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.IsTask = pEntity.IsTask;
pDataContract.TaskDescription = pEntity.TaskDescription;
pDataContract.CompletedNotice = pEntity.CompletedNotice;
pDataContract.CompletedUser = pEntity.CompletedUser;
pDataContract.CompletedUser = pEntity.CompletedUser;
pDataContract.CompletedDate = pEntity.CompletedDate;
pDataContract.DueDate = pEntity.DueDate;
@@ -45,7 +45,7 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.FormerTaskOid = pEntity.FormerTaskOid;
pDataContract.HasServiceRecordEntry = pEntity.HasServiceRecordEntry;
if (pEntity.Originator != null)
if(pEntity.Originator != null)
{
pDataContract.Originator = MapperFactory.CompactEmployeeDC_Employee.MapToNewDC(pEntity.Originator);
}
@@ -54,7 +54,9 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.CanBeEdited = true;
return pDataContract;
pDataContract.ServiceRecordList = MapperFactory.ServiceRecordDC_ServiceRecord.MapToNewDCs(pEntity.ServiceRecordList);
return pDataContract;
}
public override SchedulerAppointment MergeWithEntity(SchedulerAppointmentDC pDataContract, SchedulerAppointment pEntity)
@@ -79,10 +81,11 @@ namespace BeWo.Service.DCEntityMapper
pEntity.CompletedNotice = pDataContract.CompletedNotice;
if (!pEntity.CompletedDate.HasValue && pDataContract.CompletedDate.HasValue)
if(!pEntity.CompletedDate.HasValue && pDataContract.CompletedDate.HasValue)
{
ApplicationUser user = null;
if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
ApplicationUser user;
if(LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null)
{
user = LoggedInUserOperationContextExt.Current.User;
}
@@ -90,17 +93,18 @@ namespace BeWo.Service.DCEntityMapper
{
user = SessionFacade.LoggedInUser;
}
if (user != null && user.Employee != null)
if(user?.Employee != null)
{
pEntity.CompletedUser = user.Employee.Person.FirstNameLastName;
}
}
pEntity.CompletedDate = pDataContract.CompletedDate;
pEntity.DueDate = pDataContract.DueDate;
pEntity.FormerTaskOid = pDataContract.FormerTaskOid;
pEntity.DueDate = pDataContract.DueDate;
pEntity.FormerTaskOid = pDataContract.FormerTaskOid;
if (pDataContract.Originator != null)
if(pDataContract.Originator != null)
{
pEntity.Originator = MapperFactory.CompactEmployeeDC_Employee.MapToNewEntity(pDataContract.Originator);
}
@@ -125,10 +129,15 @@ namespace BeWo.Service.DCEntityMapper
pEntity.ResourceList = DAOFactory.GenericDAO.LoadByIDs<Resource>(pDataContract.ResourceList.Select(r => r.ResourceOid.Value));
}
if (pDataContract.SupportConceptList != null)
if(pDataContract.SupportConceptList != null)
{
pEntity.SupportConceptList = DAOFactory.GenericDAO.LoadByIDs<SupportConcept>(pDataContract.SupportConceptList.Select(s => s.SupportConceptOid));
}
if(!(pDataContract.ServiceRecordList is null))
{
pEntity.ServiceRecordList = DAOFactory.GenericDAO.LoadByIDs<ServiceRecord>(pDataContract.ServiceRecordList.Select(sr => sr.ServiceRecordOid.Value));
}
}
catch (Exception e)
{
@@ -142,7 +151,7 @@ namespace BeWo.Service.DCEntityMapper
protected override bool AreDCAndEntityEqual(SchedulerAppointmentDC pDC, SchedulerAppointment pEntity)
{
if (pDC.SchedulerAppointmentOid == null)
if(pDC.SchedulerAppointmentOid == null)
{
return false;
}

View File

@@ -167,7 +167,7 @@ namespace BeWo.Service.Plugins
//t = "3614251071"; // Pusteblume
//t = "7755740484"; // Sawo
//t = "8275654834"; // Twg Jonathan
t = "6586058528"; // Freundeskreis Suchtkrankenhilfe e.V.
//t = "6586058528"; // Freundeskreis Suchtkrankenhilfe e.V.
//t = "2632162696"; // Hand in Hand (ehemals Pro BeWo Düren)
//t = "6340891020"; // Caritas Ahlen
//t = "3659854106"; // alpha e.V.

View File

@@ -1291,5 +1291,9 @@ namespace BeWo.Service.ServiceContracts
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<ServiceRecordDC> GetCustomerServiceRecordsWithStartEndDate(long pCustomerOid, long costbearer2SupportConceptOid, DateTime start, DateTime ende);
[FaultContract(typeof(BeWoFault))]
[OperationContract]
List<ConfirmationReceiptSignatureDC> GetConfirmationReceiptSignatures(List<long> oids);
}
}

View File

@@ -337,6 +337,13 @@ namespace BeWo.Service.ServiceImplementations
RemoveServiceRecordsFromConfirmationReceiptSignatures(srListToDelete);
// ToDo: ServiceRecord2NewSchApp-Einträge löschen bzw. SchedulerAppointments aktualisieren!
var appointmentsToUpdate = DAOFactory.SearchDAO.LoadAppointmentsWithServiceRecords(srListToDelete.Select(s => s.Oid.Value).ToList());
appointmentsToUpdate.DoForEach(appointment => appointment.ServiceRecordList = appointment.ServiceRecordList.Where(sr => !srListToDelete.Select(s => s.Oid.Value).Contains(sr.Oid.Value)).ToList());
DAOFactory.GenericDAO.Update(appointmentsToUpdate);
DAOFactory.GenericDAO.Delete(srListToDelete);
}
}
@@ -7652,5 +7659,19 @@ namespace BeWo.Service.ServiceImplementations
throw Utils.CreateBeWoFaultException(e);
}
}
public List<ConfirmationReceiptSignatureDC> GetConfirmationReceiptSignatures(List<long> oids)
{
try
{
var signatures = DAOFactory.GenericDAO.GetActiveByIDs<ConfirmationReceiptSignature>(oids);
return MapperFactory.ConfirmationReceiptSignatureDC_ConfirmationReceiptSignature.MapToNewDCs(signatures);
}
catch(Exception e)
{
throw Utils.CreateBeWoFaultException(e);
}
}
}
}

View File

@@ -557,7 +557,9 @@ namespace BS.Shared
ServiceRecord_AllowCreateAfterEmployeeSignature = 171723,
ServiceRecord_AllowEditAfterEmployeeSignature = 171724,
ServiceRecord_AllowDeleteAfterEmployeeSignature = 171725
ServiceRecord_AllowDeleteAfterEmployeeSignature = 171725,
ConfirmationReceiptSignatures_Delete = 50000
}
public enum PersonType

View File

@@ -698,6 +698,9 @@ namespace BS.Shared.Core
},
{
UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature, "Zeiterfassung löschen nach " + Translator.Translate("MitarbeiterPlural") + "unterschrift für Quittierungsbeleg"
},
{
UserRightType.ConfirmationReceiptSignatures_Delete, Translator.Translate("Quittierungsbelegunterschriften löschen")
}
};
#endregion

View File

@@ -153,6 +153,9 @@ namespace BS.Shared.DataContracts
[DataMember]
public bool CanBeEdited { get; set; } = true;
[DataMember]
public List<ServiceRecordDC> ServiceRecordList { get; set; }
public override bool Equals(object obj)
{
if (!(obj is SchedulerAppointmentDC schedulerAppointmentDC))
@@ -160,7 +163,7 @@ namespace BS.Shared.DataContracts
return false;
}
if (SchedulerAppointmentOid == null && schedulerAppointmentDC.SchedulerAppointmentOid == null)
if (SchedulerAppointmentOid is null && schedulerAppointmentDC.SchedulerAppointmentOid is null)
{
return GetHashCode() == schedulerAppointmentDC.GetHashCode();
}
@@ -174,7 +177,8 @@ namespace BS.Shared.DataContracts
EmployeeList.SequenceEqual(schedulerAppointmentDC.EmployeeList) &&
ResourceList.SequenceEqual(schedulerAppointmentDC.ResourceList) &&
CustomerList.SequenceEqual(schedulerAppointmentDC.CustomerList) &&
SupportConceptList.SequenceEqual(schedulerAppointmentDC.SupportConceptList);
ServiceRecordList.SequenceEqual(schedulerAppointmentDC.ServiceRecordList) &&
SupportConceptList.SequenceEqual(schedulerAppointmentDC.SupportConceptList);
return value;
}