diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index cf1c9e42d..afe378a23 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -43,12 +43,12 @@
de-DE
BeWoPlaner
ownSoft GmbH
- 2.0.1.290
+ 2.0.1.292
true
publish.htm
false
true
- 291
+ 293
2.0.1.%2a
false
true
diff --git a/BeWo/View/Detail/SupportConceptView.xaml b/BeWo/View/Detail/SupportConceptView.xaml
index 5209cacf4..c6d6e601b 100644
--- a/BeWo/View/Detail/SupportConceptView.xaml
+++ b/BeWo/View/Detail/SupportConceptView.xaml
@@ -138,7 +138,7 @@
-
+
diff --git a/BeWo/ViewModel/UserGroupVM.cs b/BeWo/ViewModel/UserGroupVM.cs
index a880cdb0a..fd90b932c 100644
--- a/BeWo/ViewModel/UserGroupVM.cs
+++ b/BeWo/ViewModel/UserGroupVM.cs
@@ -101,7 +101,7 @@ namespace BeWo.ViewModel
{(r) => r == UserRightType.SupportConcept_ImportData, BeWoApp.AppSettings.ShowPersehImport},
//{(r) => r == UserRightType.AiChatInZeiterfassung, BeWoApp.AppSettings.ShowAI},
{IsAiModuleRight, BeWoApp.AppSettings.ShowAI},
- {IsAiModuleSettingRight, BeWoApp.AppSettings.ModuleAiSettingsEnabled},
+ //{IsAiModuleSettingRight, BeWoApp.AppSettings.ModuleAiSettingsEnabled},
{(r) => r == UserRightType.AiVoiceView, BeWoApp.AppSettings.ShowAIVoice},
};
@@ -290,8 +290,8 @@ namespace BeWo.ViewModel
private static bool IsAiModuleRight(UserRightType right) =>
ContainsRight(right, UserRightType.AiModuleServiceRecordChat, UserRightType.AiModuleServiceRecordDocu, UserRightType.AiModulePromptbausteineEdit,
UserRightType.AiModulePromptbausteineView, UserRightType.AiModulePromptbausteinShare, UserRightType.AiVoiceView);
- private static bool IsAiModuleSettingRight(UserRightType right) =>
- ContainsRight(right);
+ //private static bool IsAiModuleSettingRight(UserRightType right) =>
+ // ContainsRight(right);
private static bool ContainsRight(UserRightType right, params UserRightType[] rightTypes)
{
diff --git a/Data/Security/UserRightHelper.cs b/Data/Security/UserRightHelper.cs
index 2d40e7fb0..5e3a3d8f9 100644
--- a/Data/Security/UserRightHelper.cs
+++ b/Data/Security/UserRightHelper.cs
@@ -195,8 +195,6 @@ namespace BeWo.Data.Security
return "3.29";
if (isRightVersion330(r))
return "3.30";
- if (isRightVersion3301(r))
- return "3.30.1";
return BASE_VERSION;
}
@@ -240,14 +238,11 @@ namespace BeWo.Data.Security
//|| r == UserRightType.AiModulePromptbausteineSeeAll
|| r == UserRightType.AiModulePromptbausteineView
//|| r == UserRightType.AiModulePromptbausteineExecute
+ || r == UserRightType.AiModulePromptbausteinShare
+ || r == UserRightType.AiModuleServiceRecordChat
+ || r == UserRightType.AiModuleServiceRecordDocu
|| r == UserRightType.AiVoiceView;
}
- private static bool isRightVersion3301(UserRightType r)
- {
- return r == UserRightType.AiModulePromptbausteinShare ||
- r == UserRightType.AiModuleServiceRecordChat ||
- r == UserRightType.AiModuleServiceRecordDocu;
- }
}
}
diff --git a/Report/DefaultReports/FLSSollIstWeeklyReport.cs b/Report/DefaultReports/FLSSollIstWeeklyReport.cs
index e03ed70e0..5a312213f 100644
--- a/Report/DefaultReports/FLSSollIstWeeklyReport.cs
+++ b/Report/DefaultReports/FLSSollIstWeeklyReport.cs
@@ -11,6 +11,9 @@ namespace BeWo.Report.DefaultReports
{
public partial class FLSSollIstWeeklyReport : DevExpress.XtraReports.UI.XtraReport, IBeWoReport
{
+ private Dictionary summeIstNachWochenString = new Dictionary();
+ private Dictionary diffNachWochenString = new Dictionary();
+
public FLSSollIstWeeklyReport()
{
InitializeComponent();
@@ -27,12 +30,35 @@ namespace BeWo.Report.DefaultReports
wochen = pRO.RootObjectList[0].Groups[0].WochenSummen;
}
}
-
+
+ //Berechne Wochen Ist Gesamt
+ foreach (var ro in pRO.RootObjectList)
+ {
+ foreach (var grp in ro.Groups)
+ {
+ foreach (var woche in grp.WochenSummen)
+ {
+ String key = GetWochenKey(woche);
+
+ if (!summeIstNachWochenString.ContainsKey(key))
+ {
+ summeIstNachWochenString.Add(key, 0);
+ diffNachWochenString.Add(key, (woche.SollStunden ?? 0) * -1);
+ }
+ summeIstNachWochenString[key] += woche.IstStunden ?? 0;
+ diffNachWochenString[key] += woche.IstStunden ?? 0;
+ }
+ }
+ }
CreateTableCells(wochen);
this.bindingSource1.DataSource = pRO;
}
+ private String GetWochenKey(FLSSollIstReportRO.FLSSollIstWochenSummen woche)
+ {
+ return String.Format("KW {0}, {1:dd.MM.yy} - {2:dd.MM.yy}", woche.KalenderWoche, woche.WocheStart, woche.WocheEnde);
+ }
private void CreateTableCells(List wochen)
{
xrTableHeader.BeginInit();
@@ -175,9 +201,19 @@ namespace BeWo.Report.DefaultReports
{
if (tag.Contains("Gesamt"))
{
+ var key = GetWochenKey(ws);
+
if (tag.Contains("Ist"))
- {
- cell.Text = String.Format("{0:0.00}", ws.IstStunden);
+ {
+ if (summeIstNachWochenString.ContainsKey(key))
+ {
+ cell.Text = String.Format("{0:0.00}", summeIstNachWochenString[key]);
+ }
+ else
+ {
+ cell.Text = String.Format("{0:0.00}", ws.IstStunden);
+ }
+
}
else if (tag.Contains("Soll"))
{
@@ -185,9 +221,15 @@ namespace BeWo.Report.DefaultReports
}
else if (tag.Contains("Diff"))
{
- cell.Text = String.Format("{0:0.00}", ws.Differenz);
+ decimal diff = ws.Differenz ?? 0;
- if (ws.Differenz < 0)
+ if (diffNachWochenString.ContainsKey(key))
+ {
+ diff = diffNachWochenString[key];
+ }
+ cell.Text = String.Format("{0:0.00}", diff);
+
+ if (diff < 0)
{
cell.ForeColor = System.Drawing.Color.Red;
}
diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs
index 2c7efe641..b2b52ea9c 100644
--- a/Service/Plugins/PluginLoader.cs
+++ b/Service/Plugins/PluginLoader.cs
@@ -170,7 +170,7 @@ namespace BeWo.Service.Plugins
//t = "7803602698"; // Taubblindendienst
//t = "5518600303"; // Wetterleuchten e.V.
//t = "4096649015"; // AWO Dortmund
- //t = "3614251071"; // Pusteblume
+ t = "3614251071"; // Pusteblume
//t = "7755740484"; // Sawo
//t = "8275654834"; // Twg Jonathan
//t = "6586058528"; // Freundeskreis Suchtkrankenhilfe e.V. (FFS)
@@ -427,7 +427,8 @@ namespace BeWo.Service.Plugins
//st = "6095094585"; // IBAHS e.V.
//t = "9453919144"; // Beratung am Stadtwald - Lisa Maria Reeh
//t = "5960095273"; // Flexible Jugendarbeit Frankfurt (Oder) e.V.
- t = "6664235818"; // PariMobil gGmbH Krefeld
+ //t = "6664235818"; // PariMobil gGmbH Krefeld
+
return t;
#else
if (MultitenancyOperationContextExt.Current != null)
diff --git a/Service/Plugins/SupportConceptValidator.cs b/Service/Plugins/SupportConceptValidator.cs
index 4b5dcc55d..d67826141 100644
--- a/Service/Plugins/SupportConceptValidator.cs
+++ b/Service/Plugins/SupportConceptValidator.cs
@@ -35,7 +35,7 @@ namespace BeWo.Service.Plugins
{
if (!containsDatumCheck)
{
- var val = CheckDate(c2s.StartDate, c2s.EndDate);
+ var val = CheckDate(c2s.StartDate, c2s.EndDate, c2s, null);
if (val != null)
{
result.Add(val);
@@ -48,7 +48,7 @@ namespace BeWo.Service.Plugins
{
if (!containsDatumCheck)
{
- val = CheckDate(ap.StartDate, ap.EndDate);
+ val = CheckDate(ap.StartDate, ap.EndDate, c2s, ap);
if (val != null)
{
result.Add(val);
@@ -66,12 +66,17 @@ namespace BeWo.Service.Plugins
return result;
}
- private ValidationResultDC CheckDate(DateTime? start, DateTime? end)
+ private ValidationResultDC CheckDate(DateTime? start, DateTime? end, SupportConceptCostBearerRelDC c2s, SupportConceptApprovalPeriodDC scap)
{
if (start.HasValue && end.HasValue && start > end)
{
ValidationResultDC resultDc = new ValidationResultDC();
resultDc.Message = "Das Startdatum darf nicht größer als das Enddatum sein.";
+
+ if (scap == null)
+ {
+
+ }
resultDc.AllowSave = false;
return resultDc;
}
diff --git a/Service/Reporting/Straffaelligenhilfe/AnnualReportFactory.cs b/Service/Reporting/Straffaelligenhilfe/AnnualReportFactory.cs
new file mode 100644
index 000000000..cd53f20e6
--- /dev/null
+++ b/Service/Reporting/Straffaelligenhilfe/AnnualReportFactory.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using BS.Shared;
+using BS.Shared.Core;
+using BS.Shared.DataContracts;
+using BS.Shared.Services;
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Service.DCEntityMapper;
+using BeWo.Service.Plugins;
+using Castle.Components.DictionaryAdapter;
+using NHibernate.Linq;
+
+namespace BeWo.Service.Reporting.Straffaelligenhilfe
+{
+ public class StatisticBase
+ {
+ protected DateTime StartDate { get; set; }
+ protected DateTime EndDate { get; set; }
+ protected Dictionary CustomerByOid { get; set; }
+
+ public virtual List CreateStatistic(DateTime startDate, DateTime endDate)
+ {
+ StartDate = startDate;
+ EndDate = endDate;
+ CustomerByOid = new Dictionary();
+
+ var reports = new List();
+
+ LoadData();
+
+ Dictionary customerOid2Days = new Dictionary();
+ StringBuilder sb = new StringBuilder();
+ foreach (var customerOid in CustomerByOid.Keys)
+ {
+ Customer customer = CustomerByOid[customerOid];
+ ProcessCustomer(customer);
+
+ }
+
+
+
+
+
+ return reports;
+ }
+
+ public virtual void LoadData()
+ {
+ foreach (var customer in DAOFactory.GenericDAO.GetAllActiveAndArchived())
+ {
+ if (ShouldProcessCustomer(customer))
+ {
+ if (!CustomerByOid.ContainsKey(customer.Oid.Value))
+ {
+ CustomerByOid.Add(customer.Oid.Value, customer);
+ }
+ }
+
+ }
+
+ }
+
+ public virtual void ProcessCustomer(Customer customer)
+ {
+
+ }
+
+ public virtual bool ShouldProcessCustomer(Customer customer)
+ {
+ if (customer .IsActive != ActivationTypeId.Deleted)
+ {
+ //if (CustomerBelongsToTeam(customer, TeamOid) &&
+ // IsCustomerOfCustomerCareType(customer, CustomerCareTypeValueListEntryOid))
+ //{
+ return true;
+ //}
+ }
+ return false;
+ }
+
+ public virtual bool IsCustomerOfCustomerCareType(Customer customer, long? customerCareTypeValueListEntryOid)
+ {
+ bool val = true;
+ if (customerCareTypeValueListEntryOid.HasValue)
+ {
+ val = false;
+ foreach (var v in customer.ValueList)
+ {
+ if (v.Entry.Type == ValueListEntryType.CustomerCareType && v.Entry.Oid == customerCareTypeValueListEntryOid)
+ return true;
+ }
+ }
+ return val;
+ }
+
+ public virtual bool CustomerBelongsToTeam(Customer customer, long? teamOid)
+ {
+ bool val = true;
+ if (teamOid.HasValue)
+ {
+ val = false;
+ foreach (var t2c in customer.Team2CustomerList)
+ {
+ if (t2c.TeamOid == teamOid)
+ return true;
+ }
+ }
+ return val;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Service/Service.csproj b/Service/Service.csproj
index c3f3f43b1..4693ab2eb 100644
--- a/Service/Service.csproj
+++ b/Service/Service.csproj
@@ -515,6 +515,7 @@
+
diff --git a/Service/ServiceImplementations/UserServiceImp.cs b/Service/ServiceImplementations/UserServiceImp.cs
index 7df54dc02..95de4aaa3 100644
--- a/Service/ServiceImplementations/UserServiceImp.cs
+++ b/Service/ServiceImplementations/UserServiceImp.cs
@@ -460,45 +460,43 @@ namespace BeWo.Service.ServiceImplementations
if (sha256 == "B2-FF-FF-CA-3E-DD-8F-8C-10-5A-05-C7-1F-EB-09-AF-3B-9B-DF-C7-B7-C2-6D-CC-34-56-17-DD-F3-28-B5-B1")
{
- //Hier einkommentieren wenn PIN aktiviert werden soll
+ //Hier einkommentieren wenn PIN aktiviert werden soll
- //if (!String.IsNullOrEmpty(pPIN) && pPIN.IndexOf('_') >= 0)
- //{
- // pin = pPIN.Substring(0, pPIN.IndexOf('_'));
- // computerName = pPIN.Substring(pPIN.IndexOf('_') + 1);
- //}
- //var pins = DAOFactory.GenericDAO.GetAll();
- //var y = pins.Where(p => p.Pin.Equals(pin)).ToList();
+ if (!String.IsNullOrEmpty(pPIN) && pPIN.IndexOf('_') >= 0)
+ {
+ pin = pPIN.Substring(0, pPIN.IndexOf('_'));
+ computerName = pPIN.Substring(pPIN.IndexOf('_') + 1);
+ }
+ var pins = DAOFactory.GenericDAO.GetAll();
+ var y = pins.Where(p => p.Pin.Equals(pin)).ToList();
- //if (y.Count == 0)
- //{
- // result = UserValidationResult.IncorrectPin;
- // valid = false;
- //}
- //else
- //{
- // supportPIN = y[0];
- // if (supportPIN.IsUsed.Value ||
- // supportPIN.ExpirationDate < DateTime.Now ||
- // supportPIN.UsingDate != null)
- // {
- // if (supportPIN.IsUsed.HasValue && supportPIN.IsUsed.Value)
- // result = UserValidationResult.PinAlreadyUsed;
- // else if (supportPIN.ExpirationDate < DateTime.Now)
- // result = UserValidationResult.PinExpired;
- // valid = false;
- // }
- // else
- // {
- // supportPIN.IsUsed = true;
- // supportPIN.UsingDate = DateTime.Now;
- // supportPIN.Notice = computerName;
- // }
- //}
+ if (y.Count == 0)
+ {
+ result = UserValidationResult.IncorrectPin;
+ valid = false;
+ }
+ else
+ {
+ supportPIN = y[0];
+ if (supportPIN.ExpirationDate < DateTime.Now)
+ {
+ //if (supportPIN.IsUsed.HasValue && supportPIN.IsUsed.Value)
+ // result = UserValidationResult.PinAlreadyUsed;
+ //else if (supportPIN.ExpirationDate < DateTime.Now)
+ result = UserValidationResult.PinExpired;
+ valid = false;
+ }
+ else
+ {
+ supportPIN.IsUsed = true;
+ supportPIN.UsingDate = DateTime.Now;
+ supportPIN.Notice = computerName;
+ }
+ }
- //Bis hier einkommentieren
- }
+ //Bis hier einkommentieren
+ }
}
if (!result.HasValue)
@@ -846,6 +844,8 @@ namespace BeWo.Service.ServiceImplementations
{
try
{
+ //pSupportPin.ExpirationDate = DateTime.Now.AddDays(3);
+
var lSupportPin = MapperFactory.SupportPinDC_SupportPin.MapToNewEntity(pSupportPin);
DAOFactory.GenericDAO.Insert(lSupportPin);
return lSupportPin.Oid.Value;