diff --git a/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml.cs b/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml.cs index fd83e630a..f9b084a34 100644 --- a/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml.cs +++ b/BeWo/View/Detail/Accounting/GeneralInvoiceView.xaml.cs @@ -187,15 +187,33 @@ namespace BeWo.View.Detail.Accounting { ViewModel.NewVM.RecipientOrganisationOid = _SelectedOrganisation.OrganisationOid; ViewModel.NewVM.RecipientOrganisation = r.Name; - ViewModel.NewVM.RecipientStreet = r.InvoiceAddressStreet; - ViewModel.NewVM.RecipientTown = r.InvoiceAddressTown; + ViewModel.NewVM.RecipientDivision = r.Name2; + - if (r.ContactInformations.FirstOrDefault(f => f.ContactType == ContactType.business_POBox) != null) + if (r.ContactInformations.FirstOrDefault(f => f.ContactType == ContactType.private_POBox) != null) + { + ViewModel.NewVM.RecipientPostBox = r.ContactInformations.First(f => f.ContactType == ContactType.private_POBox).ContactValue; + } + else if (r.ContactInformations.FirstOrDefault(f => f.ContactType == ContactType.business_POBox) != null) { ViewModel.NewVM.RecipientPostBox = r.ContactInformations.First(f => f.ContactType == ContactType.business_POBox).ContactValue; } + ViewModel.NewVM.RecipientStreet = r.InvoiceAddressStreet; + ViewModel.NewVM.RecipientTown = r.InvoiceAddressTown; ViewModel.NewVM.RecipientPostCode = r.InvoiceAddressPostalCode; + if (String.IsNullOrEmpty(ViewModel.NewVM.RecipientStreet)) + { + ViewModel.NewVM.RecipientStreet = r.Street; + } + if (String.IsNullOrEmpty(ViewModel.NewVM.RecipientTown)) + { + ViewModel.NewVM.RecipientTown = r.Town; + } + if (String.IsNullOrEmpty(ViewModel.NewVM.RecipientPostCode)) + { + ViewModel.NewVM.RecipientPostCode = r.PostalCode; + } StartEditNewVM(); }); } diff --git a/BeWo/View/Detail/CustomerView.xaml.cs b/BeWo/View/Detail/CustomerView.xaml.cs index 4fef9ff6a..8a9a9ee4f 100644 --- a/BeWo/View/Detail/CustomerView.xaml.cs +++ b/BeWo/View/Detail/CustomerView.xaml.cs @@ -97,7 +97,12 @@ namespace BeWo.View.Detail AdditionalServiceAssessmentSheetCategories = new List(); - if (BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungNurEigeneAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungAnsehen)) + + if (!BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungNurEigeneAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungAnsehen)) + { + tabitem_Bargeldverwaltung.Visibility = Visibility.Collapsed; + } + else if (BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungNurEigeneAnsehen) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.BargeldverwaltungAnsehen)) { tabitem_Bargeldverwaltung.Visibility = pCustomerVM.IsNew || BeWoApp.LoggedOnEmployee.RelatedCustomers.Any(a => a.Customer.CustomerOid.Equals(pCustomerVM.CommitToDataContract().CustomerOid.Value)) ? Visibility.Visible : Visibility.Collapsed; } diff --git a/BeWo/ViewModel/InvoiceBaseVM.cs b/BeWo/ViewModel/InvoiceBaseVM.cs index 453689306..0b83f1752 100644 --- a/BeWo/ViewModel/InvoiceBaseVM.cs +++ b/BeWo/ViewModel/InvoiceBaseVM.cs @@ -840,6 +840,7 @@ namespace BeWo.ViewModel _Notice = pDataContract.Notice; _DunningLetterCount = pDataContract.DunningLetterCount; _TotalAmount = pDataContract.TotalAmount; + _CustomerReferenceNumber = pDataContract.CustomerReferenceNumber; foreach (var iContactDC in pDataContract.SenderContactInformations) { @@ -852,7 +853,10 @@ namespace BeWo.ViewModel { _SenderPhone = iContactDC.ContactValue; } + } + foreach (var iContactDC in pDataContract.RecipientContactInformations) + { if (iContactDC.ContactType == ContactType.business_POBox) { _RecipientPostBox = iContactDC.ContactValue; @@ -893,10 +897,11 @@ namespace BeWo.ViewModel pDataContract.Notice = _Notice; pDataContract.DunningLetterCount = _DunningLetterCount; pDataContract.TotalAmount = _TotalAmount; + pDataContract.CustomerReferenceNumber = _CustomerReferenceNumber; CommitSenderContact(_SenderFax, ContactType.business_Fax); CommitSenderContact(_SenderPhone, ContactType.business_Phone); - CommitSenderContact(_RecipientPostBox, ContactType.business_POBox); + CommitReceiverContact(_RecipientPostBox, ContactType.business_POBox); pDataContract.InvoiceItems = _InvoiceItems.CopyToDCList(doCommit); @@ -906,7 +911,23 @@ namespace BeWo.ViewModel private void CommitSenderContact(string pValue, ContactType pContactType) { var lOldContactDCs = DataContract.SenderContactInformations != null ? DataContract.SenderContactInformations.ToList() : new List(); - var lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType); + CommitContact(pValue, pContactType, lOldContactDCs); + + DataContract.SenderContactInformations = lOldContactDCs; + } + + + private void CommitReceiverContact(string pValue, ContactType pContactType) + { + var lOldContactDCs = DataContract.RecipientContactInformations != null ? DataContract.RecipientContactInformations.ToList() : new List(); + CommitContact(pValue, pContactType, lOldContactDCs); + + DataContract.RecipientContactInformations = lOldContactDCs; + } + + private void CommitContact(string pValue, ContactType pContactType, List lOldContactDCs) + { + var lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType); if (string.IsNullOrEmpty(pValue) && lContactDC != null) { @@ -926,8 +947,6 @@ namespace BeWo.ViewModel lContactDC.ContactValue = pValue; } - - DataContract.SenderContactInformations = lOldContactDCs; } #endregion diff --git a/BeWoPlanerMobil/Controllers/ChatController.cs b/BeWoPlanerMobil/Controllers/ChatController.cs index 2f17b5e3b..207d87dd4 100644 --- a/BeWoPlanerMobil/Controllers/ChatController.cs +++ b/BeWoPlanerMobil/Controllers/ChatController.cs @@ -61,7 +61,7 @@ namespace BeWoPlanerMobil.Controllers OperationsServiceImp xc = new OperationsServiceImp(); - var mandator = xc.GetMandator(); + var mandator = xc.GetMandator2(false); if (mandator.Apikey == apikey) { diff --git a/BeWoPlanerMobil/Controllers/MainController.cs b/BeWoPlanerMobil/Controllers/MainController.cs index 363e94b86..885511bfe 100644 --- a/BeWoPlanerMobil/Controllers/MainController.cs +++ b/BeWoPlanerMobil/Controllers/MainController.cs @@ -2081,8 +2081,8 @@ namespace BeWoPlanerMobil.Controllers checkSR.ServiceDescription = OperationsService.GetServiceDescription(Model.SelectedServiceDescriptionOid.Value); - var man = OperationsService.GetMandator(); - var s = man.Settings ?? string.Empty; + var manx = OperationsService.GetMandator(); + var s = manx.Settings ?? string.Empty; var einzeln = s.Split(';'); var g = einzeln.ToList().FirstOrDefault(f => f.Contains("MaxDaysEditServiceRecordsAllowed")); var t = g != null ? int.Parse(g.Split('=')[1]) : 0; diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index 43bef6978..684619b07 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -1367,15 +1367,25 @@ namespace BeWo.Data.Access return c.Select(s => s.SequencePosition).ToList(); } - public IEnumerable GetInvoiceBases(DateTime? startDate, DateTime? endDate) + public IEnumerable GetInvoiceBases(DateTime? startDate, DateTime? endDate, bool useInvoiceDate = true) { var lCriteria = CreateCriteriaIsActive(); - if (startDate.HasValue) - lCriteria.Add(Restrictions.Ge(InvoiceBase.PropertyName_InvoiceDate, startDate)); - if (endDate.HasValue) - lCriteria.Add(Restrictions.Le(InvoiceBase.PropertyName_InvoiceDate, endDate)); + if (useInvoiceDate) + { + if (startDate.HasValue) + lCriteria.Add(Restrictions.Ge(InvoiceBase.PropertyName_InvoiceDate, startDate)); + if (endDate.HasValue) + lCriteria.Add(Restrictions.Le(InvoiceBase.PropertyName_InvoiceDate, endDate)); + } + else + { + if (startDate.HasValue) + lCriteria.Add(Restrictions.Ge(InvoiceBase.PropertyName_AccountingPeriodEnd, startDate)); + if (endDate.HasValue) + lCriteria.Add(Restrictions.Le(InvoiceBase.PropertyName_AccountingPeriodStart, endDate)); + } - return lCriteria.List(); + return lCriteria.List(); } public IEnumerable GetAllActiveSupportConceptsByCustomers(List customerOids, bool expiredOnesToo = false) diff --git a/Data/Data.csproj b/Data/Data.csproj index c3c426fbf..565b54864 100644 --- a/Data/Data.csproj +++ b/Data/Data.csproj @@ -123,6 +123,7 @@ + @@ -573,6 +574,9 @@ PreserveNewest + + Designer + Designer diff --git a/Service/Invoicing/InvoiceCreation.cs b/Service/Invoicing/InvoiceCreation.cs index d69f5fce1..9b3540306 100644 --- a/Service/Invoicing/InvoiceCreation.cs +++ b/Service/Invoicing/InvoiceCreation.cs @@ -393,7 +393,7 @@ namespace BeWo.Service.Invoicing if (LoggedInUserOperationContextExt.Current != null) { var lLoggedInEmployee = LoggedInUserOperationContextExt.Current.User.Employee; - var mandator = new OperationsServiceImp().GetMandator(); + var mandator = new OperationsServiceImp().GetMandator2(false); if (lLoggedInEmployee != null) { diff --git a/Service/Invoicing/InvoiceFactory.cs b/Service/Invoicing/InvoiceFactory.cs index a9cfd5700..bdd9a01ec 100644 --- a/Service/Invoicing/InvoiceFactory.cs +++ b/Service/Invoicing/InvoiceFactory.cs @@ -15,7 +15,7 @@ namespace BeWo.Service.Invoicing public virtual InvoiceCreation CreateInvoiceCreator(string specificId, string tenant, Dictionary> supportConcepts2ServiceRecords) { var os = new OperationsServiceImp(); - var m = os.GetMandator(); + var m = os.GetMandator2(false); if (m.AllowSbd) { return new SbdDefaultInvoiceCreation(); diff --git a/Service/Invoicing/SettlementInvoiceCreation.cs b/Service/Invoicing/SettlementInvoiceCreation.cs index a1071aef0..a6e58d663 100644 --- a/Service/Invoicing/SettlementInvoiceCreation.cs +++ b/Service/Invoicing/SettlementInvoiceCreation.cs @@ -691,6 +691,11 @@ namespace BeWo.Service.Invoicing CalculateInvoiceItemAmounts(ii); } + if (ii.UnitCount.HasValue) + { + si.RecordedBillableFLSBrutto = (si.RecordedBillableFLSBrutto ?? 0) + ii.UnitCount; + } + var list = CreateAdditionalInvoiceItems(ap); invoiceItems.AddRange(list); } diff --git a/Service/Plugins/DataExporter.cs b/Service/Plugins/DataExporter.cs index 1e93c24bd..98f3f621e 100644 --- a/Service/Plugins/DataExporter.cs +++ b/Service/Plugins/DataExporter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using BeWo.Data.Access; using BeWo.Data.Entities; using BeWo.Service.Core; @@ -12,6 +13,7 @@ using BS.Shared.DataContracts; using BS.Shared.Extensions; using BS.Shared.Services; using BS.Shared.Translation; +using NHibernate.Util; using Utils = BS.Shared.Core.Utils; namespace BeWo.Service.Plugins @@ -191,5 +193,42 @@ namespace BeWo.Service.Plugins { return new ExcelDownload(pHeaderCaption, pContent).CreateExcelOutputString(); } + + public virtual void CreateBuchungsExportProtokollEintrag(QueryDC query) + { + var export = new BuchungsExport(); + export.Datum = DateTime.Now; + export.Name = query.Title; + export.FileName = query.FileName; + export.Export = query.QueryResult; + export.Parameter = CreateParameterString(query); + DAOFactory.GenericDAO.Insert(export); + + } + + private string CreateParameterString(QueryDC query) + { + StringBuilder sb = new StringBuilder(); + + if (query.Parameter != null) + { + foreach (var p in query.Parameter) + { + if (sb.Length > 0) + { + sb.Append(";"); + } + + sb.Append(p.Name); + sb.Append("="); + if (p.Value != null) + { + sb.Append(p.Value.ToString()); + } + } + } + + return sb.ToString(); + } } } diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs index 28a087d25..d62e92ec7 100644 --- a/Service/Plugins/PluginLoader.cs +++ b/Service/Plugins/PluginLoader.cs @@ -17,7 +17,7 @@ namespace BeWo.Service.Plugins { #if DEBUG var t = "demo"; - //t = "irgendwaswasesnichtgibt"; + t = "irgendwaswasesnichtgibt"; //t = "2356097460"; // Lebenshilfe Würzburg //t = "1234567890"; // Präsentationsdatenbank //t = "5687373602"; // LH Duisburg @@ -54,7 +54,7 @@ namespace BeWo.Service.Plugins //t = "6923790936"; // Integra e.V. //t = "2392153512"; // Christopherus Haus //t = "2918696314"; // Caritas Frankfurt 2 - //t = "9495336024"; // VKMAachen app1 + //t = "9495336024"; // VKM Aachen //t = "5237724939"; // Indro ABW //t = "7635986435"; // Köln Ring //t = "4074176860"; // Soziale Dienstleistung Gessner @@ -82,9 +82,9 @@ namespace BeWo.Service.Plugins //t = "4867997795"; // ADiK Kleve //t = "3184859776"; // Sergej Becker //t = "7752610643"; // BWK Gbr - t = "3785623125"; // Betreuwo + //t = "3785623125"; // Betreuwo //t = "7130228334"; // LH Borken - //t = "4209820830"; // VKM Hamm + //t = "4209820830"; // VKM HammTalpha //t = "5700328131"; // Betreutes Wohnen St. Ludgerus Essen-Werden //t = "1907984777"; // Soziale Dienste Katrin Schmidt //t = "9033246467"; // SKM Menden @@ -95,7 +95,7 @@ namespace BeWo.Service.Plugins //t = "2727001973"; // SD Julia Schönberg //t = "5653806613"; // Feid und Kollegen //t = "3830114427"; // FiZ Familie im Zentrum Hof - //t = "7138297573"; // Tagwerk betreutes wohnen + t = "7138297573"; // Tagwerk betreutes wohnen //t = "1008896531"; // BeWo Auxilio //t = "9383760246"; // Die Kette //t = "5915565037"; // LH Remscheid @@ -177,7 +177,7 @@ namespace BeWo.Service.Plugins //t = "2331203795"; // BeWo für dich //t = "5426234256"; // SKM Leverkusen //t = "4137042939"; // MLG Lebengestalten / Haus Müllestumpe - //t = "5260936181"; // LORI + t = "5260936181"; // LORI //t = "1931553444"; // HIBA //t = "7185338722"; // BeWo Walz & Paiva //t = "3196643272"; // Betreutes Wohnen Lisa Wöll @@ -185,21 +185,23 @@ namespace BeWo.Service.Plugins //t = "2591682148"; // Humanitas //t = "9805564204"; // LeWo Aachen //t = "7215356798"; // Triathlon - //t = "3664416736"; // LH Mönchengladbach - //t = "4290816992"; // BeWo im flow - //t = "3612443220"; // ABW Weeger - //t = "6265842607"; // BeWo Dienstleistungen Pougin und Klaasen - //t = "9273332501"; // Pflegedienst Wessel - //t = "4693476852"; // HSH Netzwerk - //t = "3884496709"; // Wahl e.V. - //t = "9883255779"; // VKM Menden - //t = "9556218062"; // Diakonie Landshut - //t = "2279593936"; // Diakonie Mülheim - //t = "3623837005"; // Betreuwo Wesel - //t = "8407321888"; // AWO Wesel - //t = "8454426692"; // Mit-Menschen - - //t = "ABC"; + //t = "3664416736"; // LH Mönchengladbach + //t = "4290816992"; // BeWo im flow + //t = "3612443220"; // ABW Weeger + //t = "6265842607"; // BeWo Dienstleistungen Pougin und Klaasen + //t = "9273332501"; // Pflegedienst Wessel + //t = "4693476852"; // HSH Netzwerk + //t = "3884496709"; // Wahl e.V. + //t = "9883255779"; // VKM Menden + //t = "9556218062"; // Diakonie Landshut + //t = "2279593936"; // Diakonie Mülheim + //t = "3623837005"; // Betreuwo Wesel + //t = "8407321888"; // AWO Wesel + //t = "8454426692"; // Mit-Menschen + //t = "0629004412"; // BeWo-Colonia Basaran + //t = "7668701607"; // Wohnstätten Essen + //t = "3833058951"; // Aids Hilfe Duisburg (Self) + //t = "9463879250"; // ABW Dziallas und Muhrin return t; #else diff --git a/Service/Plugins/ServiceRecordValidator.cs b/Service/Plugins/ServiceRecordValidator.cs index 931605024..8dd305c99 100644 --- a/Service/Plugins/ServiceRecordValidator.cs +++ b/Service/Plugins/ServiceRecordValidator.cs @@ -198,13 +198,10 @@ namespace BeWo.Service.Plugins return result; } - public virtual List ValidateServiceRecord(ServiceRecordDC newServiceRecord, - SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, - IList employeeOids, IList cb2scOids) + public virtual List ValidateServiceRecord(ServiceRecordDC newServiceRecord, SupportConceptStatisticsDC statistics, int maxDaysEditServiceRecordsAllowed, IList employeeOids, IList cb2scOids) { var result = new List(); - - + if (!newServiceRecord.Start.HasValue) return result; diff --git a/Service/Plugins/StundenuebersichtAuswertung.cs b/Service/Plugins/StundenuebersichtAuswertung.cs index a31b521ff..f485fa91d 100644 --- a/Service/Plugins/StundenuebersichtAuswertung.cs +++ b/Service/Plugins/StundenuebersichtAuswertung.cs @@ -73,32 +73,32 @@ namespace BeWo.Service.Plugins rootDC.Groups = new List(); rootDC.Customer = MapperFactory.CompactCustomerDC_Customer.MapToNewDC(customer); - IList serviceRecordes = null; + IList serviceRecords = null; if (config.StartDate != null && config.EndDate != null) { var span = new DateTimeSpan(); span.StartDateTime = config.StartDate.Value; span.EndDateTime = config.EndDate.Value; - serviceRecordes = DAOFactory.SearchDAO.FindCustomerServiceRecords(customer.Oid.Value, span, null, config.ShowOnlyMarker ? ServiceRecordTypeId.Content : (ServiceRecordTypeId?)null, false); + serviceRecords = DAOFactory.SearchDAO.FindCustomerServiceRecords(customer.Oid.Value, span, null, config.ShowOnlyMarker ? ServiceRecordTypeId.Content : (ServiceRecordTypeId?)null, false); } else { - serviceRecordes = customer.ServiceRecordList; + serviceRecords = customer.ServiceRecordList; } Dictionary flsGroupDict = new Dictionary(); Dictionary supportConceptOverviewDict = new Dictionary(); - bool createGroups = AllowCustomerAnalysis(customer, config); + bool createGroups = AllowCustomerAnalysis(customer, config, serviceRecords); if (createGroups) { Dictionary groupBookingDict = new Dictionary(); - foreach (ServiceRecord sr in serviceRecordes) + foreach (ServiceRecord sr in serviceRecords) { bool cont = true; if (sr.Employee != null && sr.Employee.IsActive == ActivationTypeId.Deleted) @@ -190,13 +190,13 @@ namespace BeWo.Service.Plugins return rootDC; } - public virtual bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config) + public virtual bool AllowCustomerAnalysis(Customer customer, FLSAnalysisConfigDC config, IList serviceRecords) { bool allow = true; if (config.EmployeeOid != null) { allow = false; - foreach (ServiceRecord sr in customer.ServiceRecordList) + foreach (ServiceRecord sr in serviceRecords) { if (sr.Employee != null && sr.Employee.Oid.Value == config.EmployeeOid.Value) { diff --git a/Service/Service.csproj b/Service/Service.csproj index 40e6cbe4b..1a6bb1034 100644 --- a/Service/Service.csproj +++ b/Service/Service.csproj @@ -322,6 +322,7 @@ + diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs index ba4934305..1d49519ca 100644 --- a/Service/ServiceImplementations/AccountingServiceImp.cs +++ b/Service/ServiceImplementations/AccountingServiceImp.cs @@ -29,7 +29,10 @@ namespace BeWo.Service.ServiceImplementations { try { - ServiceLogic.SetActivationType(invoices.ToDictionary(i => i.InvoiceBaseOid.Value, i => i.InvoiceBaseVersion.Value), ActivationTypeId.Deleted); + var s = PluginLoader.FindClass(); + s.DeactivateInvoiceBases(invoices); + + } catch (Exception e) { @@ -41,8 +44,8 @@ namespace BeWo.Service.ServiceImplementations { try { - ServiceLogic.SetActivationType(invoices.ToDictionary(i => i.ServiceInvoiceOid.Value, i => i.ServiceInvoiceVersion.Value), ActivationTypeId.Deleted); - ServiceLogic.SetActivationType(invoices.ToDictionary(i => i.InvoiceBase.InvoiceBaseOid.Value, i => i.InvoiceBase.InvoiceBaseVersion.Value), ActivationTypeId.Deleted); + var s = PluginLoader.FindClass(); + s.DeactivateServiceInvoices(invoices); } catch (Exception e) { @@ -147,14 +150,10 @@ namespace BeWo.Service.ServiceImplementations { try { - DateTime? end = endDate; - if (end.HasValue) - { - end = end.Value.Date.AddDays(1).AddTicks(-1); - } - var list = DAOFactory.SearchDAO.GetInvoiceBases(startDate, end); + var s = PluginLoader.FindClass(); - return MapperFactory.InvoiceBaseDC_InvoiceBase.MapToNewDCs(list); + return s.GetInvoiceBases(startDate, endDate); + } catch (Exception e) { diff --git a/Service/ServiceImplementations/AnalysisServiceImp.cs b/Service/ServiceImplementations/AnalysisServiceImp.cs index 6ba3feb7f..09d9e9fef 100644 --- a/Service/ServiceImplementations/AnalysisServiceImp.cs +++ b/Service/ServiceImplementations/AnalysisServiceImp.cs @@ -388,6 +388,16 @@ namespace BeWo.Service.ServiceImplementations dc = financeItemsByCb2scOid[oid]; dc.AmountPaid += at.Amount; + //DateTime dt = at.BookingDate.Value; + //if (at.GueltigkeitsDatum.HasValue) + //{ + // dt = at.GueltigkeitsDatum.Value; + //} + + //if (start <= dt && dt <= end) + //{ + // dc.AmountPaidInReportTimeSpan += at.Amount; + //} //AccountingTransactionDC atdc = this.CreateAccountingTransactionDC(at); //dc.AccountingTransactions.Add(atdc); } diff --git a/Service/ServiceImplementations/EmployeeServiceImp.cs b/Service/ServiceImplementations/EmployeeServiceImp.cs index 01fab4c9a..0d36e1aec 100644 --- a/Service/ServiceImplementations/EmployeeServiceImp.cs +++ b/Service/ServiceImplementations/EmployeeServiceImp.cs @@ -992,13 +992,55 @@ namespace BeWo.Service.ServiceImplementations Dictionary processedGroups = new Dictionary(); Employee emp = DAOFactory.GenericDAO.LoadByID(employeeOid.Value); + + ApplicationUser loggedInUser = null; + + if (LoggedInUserOperationContextExt.Current != null && LoggedInUserOperationContextExt.Current.User != null) + { + loggedInUser = LoggedInUserOperationContextExt.Current.User; + } + else + { + loggedInUser = SessionFacade.LoggedInUser; + } + + bool nurEigene = true; + if (loggedInUser != null) + { + + //Alle + if (Utils.UserHasRight(loggedInUser, UserRightType.SupportConcept_ViewAllSupportConcepts)) + { + nurEigene = false; + } + //Vom Team + else if (Utils.UserHasRight(loggedInUser, UserRightType.SupportConcept_ViewMyTeams)) + { + //? + } + //Eigene + else if (Utils.UserHasRight(loggedInUser, UserRightType.SupportConceptView_View)) + { + nurEigene = true; + } + + } + foreach (var groupOfPeople in allgroups) { if (!processedGroups.ContainsKey(groupOfPeople.Oid.Value)) { processedGroups.Add(groupOfPeople.Oid.Value, true); - if (employeeOid.Value == groupOfPeople.CreatedByEmployeeOid || ContainsMemberOfEmployee(groupOfPeople, emp)) + + if (nurEigene) + { + if (employeeOid.Value == groupOfPeople.CreatedByEmployeeOid || ContainsMemberOfEmployee(groupOfPeople, emp)) + groups.Add(groupOfPeople); + } + else + { groups.Add(groupOfPeople); + } } } return groups; diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs index ca1cba590..54a09a9a7 100644 --- a/Service/ServiceImplementations/OperationsServiceImp.cs +++ b/Service/ServiceImplementations/OperationsServiceImp.cs @@ -883,6 +883,11 @@ namespace BeWo.Service.ServiceImplementations } public MandatorDC GetMandator() + { + return GetMandator2(true); + } + + public MandatorDC GetMandator2(bool fetchContractState) { try { @@ -891,18 +896,22 @@ namespace BeWo.Service.ServiceImplementations Dictionary settingValueDict = GetSettingsValueDict(manDc.Settings); - - string contractState = GetContractState(); - Dictionary contractStateDict = GetSettingsValueDict(contractState); - - foreach (var kv in contractStateDict) + if (fetchContractState) { - if (settingValueDict.ContainsKey(kv.Key)) + string contractState = GetContractState(); + Dictionary contractStateDict = GetSettingsValueDict(contractState); + + foreach (var kv in contractStateDict) { - settingValueDict.Remove(kv.Key); + if (settingValueDict.ContainsKey(kv.Key)) + { + settingValueDict.Remove(kv.Key); + } + + settingValueDict.Add(kv.Key, kv.Value); } - settingValueDict.Add(kv.Key, kv.Value); } + if (!settingValueDict.ContainsKey("ShowScheduler") && man.IsSchedulerAllowed) { settingValueDict.Add("ShowScheduler", "1"); @@ -911,6 +920,15 @@ namespace BeWo.Service.ServiceImplementations { settingValueDict.Add("ShowMedication", "1"); } + if (!settingValueDict.ContainsKey("ShowDistanceFields") && settingValueDict.ContainsKey("ShowKilometer")) + { + if (settingValueDict["ShowKilometer"] != "0") + { + settingValueDict.Add("ShowDistanceFields", "1"); + } + } + + manDc.Settings = ""; diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs index 17839f42d..f86b3dfbd 100644 --- a/Shared/BeWoEntityEnums.cs +++ b/Shared/BeWoEntityEnums.cs @@ -132,7 +132,8 @@ namespace BS.Shared ChatBewoMessageSync = 125, Feiertag = 126, NotizenKategorie = 127, - NotizenEintrag = 128 + NotizenEintrag = 128, + BuchungsExport = 129 } public enum SystemEntryID diff --git a/Shared/Core/Utils.cs b/Shared/Core/Utils.cs index 4c892d8f3..5da40a6f8 100644 --- a/Shared/Core/Utils.cs +++ b/Shared/Core/Utils.cs @@ -545,12 +545,20 @@ namespace BS.Shared.Core if (min.X < int.MaxValue && min.Y < int.MaxValue && max.X > int.MinValue && max.Y > int.MinValue) { Rectangle cropRectangle = new Rectangle(min.X, min.Y, max.X - min.X, max.Y - min.Y); - Bitmap newBitmap = new Bitmap(cropRectangle.Width, cropRectangle.Height); - using (Graphics g = Graphics.FromImage(newBitmap)) + if (cropRectangle.Width > 0 && cropRectangle.Height > 0) { - g.DrawImage(originalBitmap, 0, 0, cropRectangle, GraphicsUnit.Pixel); + Bitmap newBitmap = new Bitmap(cropRectangle.Width, cropRectangle.Height); + using (Graphics g = Graphics.FromImage(newBitmap)) + { + g.DrawImage(originalBitmap, 0, 0, cropRectangle, GraphicsUnit.Pixel); + } + + return newBitmap; + } + else + { + int test = 0; } - return newBitmap; } return originalBitmap; diff --git a/Shared/DataContracts/FinanceOverviewItemDC.cs b/Shared/DataContracts/FinanceOverviewItemDC.cs index b973c519b..81f73e645 100644 --- a/Shared/DataContracts/FinanceOverviewItemDC.cs +++ b/Shared/DataContracts/FinanceOverviewItemDC.cs @@ -27,6 +27,9 @@ namespace BS.Shared.DataContracts [DataMember] public decimal AmountPaid { get; set; } + //[DataMember] + //public decimal AmountPaidInReportTimeSpan { get; set; } + [DataMember] public decimal AmountTotal { get; set; }