diff --git a/BeWo/Converter/FilterDCConverter.cs b/BeWo/Converter/FilterDCConverter.cs index 57bab35ce..9d39f725c 100644 --- a/BeWo/Converter/FilterDCConverter.cs +++ b/BeWo/Converter/FilterDCConverter.cs @@ -51,7 +51,7 @@ namespace BeWo.Converter var ret = (values[0] as IEnumerable).Where( dc => { - var filterRelevants = dc.FilterRelevants.ContainsAll(lFilter) && (customFilter == null || customFilter.IsValid(dc)); + var filterRelevants = dc.FilterRelevants != null && dc.FilterRelevants.ContainsAll(lFilter) && (customFilter == null || customFilter.IsValid(dc)); var aktiv = (!showOnlyOnlyDeleted && !showOnlyArchived && dc.ActivationType == ActivationTypeId.Active); var archiviert = ((showOnlyArchived && dc.ActivationType == ActivationTypeId.Archived)); var geloescht = ((!showOnlyArchived && showOnlyOnlyDeleted && dc.ActivationType == ActivationTypeId.Deleted)); diff --git a/BeWo/LoginControl.xaml.cs b/BeWo/LoginControl.xaml.cs index 5f39bb30f..eddfe3407 100644 --- a/BeWo/LoginControl.xaml.cs +++ b/BeWo/LoginControl.xaml.cs @@ -40,6 +40,8 @@ namespace BeWo private String GETSTATUSMESSAGE_URL = "https://support.bewoplaner.de/api/getstate.php?k={0}"; + private String GETNETMESSAGE_URL = "https://support.bewoplaner.de/api/getxmlstate.php?k={0}"; + private bool _IsTechSupport; public bool IsTechSupport { @@ -278,49 +280,66 @@ namespace BeWo return Type.GetType("System.Reflection.ReflectionContext", false) != null; } - private bool CheckStatusMessage(BeWoProfile profile) + private bool CheckStatusMessage(BeWoProfile profile, String url) { - + try { - - String url = String.Format(GETSTATUSMESSAGE_URL, profile.Tenant); using (WebClient client = new WebClient()) { //MessageBox.Show(hostAddress); byte[] response = client.UploadValues(url, "POST", new NameValueCollection()); String message = System.Text.Encoding.UTF8.GetString(response); - + + //zum testen: + //using (var myFile = new StreamReader("C:\\temp\\testxaml.txt", Encoding.Default)) + //{ + // message = myFile.ReadToEnd(); + // myFile.Close(); + //} + if (!String.IsNullOrWhiteSpace(message) && message.Trim().Length > 2) { - message = message.Replace("\\n", "\n"); + String ende = message.Substring(message.Length - 2); + message = message.Replace("\\n", "\n"); + message = message.Substring(0, message.Length - 2); MessageDialog dlg = new MessageDialog(); - - dlg.Message = message.Substring(0, message.Length - 2); + + if (message.Contains("<") && message.Contains(">")) + { + dlg.SetXaml(message); + } + else + { + dlg.Message = message; + } + + + dlg.ShowDialog(); - if (message.EndsWith(";0")) + if (ende.EndsWith(";0")) { return false; } - + } - + } } catch (Exception ex) { //MessageBox.Show(String.Format("Fehler beim Prüfen der Kundennummer: {0}\n\n{1}", ex.Message, ex.StackTrace)); - + } return true; } - - private void ReadProfileList() + + private void ReadProfileList() { if (File.Exists(_ProfilesFilePath)) { @@ -624,12 +643,12 @@ namespace BeWo var profile = profileSelectionComboBox.SelectedItem as BeWoProfile; #if DEBUG - //if (!CheckStatusMessage(profile)) + //if (!CheckStatusMessage(profile, String.Format(GETNETMESSAGE_URL, profile.Tenant))) //{ // return; //} #else - if (!CheckStatusMessage(profile)) + if (!CheckStatusMessage(profile, String.Format(GETSTATUSMESSAGE_URL, profile.Tenant))) { return; } @@ -768,18 +787,32 @@ namespace BeWo if (!string.IsNullOrEmpty(lUserName) && !string.IsNullOrEmpty(lPassword)) { - String tempUsername = lUserName; - try - { - var version = Environment.OSVersion.VersionString; - var clr = Environment.Version.ToString(); - tempUsername = String.Format("{0}//Version={1};CLRVersion={2}", lUserName, version, clr); + String tempUsername = lUserName; + String version = "unbekannt"; + String clr = "unbekannt"; + var bewoVersion = BeWoApp.Version; + + try + { + version = Environment.OSVersion.VersionString; } - catch (Exception) - { - // do nothing - } - + catch (Exception e) + { + version = e.Message; + } + + try + { + clr = Environment.Version.ToString(); + } + catch (Exception e) + { + clr = e.Message; + } + + + tempUsername = String.Format("{0}//Version={1};CLRVersion={2};BeWoVersion={3}", lUserName, version, clr, bewoVersion); + try { ServiceFacade.DoUserServiceAsync(s => diff --git a/BeWo/MainControl.xaml b/BeWo/MainControl.xaml index cc9ceeed3..7756c250b 100644 --- a/BeWo/MainControl.xaml +++ b/BeWo/MainControl.xaml @@ -373,7 +373,7 @@ - + - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BeWo/View/MessageDialog.xaml.cs b/BeWo/View/MessageDialog.xaml.cs index bfecf2458..389534d29 100644 --- a/BeWo/View/MessageDialog.xaml.cs +++ b/BeWo/View/MessageDialog.xaml.cs @@ -1,6 +1,8 @@ using System; using System.Windows; -using System.Windows.Threading; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; namespace BeWo.View { @@ -9,11 +11,61 @@ namespace BeWo.View /// public partial class MessageDialog : Window { - public MessageDialog() + public MessageDialog() { InitializeComponent(); - - + DataContext = this; + + } + + private ICommand openBrowserCommand; + public ICommand OpenBrowserCommand + { + get + { + if (openBrowserCommand == null) + { + openBrowserCommand = new OpenBrowserCommandImpl(); + } + + return openBrowserCommand; + } + } + + public class OpenBrowserCommandImpl : ICommand + { + public bool CanExecute(object parameter) + { + return true; + } + + public event EventHandler CanExecuteChanged; + + public void Execute(object parameter) + { + if (parameter != null) + { + System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(parameter.ToString())); + } + } + } + + public void SetXaml(String xamlCode) + { + try + { + UIElement element = XamlReader.Parse(xamlCode) as UIElement; + if (element != null) + { + txtMessage.Visibility = Visibility.Collapsed; + rootGrid.Children.Add(element); + } + } + catch (Exception e) + { + //ignore + } + } public String Message @@ -26,7 +78,21 @@ namespace BeWo.View private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { //DialogResult = true; - Close(); + Close(); + } + private void OpenBrowserCommand_Executed(object sender, ExecutedRoutedEventArgs e) + { + if (e.OriginalSource is Hyperlink) + { + System.Diagnostics.Process.Start( + new System.Diagnostics.ProcessStartInfo((e.OriginalSource as Hyperlink).NavigateUri.ToString())); + } + } + + private void OpenBrowserCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e) + { + e.CanExecute = true; + e.Handled = true; } } } diff --git a/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs b/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs index 6759fbad6..18cd44951 100644 --- a/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs +++ b/BeWo/View/Report/Auslastung/AuslastungReportView2.xaml.cs @@ -189,7 +189,7 @@ namespace BeWo.View.Report.Auslastung teamOid = _SelectedTeam.TeamOid; } - if (teamOid > 0 && !checkbox_all.IsChecked.Value) + if (teamOid > 0 && !checkbox_all_teams.IsChecked.Value) { sb.Append(teamOid); } diff --git a/BeWo/View/Report/Employee/EmployeeHourReportView.xaml.cs b/BeWo/View/Report/Employee/EmployeeHourReportView.xaml.cs index b403d1aee..d648f74a6 100644 --- a/BeWo/View/Report/Employee/EmployeeHourReportView.xaml.cs +++ b/BeWo/View/Report/Employee/EmployeeHourReportView.xaml.cs @@ -198,7 +198,7 @@ namespace BeWo.View.Report.Employee if (_SelectedTeam != null) teamOid = _SelectedTeam.TeamOid; - if (teamOid > 0 && !checkbox_all.IsChecked.Value) + if (teamOid > 0 && !checkbox_all_teams.IsChecked.Value) { sb.Append(teamOid); } diff --git a/BeWo/ViewModel/UserGroupVM.cs b/BeWo/ViewModel/UserGroupVM.cs index 881ecffe7..073f1ef38 100644 --- a/BeWo/ViewModel/UserGroupVM.cs +++ b/BeWo/ViewModel/UserGroupVM.cs @@ -76,8 +76,11 @@ namespace BeWo.ViewModel { if (!IsResourceRight(r) || BeWoApp.AppSettings.ShowRessources) { - possibleRights.Add(r); - } + if (!IsHiddenRight(r)) + { + possibleRights.Add(r); + } + } } } } @@ -99,6 +102,17 @@ namespace BeWo.ViewModel return false; } + private static bool IsHiddenRight(UserRightType userRightType) + { + if (userRightType == UserRightType.ChatSettings + || userRightType == UserRightType.CustomerTeam_View + || userRightType == UserRightType.CustomerTeam_Create + || userRightType == UserRightType.CustomerTeam_Edit + || userRightType == UserRightType.CustomerTeam_Delete) + return true; + return false; + } + private static bool IsSbdRight(UserRightType userRightType) { if (userRightType == UserRightType.VertretungenView_View) diff --git a/BeWo/ViewModel/WohnheimVM.cs b/BeWo/ViewModel/WohnheimVM.cs index 9718d4d38..67d2877df 100644 --- a/BeWo/ViewModel/WohnheimVM.cs +++ b/BeWo/ViewModel/WohnheimVM.cs @@ -212,50 +212,5 @@ namespace BeWo.ViewModel return pDataContract; } - - - private void CommitContact(string pValue, ContactType pContactType) - { - List lOldContactDCs; - if (DataContract.ContactInformations != null) - { - lOldContactDCs = DataContract.ContactInformations.ToList(); - } - else - { - lOldContactDCs = new List(); - } - - ContactDC lContactDC = null; - try - { - lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType); - } - catch (Exception) - { - // donothing - } - - if (string.IsNullOrEmpty(pValue) && lContactDC != null) - { - lOldContactDCs.Remove(lContactDC); - } - else if (!string.IsNullOrEmpty(pValue)) - { - if (lContactDC == null) - { - lContactDC = new ContactDC - { - ContactType = pContactType - }; - lOldContactDCs.Add(lContactDC); - } - - lContactDC.ContactValue = pValue; - } - - DataContract.ContactInformations = lOldContactDCs; - } - } } diff --git a/Report/ReportObjects/AuslastungBerechnung.cs b/Report/ReportObjects/AuslastungBerechnung.cs index 309c646a0..e480d014a 100644 --- a/Report/ReportObjects/AuslastungBerechnung.cs +++ b/Report/ReportObjects/AuslastungBerechnung.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Text; using BeWo.Report; using BeWo.Data.Entities; using BeWo.Data.Access; @@ -44,6 +45,13 @@ namespace BeWo.Report.ReportObjects { scd.DirectIst /= 60; scd.MittelbarIst /= 60; + scd.IstKw1 /= 60; + scd.IstKw2 /= 60; + scd.IstKw3 /= 60; + scd.IstKw4 /= 60; + scd.IstKw5 /= 60; + scd.IstKw6 /= 60; + empDetail.DirectIst += scd.DirectIst; empDetail.MittelbarIst += scd.MittelbarIst; empDetail.ApprovedHoursPerWeek += scd.ApprovedHoursPerWeek; @@ -95,13 +103,20 @@ namespace BeWo.Report.ReportObjects if (teamDetail.DirectIst + teamDetail.MittelbarIst != 0) teamDetail.RelationDirectToMittelbar = (teamDetail.DirectIst / (teamDetail.DirectIst + teamDetail.MittelbarIst)) * 100; - teamDetail.SupportConceptDetailList.Sort((a, b) => (a.Customer.Person.LastName + ", " + a.Customer.Person.FirstName).CompareTo(b.Customer.Person.LastName + ", " + b.Customer.Person.FirstName)); + teamDetail.SupportConceptDetailList.Sort((a, b) => + { + if (a.Customer == null) + return 1; + if (b.Customer == null) + return -1; + return (a.Customer.Person.LastName + ", " + a.Customer.Person.FirstName).CompareTo( + b.Customer.Person.LastName + ", " + b.Customer.Person.FirstName); + }); } } - public virtual void CreateEmployeeDetails(MitarbeiterauslastungRO ro) { foreach (var empDetail in ro.EmployeeDetailList) @@ -114,14 +129,28 @@ namespace BeWo.Report.ReportObjects { CreateSupportConceptsForCustomer(ro, empDetail); } - - CreateServiceRecordDetails(ro, empDetail); - - empDetail.SupportConceptDetailList.Sort((a, b) => (a.Customer.Person.LastName + ", " + a.Customer.Person.FirstName).CompareTo(b.Customer.Person.LastName + ", " + b.Customer.Person.FirstName)); + if (CreateIst()) + { + CreateServiceRecordDetails(ro, empDetail); + } + empDetail.SupportConceptDetailList.Sort((a, b) => + { + if (a.Customer == null) + return 1; + if (b.Customer == null) + return -1; + return (a.Customer.Person.LastName + ", " + a.Customer.Person.FirstName).CompareTo( + b.Customer.Person.LastName + ", " + b.Customer.Person.FirstName); + }); } } + public virtual bool CreateIst() + { + return false; + } + private void CreateSupportConceptsForCustomer(MitarbeiterauslastungRO ro, MitarbeiterauslastungRO.EmployeeDetail empDetail) { var span = new DateTimeSpan(); @@ -178,6 +207,71 @@ namespace BeWo.Report.ReportObjects empDetail.FLSTotalHoursByContract = contract.WeeklyFLS ?? 0; } + empDetail.AbsenceTimeString = ""; + if (emp.AbsenceTimes != null) + { + var sb = new StringBuilder(); + + var count = 1; + + foreach (var at in emp.AbsenceTimes) + { + if (at.AbsenceSpan != null) + { + bool cont = true; + + if (at.Start != null && at.Start >= ro.ReportEndDate) + { + cont = false; + } + + if (cont && at.End != null && at.End < ro.ReportStartDate) + { + cont = false; + } + + if (cont) + { + if (sb.Length > 0) + { + sb.Append(", "); + } + + if (at.Start.HasValue) + { + + sb.Append(string.Format("{0:00}", at.Start.Value.Day)); + sb.Append("."); + sb.Append(string.Format("{0:00}", at.Start.Value.Month)); + sb.Append("."); + sb.Append(at.Start.Value.Year.ToString().Substring(2)); + + if (at.End.HasValue) + { + sb.Append(" - "); + sb.Append(string.Format("{0:00}", at.End.Value.Day)); + sb.Append("."); + sb.Append(string.Format("{0:00}", at.End.Value.Month)); + sb.Append("."); + sb.Append(at.End.Value.Year.ToString().Substring(2)); + } + + } + + sb.Append(" "); + sb.Append(at.AbsenceReason.Description); + + count++; + } + } + } + if (sb.Length > 0) + { + empDetail.AbsenceTimeString = "Abwesenheiten: " + sb.ToString(); + } + } + + var span = new DateTimeSpan(); span.StartDateTime = ro.ReportStartDate; span.EndDateTime = ro.ReportEndDate; @@ -241,9 +335,14 @@ namespace BeWo.Report.ReportObjects MitarbeiterauslastungRO.SupportConceptDetail scDc = GetOrCreateSupportConceptDetail(emp, e2c.Customer, scap, c2s, ro.ReportStartDate, ro.ReportEndDate, null, true); - if (scDc != null && (scDc.ApprovedHoursPerWeek > 0 || scDc.ApprovedHoursPerWeekWithRateFactor > 0)) + if (scDc != null) { - empDetail.SupportConceptDetailList.Add(scDc); + if (scDc.ApprovedHoursPerWeek > 0 || + scDc.ApprovedHoursPerWeekWithRateFactor > 0 || + !CheckIfApprovedGreaterZero()) + { + empDetail.SupportConceptDetailList.Add(scDc); + } } } } @@ -259,6 +358,11 @@ namespace BeWo.Report.ReportObjects } + protected virtual bool CheckIfApprovedGreaterZero() + { + return true; + } + private MitarbeiterauslastungRO.SupportConceptDetail GetOrCreateSupportConceptDetail(Employee emp, Customer customer, SupportConceptApprovalPeriod scap, CostBearer2SupportConcept cb2sc, DateTime start, DateTime ende, AuslastungBerechnungHelper anteil, bool ausHauptbetreuung) { bool inTimeRange = true; @@ -290,10 +394,6 @@ namespace BeWo.Report.ReportObjects } else { - if (customer.Oid.Value == 277) - { - int test = 0; - } key = String.Format("c{0}_{1}", customer.Oid.Value, scap.Oid.Value); } if (betreuungDict.ContainsKey(key)) @@ -419,34 +519,96 @@ namespace BeWo.Report.ReportObjects return anteile; } - private void CreateServiceRecordDetails(MitarbeiterauslastungRO ro, MitarbeiterauslastungRO.EmployeeDetail empDetail) + public virtual void CreateServiceRecordDetails(MitarbeiterauslastungRO ro, MitarbeiterauslastungRO.EmployeeDetail empDetail) { - foreach (var scd in empDetail.SupportConceptDetailList) + IList records = null; + var span = new DateTimeSpan(); + span.StartDateTime = ro.ReportStartDate; + span.EndDateTime = ro.ReportEndDate.AddTicks(-1); + + + if (empDetail.Employee != null) { - if (scd.CostBearer2SupportConcept != null) + records = DAOFactory.SearchDAO.FindEmployeeServiceRecords(empDetail.Employee.Oid.Value, span, null, null); + } + else if (empDetail.Customer != null) + { + records = DAOFactory.SearchDAO.FindCustomerServiceRecords(empDetail.Customer.Oid.Value, span, null, null, false); + } + + Dictionary oid2SCDetailDict = new Dictionary(); + foreach (ServiceRecord sr in records) + { + if (sr.Start >= ro.ReportStartDate && sr.Start.Value < ro.ReportEndDate) { - //var records = DAOFactory.SearchDAO.FindServiceRecordsDetailsForLastDays(scd.CostBearer2SupportConcept.Oid.Value, null); - //Dictionary serviceRecordsProcessed = new Dictionary(); + var scd = GetSupportConceptDetailForServiceRecord(empDetail, sr); + + if (scd != null) + { + if (empDetail.Employee != null) + { + if (sr.EmployeeOid.HasValue && sr.EmployeeOid == empDetail.Employee.Oid) + { + AddServiceRecord(ro, scd, sr); + } + } + else if (empDetail.Customer != null) + { + AddServiceRecord(ro, scd, sr); + + } - ////Dictionary groupBookingDict = new Dictionary(); - //foreach (ServiceRecord sr in records) - //{ - // if (!serviceRecordsProcessed.ContainsKey(sr.Oid.Value) && sr.Start.Value < ro.ReportEndDate) - // { - - // //if (sr.GroupOid != null) - // //{ - // // groupBookingDict.Add(sr.GroupOid.Value, sr); - // //} - // AddServiceRecord(scd, sr); - - // serviceRecordsProcessed.Add(sr.Oid.Value, true); - // } - //} + if (sr.GroupOid != null) + { + //groupBookingDict.Add(sr.GroupOid.Value, sr); + } + } } } + + // foreach (var scd in empDetail.SupportConceptDetailList) + //{ + // if (scd.CostBearer2SupportConcept != null) + // { + + // Dictionary serviceRecordsProcessed = new Dictionary(); + + + // Dictionary groupBookingDict = new Dictionary(); + // foreach (ServiceRecord sr in records) + // { + // if (!serviceRecordsProcessed.ContainsKey(sr.Oid.Value) && sr.Start >= ro.ReportStartDate && + // sr.Start.Value < ro.ReportEndDate) + // { + // if (empDetail.Employee != null) + // { + // if (sr.EmployeeOid.HasValue && sr.EmployeeOid == empDetail.Employee.Oid) + // { + // AddServiceRecord(ro, scd, sr); + + // serviceRecordsProcessed.Add(sr.Oid.Value, true); + // } + // } + // else if (empDetail.Customer != null) + // { + // AddServiceRecord(ro, scd, sr); + + // serviceRecordsProcessed.Add(sr.Oid.Value, true); + + // } + + + // if (sr.GroupOid != null) + // { + // //groupBookingDict.Add(sr.GroupOid.Value, sr); + // } + // } + // } + // } + //} + //var emprecords = DAOFactory.SearchDAO.FindEmployeeServiceRecordsWithoutCustomer(empDetail.Employee.Oid.Value); //foreach (var sr in emprecords) //{ @@ -454,6 +616,174 @@ namespace BeWo.Report.ReportObjects //} } + public virtual MitarbeiterauslastungRO.SupportConceptDetail GetSupportConceptDetailForServiceRecord(MitarbeiterauslastungRO.EmployeeDetail empDetail, ServiceRecord sr) + { + if (sr.CostBearer2SupportConcept == null) + { + foreach (var scdi in empDetail.SupportConceptDetailList) + { + if (scdi.SupportConceptApprovalPeriod == null) + { + return scdi; + } + } + } + + SupportConceptApprovalPeriod scap = GetSupportConceptApprovalPeriodForServiceRecord(sr); + + + if (scap != null) + { + foreach (var scdi in empDetail.SupportConceptDetailList) + { + if (scdi.SupportConceptApprovalPeriod != null && scdi.SupportConceptApprovalPeriod.Oid == scap.Oid) + { + return scdi; + } + } + + } + + if (sr.ServiceDescription != null && + sr.ServiceDescription.ServiceCategory != null && + sr.ServiceDescription.ServiceCategory.IsBillable) + { + var scd = new MitarbeiterauslastungRO.SupportConceptDetail(); + scd.Customer = sr.Customer; + scd.SupportConceptApprovalPeriod = scap; + scd.CostBearer2SupportConcept = sr.CostBearer2SupportConcept; + + if (scd.SupportConceptApprovalPeriod != null) + { + scd.StartDate = scd.SupportConceptApprovalPeriod.StartDate; + scd.EndDate = scd.SupportConceptApprovalPeriod.EndDate; + } + else if (scd.CostBearer2SupportConcept != null) + { + scd.StartDate = scd.CostBearer2SupportConcept.StartDate; + scd.EndDate = scd.CostBearer2SupportConcept.EndDate; + } + empDetail.SupportConceptDetailList.Add(scd); + + return scd; + } + return null; + } + + public virtual SupportConceptApprovalPeriod GetSupportConceptApprovalPeriodForServiceRecord(ServiceRecord sr) + { + SupportConceptApprovalPeriod scapOhneCat = null; + if (sr.CostBearer2SupportConcept != null) + { + foreach (var scap in sr.CostBearer2SupportConcept.ApprovalPeriodList) + { + DateTime start = DateTime.MinValue; + DateTime end = DateTime.MaxValue; + + if (scap.StartDate.HasValue) + start = scap.StartDate.Value; + if (scap.EndDate.HasValue && scap.EndDate.Value.Date < end) + end = scap.EndDate.Value.Date.AddDays(1); + + if (sr.Start >= start && sr.End < end) + { + if (scap.ServiceCategory != null && scap.ServiceCategory.Oid == sr.ServiceDescription.ServiceCategory.Oid) + return scap; + if (scap.ServiceCategory == null) + { + scapOhneCat = scap; + } + + } + } + + } + return scapOhneCat; + } + + public virtual void AddServiceRecord(MitarbeiterauslastungRO ro, MitarbeiterauslastungRO.SupportConceptDetail scDC, ServiceRecord sr) + { + var minutes = GetBillableDurationInMinutes(sr); + + if (sr.ServiceDescription != null && + sr.ServiceDescription.ServiceCategory != null && + sr.ServiceDescription.ServiceCategory.IsBillable) + { + scDC.DirectIst += minutes; + + AddToIstForKw(minutes, sr.Start.Value, ro.ReportStartDate, ro.ReportEndDate, scDC); + } + else + scDC.MittelbarIst += minutes; + + } + + private void AddToIstForKw(decimal minutes, DateTime datum, DateTime reportStart, DateTime reportEnd, MitarbeiterauslastungRO.SupportConceptDetail scDC) + { + DateTimeSpan kw1 = new DateTimeSpan(); + kw1.StartDate = reportStart; + + DateTime start = reportStart; + while (start.DayOfWeek != DayOfWeek.Sunday) + { + start = start.AddDays(1); + } + kw1.EndDate = start; + + DateTimeSpan kw2 = new DateTimeSpan(); + kw2.StartDate = kw1.EndDate.AddDays(1); + kw2.EndDate = kw2.StartDate.AddDays(6); + + DateTimeSpan kw3 = new DateTimeSpan(); + kw3.StartDate = kw2.EndDate.AddDays(1); + kw3.EndDate = kw3.StartDate.AddDays(6); + + DateTimeSpan kw4 = new DateTimeSpan(); + kw4.StartDate = kw3.EndDate.AddDays(1); + kw4.EndDate = kw4.StartDate.AddDays(6); + + DateTimeSpan kw5 = new DateTimeSpan(); + kw5.StartDate = kw4.EndDate.AddDays(1); + kw5.EndDate = kw5.StartDate.AddDays(6); + + DateTimeSpan kw6 = new DateTimeSpan(); + kw6.StartDate = kw5.EndDate.AddDays(1); + kw6.EndDate = kw6.StartDate.AddDays(6); + if (reportEnd <= kw5.EndDate) + { + kw5.EndDate = reportEnd.AddDays(-1); + } + if (reportEnd <= kw6.EndDate) + { + kw6.EndDate = reportEnd.AddDays(-1); + } + + if (datum >= kw1.StartDate && datum.Date <= kw1.EndDate) + { + scDC.IstKw1 += minutes; + } + else if (datum >= kw2.StartDate && datum.Date <= kw2.EndDate) + { + scDC.IstKw2 += minutes; + } + else if (datum >= kw3.StartDate && datum.Date <= kw3.EndDate) + { + scDC.IstKw3 += minutes; + } + else if (datum >= kw4.StartDate && datum.Date <= kw4.EndDate && datum < reportEnd) + { + scDC.IstKw4 += minutes; + } + else if (datum >= kw5.StartDate && datum.Date <= kw5.EndDate && datum < reportEnd) + { + scDC.IstKw5 += minutes; + } + else if (datum >= kw6.StartDate && datum.Date <= kw6.EndDate && datum < reportEnd) + { + scDC.IstKw6 += minutes; + } + } + public virtual void AddServiceRecord(MitarbeiterauslastungRO.SupportConceptDetail scDC, ServiceRecord sr) { var minutes = GetBillableDurationInMinutes(sr); diff --git a/Report/ReportObjects/MitarbeiterauslastungRO.cs b/Report/ReportObjects/MitarbeiterauslastungRO.cs index 091560d6c..0efd979d4 100644 --- a/Report/ReportObjects/MitarbeiterauslastungRO.cs +++ b/Report/ReportObjects/MitarbeiterauslastungRO.cs @@ -42,6 +42,7 @@ namespace BeWo.Report.ReportObjects public static MitarbeiterauslastungRO Create(long? employeeOid, IList teamOids, DateTime startDate, DateTime endDate) { + var ro = new MitarbeiterauslastungRO(); ro.ReportStartDate = startDate; ro.ReportEndDate = endDate; @@ -194,6 +195,8 @@ namespace BeWo.Report.ReportObjects public decimal FLSTotalHoursByContract { get; set; } + public String AbsenceTimeString { get; set; } + public List SupportConceptDetailList { get { return scDetailList; } @@ -205,6 +208,8 @@ namespace BeWo.Report.ReportObjects { public Customer Customer { get; set; } + public String Name { get; set; } + public String OrganisationName { get @@ -224,7 +229,7 @@ namespace BeWo.Report.ReportObjects { if (Customer != null) return String.Format("{0}, {1}", Customer.Person.LastName, Customer.Person.FirstName); - return null; + return Name; } } @@ -234,7 +239,12 @@ namespace BeWo.Report.ReportObjects public String TimeRangeString { - get { return String.Format("{0:dd.MM.yyyy}-{1:dd.MM.yyyy}", StartDate, EndDate); } + get + { + if (!StartDate.HasValue && !EndDate.HasValue) + return ""; + return String.Format("{0:dd.MM.yyyy}-{1:dd.MM.yyyy}", StartDate, EndDate); + } } public decimal ApprovedHoursPerWeek { get; set; } @@ -256,6 +266,18 @@ namespace BeWo.Report.ReportObjects public decimal RelationIstSoll { get; set; } public decimal WeekCountUntilNow { get; set; } + + public decimal IstKw1 { get; set; } + + public decimal IstKw2 { get; set; } + + public decimal IstKw3 { get; set; } + + public decimal IstKw4 { get; set; } + + public decimal IstKw5 { get; set; } + + public decimal IstKw6 { get; set; } } public class TeamDetail diff --git a/Report/ReportObjects/MitarbeiterstundenkontoBerechnung.cs b/Report/ReportObjects/MitarbeiterstundenkontoBerechnung.cs index 66bebcacd..a38c3fa3e 100644 --- a/Report/ReportObjects/MitarbeiterstundenkontoBerechnung.cs +++ b/Report/ReportObjects/MitarbeiterstundenkontoBerechnung.cs @@ -410,6 +410,8 @@ namespace BeWo.Report.ReportObjects HandleServiceRecord(empDetail, item); if (AddServiceRecordToDuration(item)) { + String test = String.Format("{0:dd.MM. HH:mm} - {1:HH:mm}, {2}", item.Start, item.End, item.RoundedDuration); + decimal duration = 0; if (item.GroupRoundedDuration.HasValue) @@ -434,6 +436,11 @@ namespace BeWo.Report.ReportObjects sum.IstAbrechenbar += duration; else sum.IstNichtAbrechenbar += duration; + + if (duration > 0) + { + int test2 = 0; + } } sum.RecordsImBerichtszeitraum.Add(item); } @@ -625,7 +632,8 @@ namespace BeWo.Report.ReportObjects oldRecord.End = oldSpan.EndDateTime; - if (!isGroup) + if (!oldRecord.GroupRoundedDuration.HasValue) + //if (!isGroup) { oldRecord.RoundedDuration = (decimal)oldRecord.End.Value.Subtract(oldRecord.Start.Value).TotalMinutes; } @@ -776,7 +784,11 @@ namespace BeWo.Report.ReportObjects foreach (var sr in orderedList) { - decimal duration = GetDuration(sr); + if (sr.Start.HasValue && sr.Start.Value.Hour == 0 && sr.Start.Value.Second > 0) + { + continue; + } + decimal duration = GetDuration(sr); DateTime dtEnd = sr.Start.Value.AddMinutes((double)duration); diff --git a/ReportImp/BUGeVReports/Properties/licenses.licx b/ReportImp/BUGeVReports/Properties/licenses.licx index e69de29bb..c7fd819d5 100644 --- a/ReportImp/BUGeVReports/Properties/licenses.licx +++ b/ReportImp/BUGeVReports/Properties/licenses.licx @@ -0,0 +1 @@ +DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v17.1, Version=17.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/ReportImp/BUGeVReports/SettlementReport2.Designer.cs b/ReportImp/BUGeVReports/SettlementReport2.Designer.cs index 6420532e9..12366ad92 100644 --- a/ReportImp/BUGeVReports/SettlementReport2.Designer.cs +++ b/ReportImp/BUGeVReports/SettlementReport2.Designer.cs @@ -46,7 +46,6 @@ namespace BeWo.BUGeVReports this.bottomMarginBand1 = new DevExpress.XtraReports.UI.BottomMarginBand(); this.GroupHeader1 = new DevExpress.XtraReports.UI.GroupHeaderBand(); this.xrLabel9 = new DevExpress.XtraReports.UI.XRLabel(); - this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.xrLabel18 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel13 = new DevExpress.XtraReports.UI.XRLabel(); this.xrLabel11 = new DevExpress.XtraReports.UI.XRLabel(); @@ -113,11 +112,18 @@ namespace BeWo.BUGeVReports this.xrTableRow28 = new DevExpress.XtraReports.UI.XRTableRow(); this.xrTableCell46 = new DevExpress.XtraReports.UI.XRTableCell(); this.xrTableCell47 = new DevExpress.XtraReports.UI.XRTableCell(); + this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); + this.xrTableRow4 = new DevExpress.XtraReports.UI.XRTableRow(); + this.cellStart5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellEnd5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellHourlyRate5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.cellFLS5 = new DevExpress.XtraReports.UI.XRTableCell(); + this.xrTableCell10 = new DevExpress.XtraReports.UI.XRTableCell(); ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); // // Detail @@ -278,10 +284,6 @@ namespace BeWo.BUGeVReports this.xrLabel9.StylePriority.UseFont = false; this.xrLabel9.Text = "[RecipientOrganisation]\r\n[RecipientStreet]\r\n[RecipientPostCodeAndTown]"; // - // bindingSource1 - // - this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.Settlement2RO); - // // xrLabel18 // this.xrLabel18.Font = new System.Drawing.Font("Arial", 10F); @@ -358,7 +360,7 @@ namespace BeWo.BUGeVReports this.xrLabel35.BackColor = System.Drawing.Color.Transparent; this.xrLabel35.Borders = DevExpress.XtraPrinting.BorderSide.Top; this.xrLabel35.Font = new System.Drawing.Font("Arial", 11F, System.Drawing.FontStyle.Bold); - this.xrLabel35.LocationFloat = new DevExpress.Utils.PointFloat(0.0002543131F, 637.7083F); + this.xrLabel35.LocationFloat = new DevExpress.Utils.PointFloat(3.178914E-05F, 657.4167F); this.xrLabel35.Multiline = true; this.xrLabel35.Name = "xrLabel35"; this.xrLabel35.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -371,14 +373,14 @@ namespace BeWo.BUGeVReports // // xrCheckBox2 // - this.xrCheckBox2.LocationFloat = new DevExpress.Utils.PointFloat(347.3755F, 452.2916F); + this.xrCheckBox2.LocationFloat = new DevExpress.Utils.PointFloat(347.3753F, 472F); this.xrCheckBox2.Name = "xrCheckBox2"; this.xrCheckBox2.SizeF = new System.Drawing.SizeF(211.0832F, 21.875F); this.xrCheckBox2.Text = " Die Betreuung dauert an."; // // xrCheckBox1 // - this.xrCheckBox1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002543131F, 452.2916F); + this.xrCheckBox1.LocationFloat = new DevExpress.Utils.PointFloat(0.0002543131F, 472F); this.xrCheckBox1.Name = "xrCheckBox1"; this.xrCheckBox1.SizeF = new System.Drawing.SizeF(324.9999F, 21.875F); this.xrCheckBox1.Text = " Die Betreuung wurde am beendet."; @@ -386,7 +388,7 @@ namespace BeWo.BUGeVReports // xrLabel17 // this.xrLabel17.BackColor = System.Drawing.Color.Transparent; - this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(0.0002543131F, 693.9583F); + this.xrLabel17.LocationFloat = new DevExpress.Utils.PointFloat(3.178914E-05F, 713.6667F); this.xrLabel17.Multiline = true; this.xrLabel17.Name = "xrLabel17"; this.xrLabel17.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -408,8 +410,9 @@ namespace BeWo.BUGeVReports this.xrTableRow5, this.xrTableRow6, this.xrTableRow8, - this.xrTableRow3}); - this.xrTable2.SizeF = new System.Drawing.SizeF(641.9999F, 116F); + this.xrTableRow3, + this.xrTableRow4}); + this.xrTable2.SizeF = new System.Drawing.SizeF(641.9999F, 138F); this.xrTable2.StylePriority.UseBorders = false; this.xrTable2.StylePriority.UsePadding = false; // @@ -472,7 +475,7 @@ namespace BeWo.BUGeVReports this.cellFLS1, this.xrTableCell20}); this.xrTableRow5.Name = "xrTableRow5"; - this.xrTableRow5.Weight = 0.44307725591740971D; + this.xrTableRow5.Weight = 0.49230806213045525D; // // cellStart1 // @@ -610,7 +613,7 @@ namespace BeWo.BUGeVReports // xrLabel12 // this.xrLabel12.BackColor = System.Drawing.Color.Transparent; - this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(0.0002543131F, 490.2082F); + this.xrLabel12.LocationFloat = new DevExpress.Utils.PointFloat(3.178914E-05F, 509.9166F); this.xrLabel12.Multiline = true; this.xrLabel12.Name = "xrLabel12"; this.xrLabel12.Padding = new DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100F); @@ -896,6 +899,46 @@ namespace BeWo.BUGeVReports this.xrTableCell47.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight; this.xrTableCell47.Weight = 0.21685899000901443D; // + // bindingSource1 + // + this.bindingSource1.DataSource = typeof(BeWo.Report.ReportObjects.Settlement2RO); + // + // xrTableRow4 + // + this.xrTableRow4.Cells.AddRange(new DevExpress.XtraReports.UI.XRTableCell[] { + this.cellStart5, + this.cellEnd5, + this.cellHourlyRate5, + this.cellFLS5, + this.xrTableCell10}); + this.xrTableRow4.Name = "xrTableRow4"; + this.xrTableRow4.Weight = 0.49230806213045525D; + // + // cellStart5 + // + this.cellStart5.Name = "cellStart5"; + this.cellStart5.Weight = 0.654205681555982D; + // + // cellEnd5 + // + this.cellEnd5.Name = "cellEnd5"; + this.cellEnd5.Weight = 0.65420565778839579D; + // + // cellHourlyRate5 + // + this.cellHourlyRate5.Name = "cellHourlyRate5"; + this.cellHourlyRate5.Weight = 0.51401872857292652D; + // + // cellFLS5 + // + this.cellFLS5.Name = "cellFLS5"; + this.cellFLS5.Weight = 0.51401872857292652D; + // + // xrTableCell10 + // + this.xrTableCell10.Name = "xrTableCell10"; + this.xrTableCell10.Weight = 0.663551203509769D; + // // Spitzabrechnung // this.Bands.AddRange(new DevExpress.XtraReports.UI.Band[] { @@ -916,10 +959,10 @@ namespace BeWo.BUGeVReports this.PaperKind = System.Drawing.Printing.PaperKind.A4; this.Version = "13.2"; ((System.ComponentModel.ISupportInitialize)(this.xrTable1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xrTable4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); } @@ -1008,5 +1051,11 @@ namespace BeWo.BUGeVReports private DevExpress.XtraReports.UI.XRTableCell cellHourlyRate4; private DevExpress.XtraReports.UI.XRTableCell cellFLS4; private DevExpress.XtraReports.UI.XRTableCell xrTableCell9; + private DevExpress.XtraReports.UI.XRTableRow xrTableRow4; + private DevExpress.XtraReports.UI.XRTableCell cellStart5; + private DevExpress.XtraReports.UI.XRTableCell cellEnd5; + private DevExpress.XtraReports.UI.XRTableCell cellHourlyRate5; + private DevExpress.XtraReports.UI.XRTableCell cellFLS5; + private DevExpress.XtraReports.UI.XRTableCell xrTableCell10; } } diff --git a/ReportImp/BUGeVReports/SettlementReport2.cs b/ReportImp/BUGeVReports/SettlementReport2.cs index aaf28b23e..3ccea3299 100644 --- a/ReportImp/BUGeVReports/SettlementReport2.cs +++ b/ReportImp/BUGeVReports/SettlementReport2.cs @@ -52,6 +52,13 @@ namespace BeWo.BUGeVReports cellHourlyRate4.Text = String.Format("{0:0.00}", ii.AmountPerUnit); cellFLS4.Text = String.Format("{0:0.00}", ii.UnitCount); } + else if (idx == 4) + { + cellStart5.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodStartDate); + cellEnd5.Text = String.Format("{0:dd.MM.yyyy}", ii.PeriodEndDate); + cellHourlyRate5.Text = String.Format("{0:0.00}", ii.AmountPerUnit); + cellFLS5.Text = String.Format("{0:0.00}", ii.UnitCount); + } idx++; } diff --git a/ReportImp/BUGeVReports/SettlementReport2.resx b/ReportImp/BUGeVReports/SettlementReport2.resx index eb5806489..44663a371 100644 --- a/ReportImp/BUGeVReports/SettlementReport2.resx +++ b/ReportImp/BUGeVReports/SettlementReport2.resx @@ -120,10 +120,10 @@ anbei sende ich Ihnen die Nachweise über die im Rahmen des Betreuten Wohnens für [Salutation2] [CustomerFirstName] [CustomerLastName] erbrachten Leistungen zu. Nach unserer Berechnung ergeben sich für den [AccountingPeriod] hieraus: - - 17, 17 - Hiermit wird erklärt, dass die Verpflichtungen aus der Leistungs-, Prüfungs- und Vergütungsvereinbarung nach §§ 75 ff. SGB XII eingehalten wurden und alle hier gemachten Angaben anhand der vorgehaltenen Quittierungsbelege sowie der Betreuungsdokumentation jederzeit nachgewiesen werden können. + + 17, 17 + \ No newline at end of file diff --git a/ReportImp/BeWoSchillingReports/BeWoSchillingReports.csproj b/ReportImp/BeWoSchillingReports/BeWoSchillingReports.csproj index ac4d3c708..77d29ac0f 100644 --- a/ReportImp/BeWoSchillingReports/BeWoSchillingReports.csproj +++ b/ReportImp/BeWoSchillingReports/BeWoSchillingReports.csproj @@ -74,6 +74,13 @@ FLSListReport.cs + + + Component + + + Mitarbeiterauslastung.cs + Component @@ -81,6 +88,12 @@ SettlementReport.cs + + Component + + + Teamauslastung.cs + @@ -101,10 +114,16 @@ FLSListReport.cs Designer + + Mitarbeiterauslastung.cs + SettlementReport.cs + + Teamauslastung.cs +