From 70126f8a20a8438b09493b9eab2b9845e295224c Mon Sep 17 00:00:00 2001 From: Marcel Hirschle Date: Tue, 12 Oct 2021 16:00:17 +0200 Subject: [PATCH] =?UTF-8?q?MH:=20Viel=20rund=20um=20Dienstplanung=20+=20ne?= =?UTF-8?q?ue=20Methode=20f=C3=BCr=20MitarbeiterstundenkontoBerechnung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BeWo/ServiceProxy/Generated.cs | 54 +- BeWo/View/Controls/DPCtrlDay.cs | 65 ++- BeWo/View/Controls/DPCtrlDienstTooltip.xaml | 28 +- .../View/Controls/DPCtrlDienstTooltip.xaml.cs | 38 +- BeWo/View/Controls/DPCtrlUrlaubKrankheit.cs | 2 +- BeWo/View/Controls/DienstplanerControl.xaml | 19 +- BeWo/View/Detail/DienstView.xaml | 21 +- BeWo/View/Detail/DienstView.xaml.cs | 75 +++ .../Detail/Report/DienstplanerView.xaml.cs | 545 ++++++++++++------ BeWo/ViewModel/DienstInfoVM.cs | 16 + BeWo/ViewModel/ListViewModel/DienstListVM.cs | 24 + BeWo/ViewModel/VMFactory.cs | 2 +- Data/Access/SearchDAO.cs | 11 +- Data/Entities/DienstInfo.cs | 15 + Data/ICF/ICFDAO.cs | 8 +- Data/Mappings/DienstInfo.hbm.xml | 1 + Model/Change_2021_09_28_DienstInfo.txt | 2 + Report/DefaultReportCreator.cs | 32 +- .../DefaultReports/RosterReport.Designer.cs | 66 ++- Report/DefaultReports/RosterReport.cs | 3 +- .../MitarbeiterstundenkontoBerechnung.cs | 236 +++++++- .../MitarbeiterstundenkontoRO.cs | 1 + Report/ReportObjects/RosterIstRO.cs | 33 +- .../DCEntityMapper/DienstInfoDC_DienstInfo.cs | 8 + .../Dienstplanung/DienstplanungsManager.cs | 170 +++++- Service/Plugins/VacationService.cs | 98 +++- .../ServiceContracts/IOperationsService.cs | 8 +- .../OperationsServiceImp.cs | 89 +-- .../Compact/CompactWohnheimDC.cs | 1 + Shared/DataContracts/DienstInfoDC.cs | 21 +- Shared/DataContracts/DienstplanerRootDC.cs | 6 + Shared/DataContracts/UrlaubsplanerRootDC.cs | 7 - Shared/DataContracts/WohnheimDC.cs | 5 +- 33 files changed, 1241 insertions(+), 469 deletions(-) create mode 100644 Model/Change_2021_09_28_DienstInfo.txt diff --git a/BeWo/ServiceProxy/Generated.cs b/BeWo/ServiceProxy/Generated.cs index 4c45d0bd1..08c5360f9 100644 --- a/BeWo/ServiceProxy/Generated.cs +++ b/BeWo/ServiceProxy/Generated.cs @@ -5034,15 +5034,6 @@ namespace BeWo.ServiceProxy public interface IOperationsService { - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConcept", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptBeWoFaultFau" + - "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetPlatzhalterForSupportConcept(); - - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomer", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetPlatzhalterForCustomer(); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployee", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployeeResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForEmployeeBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List GetPlatzhalterForEmployee(); @@ -5293,7 +5284,7 @@ namespace BeWo.ServiceProxy [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAllDienste", ReplyAction="http://tempuri.org/IOperationsService/GetAllDiensteResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAllDiensteBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetAllDienste(); + System.Collections.Generic.List GetAllDienste(System.Nullable wOid); [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetBemerkungForDienstEintrag", ReplyAction="http://tempuri.org/IOperationsService/GetBemerkungForDienstEintragResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetBemerkungForDienstEintragBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] @@ -5434,11 +5425,6 @@ namespace BeWo.ServiceProxy "ltFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] void DeleteCertainDienstEintragOutOfTable(long dienstEintragOid); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheim", ReplyAction="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheimResponse")] - [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetAbsenceTimeVacationByWohnheimBeWoFaultFa" + - "ult", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] - System.Collections.Generic.List GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month); - [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetServiceRecordsByIds", ReplyAction="http://tempuri.org/IOperationsService/GetServiceRecordsByIdsResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetServiceRecordsByIdsBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] System.Collections.Generic.List GetServiceRecordsByIds(System.Collections.Generic.List serviceRecordOids); @@ -5488,6 +5474,15 @@ namespace BeWo.ServiceProxy [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/InsertTemplateBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] BS.Shared.DataContracts.DokumentvorlageDC InsertTemplate(BS.Shared.DataContracts.DokumentvorlageDC dc); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConcept", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForSupportConceptBeWoFaultFau" + + "lt", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetPlatzhalterForSupportConcept(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomer", ReplyAction="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerResponse")] + [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/GetPlatzhalterForCustomerBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] + System.Collections.Generic.List GetPlatzhalterForCustomer(); + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDC", ReplyAction="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCResponse")] [System.ServiceModel.FaultContractAttribute(typeof(BeWo.ServiceProxy.BeWoFault), Action="http://tempuri.org/IOperationsService/CreateNewChatMessagesDCBeWoFaultFault", Name="BeWoFault", Namespace="http://schemas.datacontract.org/2004/07/BeWo.Service.ServiceContracts")] BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, bool isDeliverd, long teamid, string messageid); @@ -6388,16 +6383,6 @@ namespace BeWo.ServiceProxy { } - public System.Collections.Generic.List GetPlatzhalterForSupportConcept() - { - return base.Channel.GetPlatzhalterForSupportConcept(); - } - - public System.Collections.Generic.List GetPlatzhalterForCustomer() - { - return base.Channel.GetPlatzhalterForCustomer(); - } - public System.Collections.Generic.List GetPlatzhalterForEmployee() { return base.Channel.GetPlatzhalterForEmployee(); @@ -6658,9 +6643,9 @@ namespace BeWo.ServiceProxy return base.Channel.GetSupportConceptCostBearerRelDCsByOids(supportConcept2CostbearerOids); } - public System.Collections.Generic.List GetAllDienste() + public System.Collections.Generic.List GetAllDienste(System.Nullable wOid) { - return base.Channel.GetAllDienste(); + return base.Channel.GetAllDienste(wOid); } public string GetBemerkungForDienstEintrag(long empId, long wohnId, int zeile, System.DateTime date) @@ -6818,11 +6803,6 @@ namespace BeWo.ServiceProxy base.Channel.DeleteCertainDienstEintragOutOfTable(dienstEintragOid); } - public System.Collections.Generic.List GetAbsenceTimeVacationByWohnheim(long wohnId, int year, int month) - { - return base.Channel.GetAbsenceTimeVacationByWohnheim(wohnId, year, month); - } - public System.Collections.Generic.List GetServiceRecordsByIds(System.Collections.Generic.List serviceRecordOids) { return base.Channel.GetServiceRecordsByIds(serviceRecordOids); @@ -6873,6 +6853,16 @@ namespace BeWo.ServiceProxy return base.Channel.InsertTemplate(dc); } + public System.Collections.Generic.List GetPlatzhalterForSupportConcept() + { + return base.Channel.GetPlatzhalterForSupportConcept(); + } + + public System.Collections.Generic.List GetPlatzhalterForCustomer() + { + return base.Channel.GetPlatzhalterForCustomer(); + } + public BS.Shared.DataContracts.ChatMessageDC CreateNewChatMessagesDC(long senderOid, long empfängerOid, string message, bool isDeliverd, long teamid, string messageid) { return base.Channel.CreateNewChatMessagesDC(senderOid, empfängerOid, message, isDeliverd, teamid, messageid); diff --git a/BeWo/View/Controls/DPCtrlDay.cs b/BeWo/View/Controls/DPCtrlDay.cs index 923028dea..d77db1115 100644 --- a/BeWo/View/Controls/DPCtrlDay.cs +++ b/BeWo/View/Controls/DPCtrlDay.cs @@ -33,7 +33,7 @@ namespace BeWo.View.Controls if (c != null && info != null) { - if(info.StatusInformation == null) + if (info.StatusInformation == null) { var dc = info.DienstInfoDC; @@ -43,7 +43,7 @@ namespace BeWo.View.Controls c.Path_Notice.Visibility = info.MarkierungBenoetigt ? Visibility.Visible : Visibility.Collapsed; c.Border = new Thickness(0, 0, Convert.ToDouble(right), Convert.ToDouble(bottom)); - + if (!info.IsInContractRange) { c.Background = Brushes.Gray; @@ -51,11 +51,27 @@ namespace BeWo.View.Controls c.Text = string.Empty; c.ToolTip = "Kein gültiger Arbeitsvertrag"; } - else if (info.Reason != null && !info.IsFeiertag /*&& info.DayOfWeek != DayOfWeek.Saturday && info.DayOfWeek != DayOfWeek.Sunday*/) + else if (info.AbsenceTime != null && info.Feiertag == null) { + string additionToTooltip = ""; + var start = info.AbsenceTime.Start.Value; + var end = info.AbsenceTime.End.Value; + var startArray = start.ToString().Split(' '); + var endArray = end.ToString().Split(' '); + + if (start.Date == end.Date) + { + if (start.TimeOfDay == end.TimeOfDay) + additionToTooltip = " (ganzer Tag)"; + else + additionToTooltip = " (halber Tag)"; + } + else + additionToTooltip = string.Format(" ({0} - {1})", startArray[0], endArray[0]); + c.Foreground = Brushes.Red; - c.Text = $"{info.Reason.Description[0]}"; - c.ToolTip = $"{info.Reason.Description}"; + c.Text = $"{info.AbsenceTime.Reason.Description[0]}"; + c.ToolTip = $"{info.AbsenceTime.Reason.Description}" + additionToTooltip; if (info.DayOfWeek == DayOfWeek.Saturday || info.DayOfWeek == DayOfWeek.Sunday) c.Background = new SolidColorBrush(ColorExtensions.FromHexString("EFEFEF")); @@ -63,14 +79,19 @@ namespace BeWo.View.Controls c.Background = Brushes.White; } - else if (dc != null) + else if (info.OverTime != null) { - var bg = string.IsNullOrEmpty(dc.Farbe) ? Brushes.White : (SolidColorBrush)new BrushConverter().ConvertFrom(dc.Farbe); - var grey = 0.2989 * bg.Color.R + 0.5870 * bg.Color.G + 0.1140 * bg.Color.B; + c.Foreground = Brushes.Red; + c.Text = "ÜS"; + c.ToolTip = (dc == null) ? string.Format("Überstunden:\t{0:0.00}\nAuszahlung:\t{1}\nBemerkung:\t{2}", + info.OverTime.Betrag, info.OverTime.Auszahlungsart.Name, info.OverTime.Notice) : null; - c.Background = bg; - c.Foreground = grey < 70 ? Brushes.White : Brushes.Black; - c.ToolTip = new DPCtrlDienstTooltip(dc, info.Bemerkung, info.Zeiten); + if (info.DayOfWeek == DayOfWeek.Saturday || info.DayOfWeek == DayOfWeek.Sunday) + c.Background = new SolidColorBrush(ColorExtensions.FromHexString("EFEFEF")); + else if (dc != null) + c.Background = (SolidColorBrush)new BrushConverter().ConvertFrom(dc.Farbe); + else + c.Background = Brushes.White; } else { @@ -87,11 +108,20 @@ namespace BeWo.View.Controls c.BorderThickness = new Thickness(0, 0, 0, 0); c.BorderBrush = Brushes.Transparent; } + var bg = string.IsNullOrEmpty(dc.Farbe) ? Brushes.White : (SolidColorBrush)new BrushConverter().ConvertFrom(dc.Farbe); + var grey = 0.2989 * bg.Color.R + 0.5870 * bg.Color.G + 0.1140 * bg.Color.B; + + c.Background = bg; + if (info.OverTime == null && info.AbsenceTime == null) + c.Foreground = grey < 70 ? Brushes.White : Brushes.Black; + else + c.Foreground = Brushes.Red; + + + c.ToolTip = new DPCtrlDienstTooltip(dc, info.Bemerkung, info.Zeiten, info.OverTime, info.AbsenceTime); } else { - if (info.MarkierungBenoetigt) - Debug.WriteLine("Funktioniert falsch"); c.Path_Notice.Visibility = Visibility.Collapsed; c.BorderThickness = new Thickness(0, 0, 0, 0); c.BorderBrush = Brushes.Transparent; @@ -127,10 +157,10 @@ namespace BeWo.View.Controls } } - if (info.IsFeiertag) + if (info.Feiertag != null) { c.Background = Brushes.LightPink; - c.ToolTip = "Gesetzl. Feiertag"; + c.ToolTip = info.Feiertag.Name + " (gesetzl. Feiertag)"; } } })); @@ -185,7 +215,8 @@ namespace BeWo.View.Controls public class DPCtrlDayInformation { public DienstInfoDC DienstInfoDC { get; set; } - public AbsenceReasonDC Reason { get; set; } + public AbsenceTimeDC AbsenceTime { get; set; } + public OvertimeDC OverTime { get; set; } public bool IsInContractRange { get; set; } public bool IsLastRow { get; set; } public bool IsLastColumn { get; set; } @@ -193,7 +224,7 @@ namespace BeWo.View.Controls public StatusInformation StatusInformation { get; set; } public string Bemerkung { get; set; } public string[] Zeiten { get; set; } - public bool IsFeiertag { get; set; } + public FeiertagDC Feiertag { get; set; } public bool MarkierungBenoetigt { get; set; } } diff --git a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml index 8e308b619..27460869e 100644 --- a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml +++ b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml @@ -13,13 +13,20 @@ + + + + + - - - + + + + + @@ -28,10 +35,15 @@ + + + - - - - - + + + + + + + \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs index 6437b70cb..641ce8e7d 100644 --- a/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs +++ b/BeWo/View/Controls/DPCtrlDienstTooltip.xaml.cs @@ -16,7 +16,7 @@ namespace BeWo.View.Controls /// public partial class DPCtrlDienstTooltip : UserControl { - public DPCtrlDienstTooltip(DienstInfoDC dienst, string bemerkung, string[] zeiten) + public DPCtrlDienstTooltip(DienstInfoDC dienst, string bemerkung, string[] zeiten, OvertimeDC overtime, AbsenceTimeDC absence) { InitializeComponent(); @@ -27,6 +27,42 @@ namespace BeWo.View.Controls TxtStart.Text = zeiten[0]; TxtStart.Foreground = dienst.Start.ToString("HH:mm").Equals(zeiten[0]) ? TxtDienst.Foreground : Brushes.CornflowerBlue; TxtBemerkung.Text = bemerkung; + + if (overtime != null) + { + TxtUeberstunden.Text = string.Format("{0:0.00}", overtime.Betrag); + TxtAuszahlungsart.Text = overtime.Auszahlungsart.Name; + + TxtUeberstunden.Visibility = Visibility.Visible; + TxtAuszahlungsart.Visibility = Visibility.Visible; + lblUeberstunden.Visibility = Visibility.Visible; + lblAuszahlungsart.Visibility = Visibility.Visible; + sepUeberstunden.Visibility = Visibility.Visible; + } + if (absence != null) + { + string tooltipString = ""; + var start = absence.Start.Value; + var end = absence.End.Value; + var startArray = start.ToString().Split(' '); + var endArray = end.ToString().Split(' '); + + if (start.Date == end.Date) + { + if (start.TimeOfDay == end.TimeOfDay) + tooltipString = "ganzer Tag"; + else + tooltipString = "halber Tag"; + } + else + tooltipString = string.Format("{0} - {1}", startArray[0], endArray[0]); + + TxtUrlaub.Text = tooltipString; + + lblUrlaub.Visibility = Visibility.Visible; + TxtUrlaub.Visibility = Visibility.Visible; + sepUrlaub.Visibility = Visibility.Visible; + } } } } \ No newline at end of file diff --git a/BeWo/View/Controls/DPCtrlUrlaubKrankheit.cs b/BeWo/View/Controls/DPCtrlUrlaubKrankheit.cs index b7b30fea2..574823e86 100644 --- a/BeWo/View/Controls/DPCtrlUrlaubKrankheit.cs +++ b/BeWo/View/Controls/DPCtrlUrlaubKrankheit.cs @@ -54,7 +54,7 @@ namespace BeWo.View.Controls if(information.Row == 0 && !information.Statuszeile) { - ctrl.Text = string.Format("{0:0}", information.SummeTage); + ctrl.Text = string.Format("{0:0.00}", information.SummeTage); ctrl.ToolTip = "Abwesenheiten an Wochenend- und Feiertagen werden nicht mitgezählt."; } } diff --git a/BeWo/View/Controls/DienstplanerControl.xaml b/BeWo/View/Controls/DienstplanerControl.xaml index 7d4caeba8..e1f8778f3 100644 --- a/BeWo/View/Controls/DienstplanerControl.xaml +++ b/BeWo/View/Controls/DienstplanerControl.xaml @@ -1,15 +1,26 @@  - + + + + + + + + + + + + - + />--> \ No newline at end of file diff --git a/BeWo/View/Detail/DienstView.xaml b/BeWo/View/Detail/DienstView.xaml index a61a17edf..3ecb2be45 100644 --- a/BeWo/View/Detail/DienstView.xaml +++ b/BeWo/View/Detail/DienstView.xaml @@ -46,6 +46,7 @@ + @@ -67,6 +68,8 @@ + + @@ -131,7 +134,19 @@ - +