diff --git a/BeWo/BeWoApp.xaml.cs b/BeWo/BeWoApp.xaml.cs
index 2b85a65a3..adb341446 100644
--- a/BeWo/BeWoApp.xaml.cs
+++ b/BeWo/BeWoApp.xaml.cs
@@ -239,6 +239,18 @@ namespace BeWo
isServiceRecordNoticeMandatory = false;
}
+ val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.IsServiceRecordGoalMandatory);
+ if (val != null && val.Equals("1"))
+ {
+ AppSettings.IsServiceRecordGoalMandatory = true;
+ }
+
+ val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.IsServiceRecordRatingMandatory);
+ if (val != null && val.Equals("1"))
+ {
+ AppSettings.IsServiceRecordRatingMandatory = true;
+ }
+
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.IsPasswordSecurityActiv);
if (val != null && val.Equals("1"))
{
@@ -491,9 +503,9 @@ namespace BeWo
AppSettings.ShowKlientenBetreuungszeiten = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.FilterGroupServiceCategories);
- if (val != null && val.Equals("0"))
+ if (val != null && val.Equals("1"))
{
- AppSettings.FilterGroupServiceCategories = false;
+ AppSettings.FilterGroupServiceCategories = true;
}
val = UserSettingsUtils.GetSettingValue(_Mandator.Settings, SettingsKeys.ShowInfoButtonInCalender);
if (val != null && val.Equals("1"))
diff --git a/BeWo/Core/BeWoUtils.cs b/BeWo/Core/BeWoUtils.cs
index 4179e7049..a09166a22 100644
--- a/BeWo/Core/BeWoUtils.cs
+++ b/BeWo/Core/BeWoUtils.cs
@@ -63,6 +63,7 @@ using BeWo.View.Detail.Zeiterfassung;
using DevExpress.Xpf.Scheduling;
using CommandBarStyle = DevExpress.Xpf.DocumentViewer.CommandBarStyle;
using ImageSource = System.Windows.Media.ImageSource;
+using BS.Shared.Translation;
namespace BeWo.Core
{
@@ -1666,11 +1667,19 @@ namespace BeWo.Core
MessageBox.Show("Bitte wählen Sie eine Leistung aus. Sollten keine Leistungen für die gewählte Kategorie verfügbar sein, müssen diese zunächst in der Verwaltung angelegt werden.", "Speichern", MessageBoxButton.OK, MessageBoxImage.Information);
return false;
}
- if(vm.GoalTree != null && vm.GoalTree.Count > 0 && (cb2ScOids == null || cb2ScOids.Count < 2))
+ if(vm.GoalTree != null && vm.GoalTree.Count > 0)
{
- if(vm.SelectedGoals.Count == 0 && MessageBox.Show("Es wurde kein Ziel zugeordnet. Sind Sie sicher, dass Sie speichern möchten?", "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
+ if(vm.SelectedGoals.Count == 0)
{
- return false;
+ if (BeWoApp.AppSettings.IsServiceRecordGoalMandatory)
+ {
+ MessageBox.Show(Translator.Translate("Sie müssen mindestens ein Ziel auswählen, bevor Sie speichern können."), "Speichern", MessageBoxButton.OK, MessageBoxImage.Exclamation);
+ return false;
+ }
+ else if (MessageBox.Show("Es wurde kein Ziel zugeordnet. Sind Sie sicher, dass Sie speichern möchten?", "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
+ {
+ return false;
+ }
}
}
diff --git a/BeWo/Core/Config/AppSettings.cs b/BeWo/Core/Config/AppSettings.cs
index 30b0b0f66..9e94d1c87 100644
--- a/BeWo/Core/Config/AppSettings.cs
+++ b/BeWo/Core/Config/AppSettings.cs
@@ -11,6 +11,8 @@ namespace BeWo.Core.Config
public class AppSettings
{
private bool mIsServiceRecordNoticeMandatory = true;
+ private bool mIsServiceRecordGoalMandatory = false;
+ private bool mIsServiceRecordRatingMandatory = false;
private bool mIsPasswordSecurityActiv = false;
@@ -28,7 +30,7 @@ namespace BeWo.Core.Config
private bool _showExpiredSupportConcepts = true;
private bool _showServiceRecordGridControl = true;
- private bool _filterGroupServiceCategories = true;
+ private bool _filterGroupServiceCategories = false;
private bool mOpenReportInNewWindow = false;
private WindowStateType mWindowStateType = WindowStateType.Default;
@@ -67,6 +69,19 @@ namespace BeWo.Core.Config
set { mIsServiceRecordNoticeMandatory = value; }
}
+ public bool IsServiceRecordGoalMandatory
+ {
+ get { return mIsServiceRecordGoalMandatory; }
+
+ set { mIsServiceRecordGoalMandatory = value; }
+ }
+
+ public bool IsServiceRecordRatingMandatory
+ {
+ get { return mIsServiceRecordRatingMandatory; }
+
+ set { mIsServiceRecordRatingMandatory = value; }
+ }
public bool IsPasswordSecurityActiv
{
get { return mIsPasswordSecurityActiv; }
diff --git a/BeWo/View/Detail/MandatorView.xaml b/BeWo/View/Detail/MandatorView.xaml
index 91bdc02c1..95aca54f6 100644
--- a/BeWo/View/Detail/MandatorView.xaml
+++ b/BeWo/View/Detail/MandatorView.xaml
@@ -346,6 +346,9 @@
+
+
+
@@ -358,9 +361,26 @@
Margin="3,5,3,5"
Content="{markup:Translate Dokumentationstext in der Zeiterfassung Pflichtfeld}"
IsChecked="{Binding Path=IsServiceRecordNoticeMandatory}" />
-
-
+
+
+
a.Name.Equals(newName)))
+ while(ViewModel.VMList.Any(a => a.Name != null && a.Name.Equals(newName)))
{
newName = pName + " " + counter;
counter++;
diff --git a/BeWo/View/EmployeeArbeitszeitView.xaml b/BeWo/View/EmployeeArbeitszeitView.xaml
index aaf2e3308..ff5fd42da 100644
--- a/BeWo/View/EmployeeArbeitszeitView.xaml
+++ b/BeWo/View/EmployeeArbeitszeitView.xaml
@@ -96,109 +96,108 @@
-
+ />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
+
+
+
+
-
+
+
diff --git a/BeWo/ViewModel/MandatorVM.cs b/BeWo/ViewModel/MandatorVM.cs
index a26afe292..55937b7bd 100644
--- a/BeWo/ViewModel/MandatorVM.cs
+++ b/BeWo/ViewModel/MandatorVM.cs
@@ -140,6 +140,48 @@ namespace BeWo.ViewModel
}
}
}
+ public bool IsServiceRecordGoalMandatory
+ {
+ get { return BeWoApp.AppSettings.IsServiceRecordGoalMandatory; }
+
+ set
+ {
+ if (this.AreDifferent(BeWoApp.AppSettings.IsServiceRecordGoalMandatory, value))
+ {
+ BeWoApp.AppSettings.IsServiceRecordGoalMandatory = value;
+
+ this.Settings = UserSettingsUtils.CreateNewSettingValue(this._Settings, "IsServiceRecordGoalMandatory", value ? "1" : "0");
+ }
+ }
+ }
+ public bool IsServiceRecordRatingMandatory
+ {
+ get { return BeWoApp.AppSettings.IsServiceRecordRatingMandatory; }
+
+ set
+ {
+ if (this.AreDifferent(BeWoApp.AppSettings.IsServiceRecordRatingMandatory, value))
+ {
+ BeWoApp.AppSettings.IsServiceRecordRatingMandatory = value;
+
+ this.Settings = UserSettingsUtils.CreateNewSettingValue(this._Settings, "IsServiceRecordRatingMandatory", value ? "1" : "0");
+ }
+ }
+ }
+ public bool FilterGroupServiceCategories
+ {
+ get { return BeWoApp.AppSettings.FilterGroupServiceCategories; }
+
+ set
+ {
+ if (this.AreDifferent(BeWoApp.AppSettings.FilterGroupServiceCategories, value))
+ {
+ BeWoApp.AppSettings.FilterGroupServiceCategories = value;
+
+ this.Settings = UserSettingsUtils.CreateNewSettingValue(this._Settings, "FilterGroupServiceCategories", value ? "1" : "0");
+ }
+ }
+ }
public bool IsPasswordSecurityActiv
{
get { return BeWoApp.AppSettings.IsPasswordSecurityActiv; }
diff --git a/Data/Data.csproj b/Data/Data.csproj
index 5465251e0..b48050a2a 100644
--- a/Data/Data.csproj
+++ b/Data/Data.csproj
@@ -206,6 +206,7 @@
+
@@ -405,6 +406,7 @@
+
@@ -780,6 +782,9 @@
+
+ Designer
+
Designer
diff --git a/Data/Entities/AbsenceTimeHistory.cs b/Data/Entities/AbsenceTimeHistory.cs
new file mode 100644
index 000000000..0942df4e5
--- /dev/null
+++ b/Data/Entities/AbsenceTimeHistory.cs
@@ -0,0 +1,34 @@
+using System;
+
+using BS.Shared;
+using BS.Shared.Core;
+
+namespace BeWo.Data.Entities
+{
+ public class AbsenceTimeHistory : BeWoEntityBase
+ {
+
+ public AbsenceTimeHistory()
+ {
+ this._Tid = TableID.AbsenceTimeHistory;
+ }
+
+ public virtual StatementType ChangeType { get; set; }
+
+ public virtual long AbsenceTimeOid { get; set; }
+
+ public virtual long? AbsenceReasonOid { get; set; }
+
+ public virtual DateTime? AbsenceTimeEnd { get; set; }
+
+ public virtual DateTime? AbsenceTimeStart { get; set; }
+
+ public virtual DateTime? AbsenceTimeKrankheitsMeldung { get; set; }
+
+ public virtual long? AbsenceTimeCustomerOid { get; set; }
+
+ public virtual long? AbsenceTimeEmployeeOid { get; set; }
+
+ public virtual String AbsenceTimeNotice { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Data/Entities/ContractHistory.cs b/Data/Entities/ContractHistory.cs
index f241663b2..dd37b46ab 100644
--- a/Data/Entities/ContractHistory.cs
+++ b/Data/Entities/ContractHistory.cs
@@ -59,18 +59,6 @@ namespace BeWo.Data.Entities
}
}
- public virtual EmploymentType ContractHistoryEmploymentType
- {
- get { return this._EmploymentType; }
-
- set
- {
- if (this.AreDifferent(this._EmploymentType, value))
- {
- this._EmploymentType = value;
- }
- }
- }
public virtual decimal? ContractHistoryLeaveDays
{
@@ -195,12 +183,16 @@ namespace BeWo.Data.Entities
}
}
- public virtual CostRatePeriod ContractHistoryHourlyRateCostRateValue { get; set; }
-
public virtual decimal? ContractHistoryProbationPeriod2 { get; set; }
- public virtual ValueListEntry ContractHistoryContractTypeValueListEntry { get; set; }
+ public virtual long? ContractOid { get; set; }
- public virtual ValueListEntry ContractHistoryQualifikationsBedarfValueListEntry { get; set; }
+ public virtual long? ContractHistoryEmploymentTypeOid { get; set; }
+
+ public virtual long? ContractHistoryHourlyRateCostRateValueOid { get; set; }
+
+ public virtual long? ContractHistoryContractTypeValueListEntryOid { get; set; }
+
+ public virtual long? ContractHistoryQualifikationsBedarfValueListEntryOid { get; set; }
}
}
diff --git a/Data/Mappings/AbsenceTime.hbm.xml b/Data/Mappings/AbsenceTime.hbm.xml
index a3e301d50..f1dd7482d 100644
--- a/Data/Mappings/AbsenceTime.hbm.xml
+++ b/Data/Mappings/AbsenceTime.hbm.xml
@@ -13,6 +13,7 @@
+
diff --git a/Data/Mappings/AbsenceTimeHistory.hbm.xml b/Data/Mappings/AbsenceTimeHistory.hbm.xml
new file mode 100644
index 000000000..53b828397
--- /dev/null
+++ b/Data/Mappings/AbsenceTimeHistory.hbm.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Data/Mappings/Contract.hbm.xml b/Data/Mappings/Contract.hbm.xml
index fe58c9ef0..d0b25cb67 100644
--- a/Data/Mappings/Contract.hbm.xml
+++ b/Data/Mappings/Contract.hbm.xml
@@ -9,6 +9,7 @@
+
diff --git a/Data/Mappings/ContractHistory.hbm.xml b/Data/Mappings/ContractHistory.hbm.xml
index 1d5010cf5..c075a23df 100644
--- a/Data/Mappings/ContractHistory.hbm.xml
+++ b/Data/Mappings/ContractHistory.hbm.xml
@@ -28,10 +28,11 @@
-
-
-
-
+
+
+
+
+
diff --git a/Data/Utils/ServiceRecord2SignatureStates.cs b/Data/Utils/ServiceRecord2SignatureStates.cs
new file mode 100644
index 000000000..ad22ab4aa
--- /dev/null
+++ b/Data/Utils/ServiceRecord2SignatureStates.cs
@@ -0,0 +1,43 @@
+using BeWo.Data.Entities;
+using BS.Shared;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.Data.Utils
+{
+ public class ServiceRecord2SignatureStates
+ {
+ public ServiceRecord ServiceRecord { get; }
+ public SignatureStateType? SingleSignatureStateType { get; set; }
+ public SignatureStateType? CustomerMonthlySignatureStateType { get; set; }
+ public SignatureStateType? EmployeeMonthlySignatreStateType { get; set; }
+
+ ///
+ /// Erzeugt das Objekt mit den SignatureStates. Wird als Wert eines States null übergeben, wird beim Erzeugen des ServiceRecordHistory-Eintrags der Wert des vorherigen ServiceRecordHistory-Eintrags genommen, falls vorhanden.
+ ///
+ ///
+ ///
+ ///
+ ///
+ public ServiceRecord2SignatureStates(ServiceRecord serviceRecord, SignatureStateType? singleSignatureStateType, SignatureStateType? customerMonthlySignatureStateType, SignatureStateType? employeeMonthlySignatreStateType)
+ {
+ ServiceRecord = serviceRecord;
+ SingleSignatureStateType = singleSignatureStateType;
+ CustomerMonthlySignatureStateType = customerMonthlySignatureStateType;
+ EmployeeMonthlySignatreStateType = employeeMonthlySignatreStateType;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is ServiceRecord2SignatureStates sr2Ss && sr2Ss.ServiceRecord != null)
+ {
+ return ServiceRecord?.Equals(sr2Ss.ServiceRecord) ?? false;
+ }
+
+ return false;
+ }
+ }
+}
diff --git a/Host/Host.csproj.user b/Host/Host.csproj.user
index 5ea61a6ef..f8b116048 100644
--- a/Host/Host.csproj.user
+++ b/Host/Host.csproj.user
@@ -1,4 +1,4 @@
-
+
BeWo2.0
@@ -10,7 +10,7 @@
- ShowAllFiles
+ ProjectFiles
diff --git a/Model/Changes_2025_03_07 AbsenceTimeHistory.txt b/Model/Changes_2025_03_07 AbsenceTimeHistory.txt
new file mode 100644
index 000000000..620e1d5eb
--- /dev/null
+++ b/Model/Changes_2025_03_07 AbsenceTimeHistory.txt
@@ -0,0 +1,31 @@
+ALTER TABLE `Contract`
+ADD COLUMN `UpdTs` datetime NULL DEFAULT NULL;
+
+ALTER TABLE `ContractHistory`
+ADD COLUMN `ContractOid` bigint NULL DEFAULT NULL;
+
+ALTER TABLE `AbsenceTime`
+ADD COLUMN `UpdTs` datetime NULL DEFAULT NULL;
+
+CREATE TABLE `AbsenceTimeHistory` (
+ `Oid` bigint NOT NULL AUTO_INCREMENT,
+ `Tid` int NOT NULL,
+ `Notice` varchar(1024) DEFAULT NULL,
+ `InsTs` datetime DEFAULT NULL,
+ `InsUser` varchar(256) DEFAULT NULL,
+ `Version` bigint DEFAULT NULL,
+ `UdpUser` varchar(256) DEFAULT NULL,
+ `UpdTs` datetime DEFAULT NULL,
+ `IsActive` tinyint DEFAULT NULL,
+ `SystemEntryID` int DEFAULT NULL,
+ `ChangeType` tinyint NULL DEFAULT NULL,
+ `AbsenceTimeOid` bigint NULL DEFAULT NULL,
+ `AbsenceReasonOid` bigint DEFAULT NULL,
+ `AbsenceTimeStart` datetime DEFAULT NULL,
+ `AbsenceTimeEnd` datetime DEFAULT NULL,
+ `AbsenceTimeKrankheitsMeldung` datetime DEFAULT NULL,
+ `AbsenceTimeNotice` varchar(1024) DEFAULT NULL,
+ `AbsenceTimeEmployeeOid` bigint DEFAULT NULL,
+ `AbsenceTimeCustomerOid` bigint DEFAULT NULL,
+ PRIMARY KEY (`Oid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/Model/Changes_alle_fuer_neue_db.txt b/Model/Changes_alle_fuer_neue_db.txt
index 491fffa22..fba847ac8 100644
--- a/Model/Changes_alle_fuer_neue_db.txt
+++ b/Model/Changes_alle_fuer_neue_db.txt
@@ -1419,6 +1419,7 @@ ADD COLUMN `CustomDate3` datetime NULL DEFAULT NULL,
ADD COLUMN `CustomDate4` datetime NULL DEFAULT NULL,
ADD COLUMN `CustomDate5` datetime NULL DEFAULT NULL;
+
CREATE TABLE `gkvabrechnung` (
`Oid` bigint NOT NULL AUTO_INCREMENT,
`Tid` int NOT NULL,
@@ -1484,4 +1485,42 @@ CREATE TABLE `gkvtransferprotokoll` (
PRIMARY KEY (`Oid`),
KEY `FK_GKVTRANSFERPROTOKOLL_GKVABRECHNUNG` (`GkvAbrechnungOid`),
CONSTRAINT `FK_GKVTRANSFERPROTOKOLL_GKVABRECHNUNG` FOREIGN KEY (`GkvAbrechnungOid`) REFERENCES `gkvabrechnung` (`Oid`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+ALTER TABLE `gkvabrechnung`
+ADD COLUMN `OrganisationOid` BIGINT NULL DEFAULT NULL AFTER `Verfahrensstufe`;
+
+ALTER TABLE `Parameter`
+ADD COLUMN `DefaultValue` VARCHAR(256) NULL DEFAULT NULL;
+
+ALTER TABLE `Contract`
+ADD COLUMN `UpdTs` datetime NULL DEFAULT NULL;
+
+ALTER TABLE `ContractHistory`
+ADD COLUMN `ContractOid` bigint NULL DEFAULT NULL;
+
+ALTER TABLE `AbsenceTime`
+ADD COLUMN `UpdTs` datetime NULL DEFAULT NULL;
+
+CREATE TABLE `AbsenceTimeHistory` (
+ `Oid` bigint NOT NULL AUTO_INCREMENT,
+ `Tid` int NOT NULL,
+ `Notice` varchar(1024) DEFAULT NULL,
+ `InsTs` datetime DEFAULT NULL,
+ `InsUser` varchar(256) DEFAULT NULL,
+ `Version` bigint DEFAULT NULL,
+ `UdpUser` varchar(256) DEFAULT NULL,
+ `UpdTs` datetime DEFAULT NULL,
+ `IsActive` tinyint DEFAULT NULL,
+ `SystemEntryID` int DEFAULT NULL,
+ `ChangeType` tinyint NULL DEFAULT NULL,
+ `AbsenceTimeOid` bigint NULL DEFAULT NULL,
+ `AbsenceReasonOid` bigint DEFAULT NULL,
+ `AbsenceTimeStart` datetime DEFAULT NULL,
+ `AbsenceTimeEnd` datetime DEFAULT NULL,
+ `AbsenceTimeKrankheitsMeldung` datetime DEFAULT NULL,
+ `AbsenceTimeNotice` varchar(1024) DEFAULT NULL,
+ `AbsenceTimeEmployeeOid` bigint DEFAULT NULL,
+ `AbsenceTimeCustomerOid` bigint DEFAULT NULL,
+ PRIMARY KEY (`Oid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/Queries/Einträge ohne Monatsunterschrift der Hauptbetreuung.txt b/Queries/Einträge ohne Monatsunterschrift der Hauptbetreuung.txt
index 8c373e71a..c8cfca25c 100644
--- a/Queries/Einträge ohne Monatsunterschrift der Hauptbetreuung.txt
+++ b/Queries/Einträge ohne Monatsunterschrift der Hauptbetreuung.txt
@@ -26,9 +26,6 @@ order by p.Lastname, sr.startdate
-INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4713,24,0,'Einträge ohne Monatsunterschrift der Hauptbetreuung','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.oid \nnot in (select servicerecordoid from confirmationreceiptsignature2servicerecord crs2s\njoin confirmationreceiptsignature crs on crs2s.confirmationreceiptsignatureoid = crs.oid where crs.employeeoid is not null and crs.customeroid is null) and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL);
+INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4713,24,0,'Einträge ohne Monatsunterschrift der Hauptbetreuung','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.oid \nnot in (select servicerecordoid from confirmationreceiptsignature2servicerecord crs2s\njoin confirmationreceiptsignature crs on crs2s.confirmationreceiptsignatureoid = crs.oid where crs.employeeoid is not null and crs.customeroid is null) and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,`1`,NULL,NULL,NULL);
INSERT INTO `parameter` (`QueryOid`,`Tid`,`Name`,`Type`,`DbType`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`DefaultValue`) VALUES (4713,25,'Von_bis',5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'aktueller Monat');
-
-
-
diff --git a/Queries/Einträge ohne Monatsunterschrift des Klienten.txt b/Queries/Einträge ohne Monatsunterschrift des Klienten.txt
index e6602ff6c..4b86493d1 100644
--- a/Queries/Einträge ohne Monatsunterschrift des Klienten.txt
+++ b/Queries/Einträge ohne Monatsunterschrift des Klienten.txt
@@ -27,7 +27,7 @@ order by p.Lastname, sr.startdate
-INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4712,24,0,'Einträge ohne Monatsunterschrift des Klienten','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.oid \nnot in (select servicerecordoid from confirmationreceiptsignature2servicerecord crs2s\njoin confirmationreceiptsignature crs on crs2s.confirmationreceiptsignatureoid = crs.oid where crs.employeeoid is null and crs.customeroid is not null) and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL);
+INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4712,24,0,'Einträge ohne Monatsunterschrift des Klienten','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.oid \nnot in (select servicerecordoid from confirmationreceiptsignature2servicerecord crs2s\njoin confirmationreceiptsignature crs on crs2s.confirmationreceiptsignatureoid = crs.oid where crs.employeeoid is null and crs.customeroid is not null) and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,`1`,NULL,NULL,NULL);
INSERT INTO `parameter` (`QueryOid`,`Tid`,`Name`,`Type`,`DbType`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`DefaultValue`) VALUES (4712,25,'Von_bis',5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'aktueller Monat');
diff --git a/Queries/Fehlende Einzelunterschriften im ausgewählten Zeitaum.txt b/Queries/Fehlende Einzelunterschriften im ausgewählten Zeitaum.txt
index 415363fda..3d27c210a 100644
--- a/Queries/Fehlende Einzelunterschriften im ausgewählten Zeitaum.txt
+++ b/Queries/Fehlende Einzelunterschriften im ausgewählten Zeitaum.txt
@@ -26,7 +26,7 @@ order by p.Lastname, sr.startdate
-INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4711,24,0,'Einträge ohne Unterschrift','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.SignatureOID is null and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,NULL,NULL,NULL,NULL);
+INSERT INTO `query` (`Oid`,`Tid`,`Type`,`Title`,`SQL`,`Notice`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`UserGroupOids`,`ReportTypeName`,`FileName`,`ExportTitle`) VALUES (4711,24,0,'Einträge ohne Unterschrift','SELECT \np.LastName as \'Nachname\',\np.Firstname as \'Vorname\',\nc2s.ApprovedStartDate as \'Bewilligt von\',\nc2s.ApprovedEndDate as \'Bewilligt bis\',\nscat.Name as \'Kategorie\',\nDate_Format(sr.StartDate, \'%d.%m.%Y\') as \'Datum\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(sr.StartDate, \'%H:%i\')) as \'von\',\nIF (Date_Format(sr.StartDate, \'%s\') <> \'00\', \'\', Date_Format(Date_Add(sr.StartDate, INTERVAL sr.Roundedduration MINUTE), \'%H:%i\')) as \'bis\',\nRound(sr.Roundedduration, 0) as \'Minuten\',\n(select CONCAT(emp1p.`FirstName`, \' \', emp1p.`LastName`) from employee emp1 join `person` emp1p on emp1p.`Oid` = emp1.`PersonOid` where emp1.`Oid` in (select employeeoid from `employee2customer` e2c1 join `valuelistentry2object` vl2o on e2c1.`Oid` = vl2o.`ObjectOid` join `valuelistentry` vle on vl2o.`ValueListEntryOid` = vle.`Oid` where e2c1.`CustomerOid` = c.`Oid` and vle.`SystemEntryID` = 3) LIMIT 1) as \'Hauptbetreuung\',\n(select t.`Name` from team t where t.`Oid` in (select teamoid from `team2customer` t2c where t2c.`CustomerOid` = c.`Oid`) LIMIT 1) as \'Team\' \nFROM servicerecord sr\njoin costbearer2supportconcept c2s on sr.costbearer2supportconceptoid = c2s.oid\njoin supportconcept sc on c2s.supportconceptoid = sc.oid\njoin customer c on sc.customeroid = c.oid\njoin person p on c.personoid = p.oid\njoin servicedescription sd on sd.oid = sr.servicedescriptionoid\njoin servicecategory scat on scat.oid = sd.servicecategoryoid\nwhere sr.SignatureOID is null and\nscat.billable = true and\nsr.startdate >= \':Von\' and sr.startdate < \':bis\'\norder by p.Lastname, sr.startdate',NULL,NULL,NULL,NULL,1,1,NULL,`1`,NULL,NULL,NULL);
INSERT INTO `parameter` (`QueryOid`,`Tid`,`Name`,`Type`,`DbType`,`InsTs`,`InsUser`,`UdpUser`,`Version`,`IsActive`,`SystemEntryID`,`DefaultValue`) VALUES (4711,25,'Von_bis',5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'aktueller Monat');
diff --git a/ReportImp/AlphaEv/Invoicing/CustomInvoiceCreation.cs b/ReportImp/AlphaEv/Invoicing/CustomInvoiceCreation.cs
index 0f8aeddde..8438b1640 100644
--- a/ReportImp/AlphaEv/Invoicing/CustomInvoiceCreation.cs
+++ b/ReportImp/AlphaEv/Invoicing/CustomInvoiceCreation.cs
@@ -22,8 +22,10 @@ namespace AlphaEv.Invoicing
public override ServiceInvoice CreateSingleInvoice(int invoiceCounter, CostBearer costBearer, DateTimeSpan invoicePeriod, CompactSupportConceptDC supportConcept, List serviceRecords)
{
var invoice = base.CreateSingleInvoice(invoiceCounter, costBearer, invoicePeriod, supportConcept, serviceRecords);
- SetAmountAdvancePayments(invoice);
-
+ if (invoice != null)
+ {
+ SetAmountAdvancePayments(invoice);
+ }
return invoice;
}
public override InvoiceItem CreateInvoiceItem(ServiceRecordDC iServiceRecord, SupportConceptApprovalPeriod scap, Calculations calc)
diff --git a/ReportImp/ChristopherusHausMID/Leistungsnachweis.designer.cs b/ReportImp/ChristopherusHausMID/Leistungsnachweis.designer.cs
index 634d6c64c..6e7364970 100644
--- a/ReportImp/ChristopherusHausMID/Leistungsnachweis.designer.cs
+++ b/ReportImp/ChristopherusHausMID/Leistungsnachweis.designer.cs
@@ -765,7 +765,7 @@ namespace ChristopherusHausMID
this.xrTable3.Name = "xrTable3";
this.xrTable3.Rows.AddRange(new DevExpress.XtraReports.UI.XRTableRow[] {
this.xrTableRow5});
- this.xrTable3.SizeF = new System.Drawing.SizeF(747F, 25F);
+ this.xrTable3.SizeF = new System.Drawing.SizeF(745F, 25F);
this.xrTable3.StylePriority.UseBorders = false;
this.xrTable3.StylePriority.UseFont = false;
this.xrTable3.StylePriority.UsePadding = false;
@@ -814,7 +814,7 @@ namespace ChristopherusHausMID
xrSummary1.Running = DevExpress.XtraReports.UI.SummaryRunning.Group;
this.xrTableCell42.Summary = xrSummary1;
this.xrTableCell42.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight;
- this.xrTableCell42.Weight = 0.20955252338615338D;
+ this.xrTableCell42.Weight = 0.20405005159415032D;
//
// GroupFooter2
//
diff --git a/ReportImp/HphBersenbrueckFreizeitUndReisen/Helferentgelt.cs b/ReportImp/HphBersenbrueckFreizeitUndReisen/Helferentgelt.cs
index fe467965a..0b6bfd642 100644
--- a/ReportImp/HphBersenbrueckFreizeitUndReisen/Helferentgelt.cs
+++ b/ReportImp/HphBersenbrueckFreizeitUndReisen/Helferentgelt.cs
@@ -123,7 +123,10 @@ namespace HphBersenbrueckFreizeitUndReisen
var serviceRecords = DAOFactory.SearchDAO.FindEmployeeServiceRecords(emp.Oid.Value, span, null, null);
-
+ if (ro.KlientVorname == "Herbort")
+ {
+ int test = 0;
+ }
//Eingliederungshilfe Einzelbetreuung
@@ -344,15 +347,18 @@ namespace HphBersenbrueckFreizeitUndReisen
//Kostenstelle 35950
else if ((desc.Contains("Freizeitangebote") || desc.Contains("Freizeittreff") || desc.Contains("Tagesfahrt") || desc.Contains("Freizeithelfer")) && (cat.Contains("Entlastungsbetrag") || cat.Contains("Verhinderungspflege") || cat.Contains("Selbstzahler") || cat.Contains("Helferentgelt")))
{
- add = true;
+ if (sr.RoundedDuration > 0)
+ {
+ add = true;
- if (isMinijobber)
- {
- ro.StundenLoa51_35950 = (ro.StundenLoa51_35950 ?? 0) + sr.RoundedDuration / 60;
- }
- else
- {
- ro.StundenLoA44_35950 = (ro.StundenLoA44_35950 ?? 0) + sr.RoundedDuration / 60;
+ if (isMinijobber)
+ {
+ ro.StundenLoa51_35950 = (ro.StundenLoa51_35950 ?? 0) + sr.RoundedDuration / 60;
+ }
+ else
+ {
+ ro.StundenLoA44_35950 = (ro.StundenLoA44_35950 ?? 0) + sr.RoundedDuration / 60;
+ }
}
}
//Kostenstelle 35900
@@ -373,7 +379,12 @@ namespace HphBersenbrueckFreizeitUndReisen
{
add = true;
- ro.FührungszeugnisseLoa494 = (ro.FührungszeugnisseLoa494 ?? 0) + sr.RoundedDuration / 60;
+ var preis = GetPreisVonServiceDescription(sr.ServiceDescription, reportMonat);
+ if (preis.HasValue)
+ {
+ ro.FührungszeugnisseLoa494 = (ro.FührungszeugnisseLoa494 ?? 0) + preis;
+ }
+ //ro.FührungszeugnisseLoa494 = (ro.FührungszeugnisseLoa494 ?? 0) + sr.RoundedDuration / 60;
}
if (sr.DistanceInMeter.HasValue)
{
diff --git a/ReportImp/InputFamilienhilfe/CustomMitarbeiterstundenkontoBerechnung.cs b/ReportImp/InputFamilienhilfe/CustomMitarbeiterstundenkontoBerechnung.cs
index 7e192ca84..e5a8f9e3a 100644
--- a/ReportImp/InputFamilienhilfe/CustomMitarbeiterstundenkontoBerechnung.cs
+++ b/ReportImp/InputFamilienhilfe/CustomMitarbeiterstundenkontoBerechnung.cs
@@ -23,14 +23,17 @@ namespace InputFamilienhilfe
public override decimal GetFeiertagsFaktor(DateTime start)
{
- if (start.Month == 12)
+ //CB: Halbe Feiertage erst ab 2024
+ if (start.Year >= 2024)
{
- if (start.Day == 24 || start.Day == 31)
+ if (start.Month == 12)
{
- return 0.5m;
+ if (start.Day == 24 || start.Day == 31)
+ {
+ return 0.5m;
+ }
}
}
-
return base.GetFeiertagsFaktor(start);
}
diff --git a/ReportImp/InputFamilienhilfe/Service/CustomVacationService.cs b/ReportImp/InputFamilienhilfe/Service/CustomVacationService.cs
index 207d0c3a3..c906c34d1 100644
--- a/ReportImp/InputFamilienhilfe/Service/CustomVacationService.cs
+++ b/ReportImp/InputFamilienhilfe/Service/CustomVacationService.cs
@@ -15,19 +15,32 @@ namespace InputFamilienhilfe.Service
List list = base.GetFeiertage(year, bundesland);
list.Add(new FeiertagDC { Datum = new DateTime(year, 1, 6), Name = "Heilige Drei Könige" });
- list.Add(new FeiertagDC { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
+ //Ab 2024 sind Heilig Abend und Silverster nur halbe Feiertag, vorher gar kein Feiertag
+ if (year >= 2024)
+ {
+ list.Add(new FeiertagDC { Datum = new DateTime(year, 12, 31), Name = "Silvester" });
+ }
+ else
+ {
+ var weihnachten = list.FirstOrDefault(f => f.Name == "Heilig Abend");
+ if (weihnachten != null)
+ list.Remove(weihnachten);
+ }
return list;
}
public override decimal GetFeiertagsFaktor(DateTime start)
{
- if (start.Month == 12)
+ if (start.Year >= 2024)
{
- if (start.Day == 24 || start.Day == 31)
+ if (start.Month == 12)
{
- return 0.5m;
+ if (start.Day == 24 || start.Day == 31)
+ {
+ return 0.5m;
+ }
}
}
diff --git a/Service/DCEntityMapper/SettlementDC_SettlementInvoice.cs b/Service/DCEntityMapper/SettlementDC_SettlementInvoice.cs
index ec4943bb3..8c248cf54 100644
--- a/Service/DCEntityMapper/SettlementDC_SettlementInvoice.cs
+++ b/Service/DCEntityMapper/SettlementDC_SettlementInvoice.cs
@@ -19,7 +19,7 @@ namespace BeWo.Service.DCEntityMapper
SettlementDC dc = null;
if (pEntity.InvoiceBase != null && !String.IsNullOrEmpty(pEntity.InvoiceBase.XMLData))
{
- dc = Utils.XMLDeserializeFromString(pEntity.InvoiceBase.XMLData);
+ dc = BS.Shared.Core.Utils.XMLDeserializeFromString(pEntity.InvoiceBase.XMLData);
}
if (dc == null)
@@ -279,7 +279,7 @@ namespace BeWo.Service.DCEntityMapper
var dcToSerialize = new SettlementDC();
MapDC22DC(pDataContract, dcToSerialize);
- pEntity.InvoiceBase.XMLData = Utils.XMLSerializeToString(dcToSerialize);
+ pEntity.InvoiceBase.XMLData = BS.Shared.Core.Utils.XMLSerializeToString(dcToSerialize);
MapperFactory.InvoiceItemDC_InvoiceItem.MergeWithEntitys(pDataContract.InvoiceItems, pEntity.InvoiceBase.InvoiceItems);
diff --git a/Service/Import/Perseh/PersehReader.cs b/Service/Import/Perseh/PersehReader.cs
index 9d48d8068..668c5f947 100644
--- a/Service/Import/Perseh/PersehReader.cs
+++ b/Service/Import/Perseh/PersehReader.cs
@@ -21,7 +21,7 @@ namespace BeWo.Service.Import.Perseh
var tenant = MultitenancyOperationContextExt.Current?.Tenant;
- if ("9876543210".Equals(tenant) || "demo".Equals(tenant))
+ if ("9876543210".Equals(tenant)) // || "demo".Equals(tenant))
{
//Hack für Simpsons DB um die Präsi zu vereinfachen
@@ -96,6 +96,10 @@ namespace BeWo.Service.Import.Perseh
}
result.Ziele = ErstelleAlleZiele(pdfText);
+ if (result.Ziele.Count == 0) // Keine Ziele gefunden, versuche andere PDF Version
+ {
+ result.Ziele = ErstelleAlleZiele2(pdfText);
+ }
}
}
@@ -128,6 +132,99 @@ namespace BeWo.Service.Import.Perseh
var ziele = new List();
//Suche Zeile "Zielplanung". So beginnt hinten im Dokument der Bereich mit der Zusammenfassung der Ziele
+ var zeilen = pdfText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
+ var startIdx = -1;
+ var endIdx = -1;
+ var uebersichtLeistungsplanungIdx = -1;
+ var gesamtUebersichtIdx = -1;
+ var zielplanungStart = -1;
+ var lastLebensbereichIdx = -1;
+
+ StringBuilder gesamtTextMitZielen = new StringBuilder();
+
+ for (int i = zeilen.Length - 1; i >= 0; i--)
+ {
+ var z = zeilen[i];
+
+ if (z == "Zielplanung")
+ {
+ zielplanungStart = i;
+ startIdx = i;
+ }
+ if (z.StartsWith("Übersicht der Leistungsplanung "))
+ {
+ uebersichtLeistungsplanungIdx = i;
+ }
+ if (z.StartsWith("Lebensbereich ") && lastLebensbereichIdx == -1)
+ {
+ lastLebensbereichIdx = i;
+ }
+ if (z.StartsWith("Gesamtübersicht Stunden pro Woche"))
+ {
+ gesamtUebersichtIdx = i;
+ }
+ }
+
+ endIdx = uebersichtLeistungsplanungIdx;
+ if (lastLebensbereichIdx > endIdx && gesamtUebersichtIdx > lastLebensbereichIdx)
+ {
+ endIdx = gesamtUebersichtIdx;
+ }
+ else
+ {
+ endIdx = zeilen.Length - 1;
+ }
+
+ //if (endIdx < startIdx)
+ //{
+ // for (int i = zeilen.Length - 1; i >= 0; i--)
+ // {
+ // var z = zeilen[i];
+ // if (z.StartsWith("Gesamtübersicht Stunden pro Woche"))
+ // {
+ // endIdx = i;
+ // }
+ // }
+ //}
+
+
+ if (startIdx >= 0)
+ {
+ for (int i = startIdx; i < endIdx; i++)
+ {
+ gesamtTextMitZielen.AppendLine(zeilen[i]);
+ }
+ zeilen = gesamtTextMitZielen.ToString().Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
+
+ startIdx = 0;
+ while (startIdx >= 0)
+ {
+ var ta = TextAbschnittReader.LeseBisText(zeilen, startIdx, "Lebensbereich ", true, false, false);
+ if (ta.Success)
+ {
+ ziele.AddRange(ErstelleBereichMitZielen(zeilen, ta));
+ startIdx = ta.ZeilenIndex + 1;
+ }
+ else
+ {
+ startIdx = -1;
+ }
+
+ }
+ }
+ if (zielplanungStart >= 0)
+ {
+ ErstelleMassnahmen(pdfText, zielplanungStart, ziele);
+ }
+ return ziele;
+
+ }
+
+ private IList ErstelleAlleZiele2(string pdfText)
+ {
+ var ziele = new List();
+ //Suche Zeile "Zielplanung". So beginnt hinten im Dokument der Bereich mit der Zusammenfassung der Ziele
+
var zeilen = pdfText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
var startIdx = -1;
var endIdx = -1;
@@ -159,7 +256,7 @@ namespace BeWo.Service.Import.Perseh
}
}
}
-
+
if (startIdx >= 0)
{
@@ -185,8 +282,10 @@ namespace BeWo.Service.Import.Perseh
}
}
- ErstelleMassnahmen(pdfText, zielplanungStart, ziele);
-
+ if (zielplanungStart >= 0)
+ {
+ ErstelleMassnahmen(pdfText, zielplanungStart, ziele);
+ }
return ziele;
}
diff --git a/Service/Plugins/CustomerService.cs b/Service/Plugins/CustomerService.cs
index 1ede3ca5e..b8a21e801 100644
--- a/Service/Plugins/CustomerService.cs
+++ b/Service/Plugins/CustomerService.cs
@@ -7,7 +7,7 @@ using BeWo.Data.Entities;
using BeWo.Data.Security;
using BeWo.Service.Core;
using BeWo.Service.DCEntityMapper;
-
+using BeWo.ServiceUtils.History;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -1022,7 +1022,7 @@ namespace BeWo.Service.Plugins
DAOFactory.GenericDAO.Insert(lSupportConcept);
- MakeSupportConceptHistoryEntry(lSupportConcept, lSupportConcept.Oid.Value, StatementType.Insert);
+ HistoryCreator.MakeSupportConceptHistoryEntry(lSupportConcept, lSupportConcept.Oid.Value, StatementType.Insert);
return lSupportConcept.Oid.Value;
}
@@ -1037,90 +1037,12 @@ namespace BeWo.Service.Plugins
lOriginal.Customer.Customer2CostBearerList.AddRange(lOriginal.CostBearer2SupportConceptList.Where(cb2sc => !lOriginal.Customer.Customer2CostBearerList.Exists(c2cb => c2cb.CostBearer.Equals(cb2sc.CostBearer))).Select(c2cb => new Customer2CostBearer { CostBearer = c2cb.CostBearer, ReferenceNumber = c2cb.CustomerReferenceNumber }));
DAOFactory.GenericDAO.Update(lOriginal);
- MakeSupportConceptHistoryEntry(lOriginal, lOriginal.Oid.Value, StatementType.Update);
+ HistoryCreator.MakeSupportConceptHistoryEntry(lOriginal, lOriginal.Oid.Value, StatementType.Update);
return lOriginal.Oid.Value;
}
- public static void MakeSupportConceptHistoryEntry(SupportConcept lOriginal, long? Oid, StatementType statementType)
- {
- var supportConceptHistoryEntry = new SupportConceptHistory()
- {
- ChangeType = statementType,
- SupportConcept_ApprovalDate = lOriginal.ApprovalDate,
- SupportConcept_Conference = lOriginal.Conference,
- SupportConcept_ConferenceDate = lOriginal.ConferenceDate,
- SupportConcept_ConferenceVenue = lOriginal.ConferenceVenue,
- SupportConcept_ConsultingNeeded = lOriginal.ConsultingNeeded,
- //SupportConcept_CostBearer2SupportConceptList = lOriginal.CostBearer2SupportConceptList,
- SupportConcept_CustomerOid = lOriginal.Customer.Oid,
- SupportConcept_EmployeeOid = lOriginal.Originator.Oid,
- SupportConcept_RenewalSendDate = lOriginal.RenewalSendDate,
- SupportConcept_RequisitionSendDate = lOriginal.RequisitionSendDate,
- SupportConcept_SupportConceptSendDate = lOriginal.RequisitionSendDate,
- SupportConceptOid = lOriginal.Oid,
- Notice = lOriginal.Notice
- };
-
- DAOFactory.GenericDAO.Insert(supportConceptHistoryEntry);
-
- List cb2schToInsert = new List();
- List scApprovalPeriodHistoriesToInsert = new List();
- foreach (var originalC2S in lOriginal.CostBearer2SupportConceptList)
- {
- var C2SHistory = new CostBearer2SupportConceptHistory()
- {
- //CostBearer2SupportConcept_AccountingTransactions = originalC2S.AccountingTransactions,
- CostBearer2SupportConcept_ApprovedEndDate = originalC2S.ApprovedEndDate,
- CostBearer2SupportConcept_ApprovedStartDate = originalC2S.ApprovedStartDate,
- CostBearer2SupportConcept_AuswahlBezeichnung = originalC2S.AuswahlBezeichnung,
- CostBearer2SupportConcept_CostBearerContactPersonOid = originalC2S.CostBearerContactPerson?.Oid,
- CostBearer2SupportConcept_CostBearerOid = originalC2S.CostBearer?.Oid,
- CostBearer2SupportConcept_CustomerReferenceNumber = originalC2S.CustomerReferenceNumber,
- CostBearer2SupportConcept_MonthlyPayment = originalC2S.MonthlyPayment,
- CostBearer2SupportConcept_RequestedEndDate = originalC2S.RequestedEndDate,
- CostBearer2SupportConcept_RequestedStartDate = originalC2S.RequestedStartDate,
- //CostBearer2SupportConcept_ServiceRecords = originalC2S.ServiceRecords,
- CostBearer2SupportConcept_Status = originalC2S.Status,
- //CostBearer2SupportConcept_SupportConceptApprovalPeriodList = originalC2S.ApprovalPeriodList
- CostBearer2SupportConcept_SupportConceptHistoryOid = lOriginal.Oid.Value,
- ChangeType = statementType,
- Notice = originalC2S.Notice
- };
- DAOFactory.GenericDAO.Insert(C2SHistory);
-
- foreach (var item in originalC2S.ApprovalPeriodList)
- {
- var scApprovalPeriodHistory = new SupportConceptApprovalPeriodHistory()
- {
- ChangeType = statementType,
- SupportConceptApprovalPeriod_ApprovedBEInterval = item.ApprovedBEInterval,
- SupportConceptApprovalPeriod_ApprovedBEPerInterval = item.ApprovedBEPerInterval,
- SupportConceptApprovalPeriod_ApprovedBETotal = item.ApprovedBETotal,
- SupportConceptApprovalPeriod_ApprovedFixedAmount = item.ApprovedFixedAmount,
- SupportConceptApprovalPeriod_ApprovedFixedAmountInterval = item.ApprovedFixedAmountInterval,
- SupportConceptApprovalPeriod_Bewilligungsart = item.Bewilligungsart,
- SupportConceptApprovalPeriod_BudgetOid = item.Budget?.Oid.Value,
- SupportConceptApprovalPeriod_ContactCountInterval = item.ContactCountInterval,
- SupportConceptApprovalPeriod_ContactCountPerInterval = item.ContactCountPerInterval,
- SupportConceptApprovalPeriod_CostBearer2SupportConceptHistoryOid = originalC2S.Oid.Value,
- SupportConceptApprovalPeriod_EndDate = item.EndDate,
- SupportConceptApprovalPeriod_IsApprovedBEShifting = item.IsApprovedBEShifting,
- SupportConceptApprovalPeriod_IsApprovedFixedAmountShifting = item.IsApprovedFixedAmountShifting,
- SupportConceptApprovalPeriod_MonthlyPayment = item.MonthlyPayment,
- SupportConceptApprovalPeriod_StartDate = item.StartDate,
- SupportConceptApprovalPeriod_SupportConceptApprovalPeriod2Employee = item.SupportConceptApprovalPeriod2Employee,
- SupportConceptApprovalPeriod_SupportConceptHistoryOid = supportConceptHistoryEntry.Oid.Value,
- Notice = item.Notice
- };
- DAOFactory.GenericDAO.Insert(scApprovalPeriodHistory);
- }
- }
- //MakeHistoryEntry(lOriginal.Customer2PersonList, originalCustomer2PersonList, lOriginal.Oid, statementType);
- //MakeHistoryEntry(lOriginal.Customer2OrganisationList, originalC2OList, lOriginal.Oid, statementType);
- //MakeHistoryEntry(lOriginal.Employee2CustomerList, originale2CList, lOriginal.Oid, statementType);
- }
-
+
public static void CheckDefaultServiceCategory(SupportConceptDC pSupportConcept)
{
if (pSupportConcept.ServiceAccountings != null)
diff --git a/Service/Plugins/OperationService.cs b/Service/Plugins/OperationService.cs
index 360fa2770..2f55c4908 100644
--- a/Service/Plugins/OperationService.cs
+++ b/Service/Plugins/OperationService.cs
@@ -4,9 +4,8 @@ using System.Linq;
using BeWo.Data;
using BeWo.Data.Access;
using BeWo.Data.Entities;
-using BeWo.Data.Utils;
using BeWo.Service.DCEntityMapper;
-
+using BeWo.ServiceUtils.History;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -42,7 +41,7 @@ namespace BeWo.Service.Plugins
var newSrList = ErstelleStundenplanEintraege(span.StartDateTime.Date, span.EndDate.Date, c2s, vs, srList);
DAOFactory.GenericDAO.Insert(newSrList);
- OperationService.MakeServiceRecordHistoryEntry(newSrList, newSrList.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
+ HistoryCreator.MakeServiceRecordHistoryEntry(newSrList, newSrList.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
if (ReturnMessage.Length > 0)
{
ReturnMessage += "\n";
@@ -448,105 +447,6 @@ namespace BeWo.Service.Plugins
}
- // ToDo: Unterschriftenbemerkung hier einbauen
- public static void MakeServiceRecordHistoryEntry(List lOriginals, IEnumerable serviceRecordOidList, StatementType statementType)
- {
- var serviceRecordHistoryEntries = new List();
-
- if (statementType.Equals(StatementType.Insert) && serviceRecordOidList != null)
- {
- var iterator = 0;
- foreach (var history in lOriginals.Select(serviceRecordOriginal => new ServiceRecordHistory
- {
- TimeStamp = DateTime.Now,
- ChangeType = statementType,
- CostBearer2SupportConcept = serviceRecordOriginal.CostBearer2SupportConcept,
- CostBearer2SupportConceptOid = serviceRecordOriginal.CostBearer2SupportConceptOid,
- Customer = serviceRecordOriginal.Customer,
- CustomerOid = serviceRecordOriginal.CustomerOid,
- Employee = serviceRecordOriginal.Employee,
- EmployeeOid = serviceRecordOriginal.EmployeeOid,
- End = serviceRecordOriginal.End,
- Group = serviceRecordOriginal.Group,
- GroupEmployeeCount = serviceRecordOriginal.GroupEmployeeCount,
- GroupOid = serviceRecordOriginal.GroupOid,
- GroupPersonCount = serviceRecordOriginal.GroupPersonCount,
- GroupRoundedDuration = serviceRecordOriginal.GroupRoundedDuration,
- IP = serviceRecordOriginal.IP,
- IsActive = serviceRecordOriginal.IsActive,
- Notice = serviceRecordOriginal.Notice,
- ServiceRecordOid = serviceRecordOidList.ElementAt(iterator),
- RoundedDuration = serviceRecordOriginal.RoundedDuration,
- ServiceDescription = serviceRecordOriginal.ServiceDescription,
- ServiceRecordType = serviceRecordOriginal.ServiceRecordType,
- ServiceRecordInsTs = serviceRecordOriginal.InsTs,
- ServiceRecordVersion = serviceRecordOriginal.Version ?? 0,
- ServiceRecordInsUser = serviceRecordOriginal.InsUser,
- ServiceRecordUdpUser = serviceRecordOriginal.UdpUser,
- Start = serviceRecordOriginal.Start,
- SupportConcept = serviceRecordOriginal.SupportConcept,
- SystemEntryID = serviceRecordOriginal.SystemEntryID,
- DistanceInMeter = serviceRecordOriginal.DistanceInMeter,
- IsCreatedInMobileClient = serviceRecordOriginal.IsCreatedInMobileClient
- }))
- {
- iterator++;
- serviceRecordHistoryEntries.Add(history);
- }
- }
- else
- {
- foreach (var original in lOriginals)
- {
- SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
-
- if (original.Oid.HasValue)
- {
- previousRecordHistorySignatureInfo = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecordOid(original.Oid.Value);
- }
-
- serviceRecordHistoryEntries.AddIfNotIn(new ServiceRecordHistory
- {
- TimeStamp = DateTime.Now,
- ChangeType = statementType,
- CostBearer2SupportConcept = original.CostBearer2SupportConcept,
- CostBearer2SupportConceptOid = original.CostBearer2SupportConceptOid,
- Customer = original.Customer,
- CustomerOid = original.CustomerOid,
- Employee = original.Employee,
- EmployeeOid = original.EmployeeOid,
- End = original.End,
- Group = original.Group,
- GroupEmployeeCount = original.GroupEmployeeCount,
- GroupOid = original.GroupOid,
- GroupPersonCount = original.GroupPersonCount,
- GroupRoundedDuration = original.GroupRoundedDuration,
- IP = original.IP,
- IsActive = original.IsActive,
- Notice = original.Notice,
- ServiceRecordOid = original.Oid,
- RoundedDuration = original.RoundedDuration,
- ServiceDescription = original.ServiceDescription,
- ServiceRecordType = original.ServiceRecordType,
- ServiceRecordInsTs = original.InsTs,
- ServiceRecordVersion = original.Version ?? 0,
- ServiceRecordInsUser = original.InsUser,
- ServiceRecordUdpUser = original.UdpUser,
- Start = original.Start,
- SupportConcept = original.SupportConcept,
- SystemEntryID = original.SystemEntryID,
- DistanceInMeter = original.DistanceInMeter,
- IsCreatedInMobileClient = original.IsCreatedInMobileClient,
- ServiceRecordSignatureStateType = previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
- CustomerConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
- EmployeeConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
- CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
- EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
- });
- }
- }
-
- DAOFactory.GenericDAO.Insert(serviceRecordHistoryEntries);
- }
+
}
}
\ No newline at end of file
diff --git a/Service/Plugins/PluginLoader.cs b/Service/Plugins/PluginLoader.cs
index 8724eeecb..6192ba305 100644
--- a/Service/Plugins/PluginLoader.cs
+++ b/Service/Plugins/PluginLoader.cs
@@ -350,7 +350,7 @@ namespace BeWo.Service.Plugins
//t = "3226307161"; // Roman Roger Puth
//t = "3522103738"; // AWO Münsterland-Recklinghausen
//t = "5592509446"; // Kontakt Verein für psychosoziale Hilfen e.V
- t = "5344902949"; // SHK Service GmbH SBD
+ //t = "5344902949"; // SHK Service GmbH SBD
//t = "1422963536"; // Malteser-Johanniter-Johanneshaus gGmbH
//t = "5433105975"; // aha e.V.
//t = "1701920223"; // SKFM Monheim
diff --git a/Service/Service.csproj b/Service/Service.csproj
index 8da0c85a9..445c28494 100644
--- a/Service/Service.csproj
+++ b/Service/Service.csproj
@@ -517,6 +517,7 @@
+
diff --git a/Service/ServiceImplementations/CustomerServiceImp.cs b/Service/ServiceImplementations/CustomerServiceImp.cs
index 728b6ccf6..616d1f7c5 100644
--- a/Service/ServiceImplementations/CustomerServiceImp.cs
+++ b/Service/ServiceImplementations/CustomerServiceImp.cs
@@ -1,5 +1,4 @@
-
-using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
@@ -13,6 +12,7 @@ using BeWo.Service.Dienstplanung;
using BeWo.Service.OwnChat;
using BeWo.Service.Plugins;
using BeWo.Service.ServiceContracts;
+using BeWo.ServiceUtils.History;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
@@ -39,7 +39,7 @@ namespace BeWo.Service.ServiceImplementations
foreach (var sc in c.SupportConcepts)
ServiceLogic.SetActivationType(sc.Oid.Value, sc.Version.Value, ActivationTypeId.Archived);
- MakeCustomerHistoryEntry(c, null, StatementType.Archived, null, null, null);
+ HistoryCreator.MakeCustomerHistoryEntry(c, MapperFactory.CustomerDC_Customer.MapToNewDC(c), null, StatementType.Archived, null, null, null);
}
@@ -48,7 +48,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
var e = DAOFactory.GenericDAO.LoadByID(pOid);
- MakeNewPersonHistoryEntry(e, StatementType.Archived);
+ HistoryCreator.MakeNewPersonHistoryEntry(e, MapperFactory.PersonDC_Person.MapToNewDC(e), StatementType.Archived);
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Archived);
}
@@ -75,7 +75,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Archived);
- CustomerService.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Archived);
+ HistoryCreator.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Archived);
}
catch (Exception e)
{
@@ -122,7 +122,7 @@ namespace BeWo.Service.ServiceImplementations
foreach (var sc in customer.SupportConcepts)
ServiceLogic.SetActivationType(sc.Oid.Value, sc.Version.Value, ActivationTypeId.Deleted);
- MakeCustomerHistoryEntry(customer, null, StatementType.Delete, null, null, null);
+ HistoryCreator.MakeCustomerHistoryEntry(customer, MapperFactory.CustomerDC_Customer.MapToNewDC(customer), null, StatementType.Delete, null, null, null);
}
public void DeactivateOrganisation(long pOid, long pVersion)
@@ -154,7 +154,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
var e = DAOFactory.GenericDAO.LoadByID(pOid);
- MakeNewPersonHistoryEntry(e, StatementType.Delete);
+ HistoryCreator.MakeNewPersonHistoryEntry(e, MapperFactory.PersonDC_Person.MapToNewDC(e), StatementType.Delete);
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Deleted);
}
@@ -181,7 +181,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Deleted);
- CustomerService.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Delete);
+ HistoryCreator.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Delete);
}
catch (Exception e)
{
@@ -195,7 +195,7 @@ namespace BeWo.Service.ServiceImplementations
{
ServiceLogic.SetActivationType(pOid2Version, ActivationTypeId.Deleted);
foreach (var item in pOid2Version)
- CustomerService.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(item.Key), item.Key, StatementType.Delete);
+ HistoryCreator.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(item.Key), item.Key, StatementType.Delete);
}
catch (Exception e)
{
@@ -251,7 +251,7 @@ namespace BeWo.Service.ServiceImplementations
lOriginals.DoForEach(or => MapperFactory.CustomerDC_Customer.ConcurrencyCheck(pOid2Version[or.Oid.Value], or));
foreach (Customer lOriginal in lOriginals)
- MakeCustomerHistoryEntry(lOriginal, null, StatementType.Delete, null, null, null);
+ HistoryCreator.MakeCustomerHistoryEntry(lOriginal, MapperFactory.CustomerDC_Customer.MapToNewDC(lOriginal), null, StatementType.Delete, null, null, null);
DAOFactory.GenericDAO.Delete(lOriginals);
}
@@ -1016,7 +1016,7 @@ namespace BeWo.Service.ServiceImplementations
var lOriginal = DAOFactory.GenericDAO.LoadByID(oid);
object[] Lists = GetFromNHibernateDecoupledCustomerRelatedLists(lOriginal);
- MakeCustomerHistoryEntry(lOriginal, lOriginal.Oid.Value, StatementType.Insert, Lists[0] as List, Lists[1] as List, Lists[2] as List);
+ HistoryCreator.MakeCustomerHistoryEntry(lOriginal, MapperFactory.CustomerDC_Customer.MapToNewDC(lOriginal), lOriginal.Oid.Value, StatementType.Insert, Lists[0] as List, Lists[1] as List, Lists[2] as List);
OwnChatHelper.StartOwnChatSync();
return oid;
@@ -1047,7 +1047,7 @@ namespace BeWo.Service.ServiceImplementations
{
Person pPerson = MapperFactory.PersonDC_Person.MapToNewEntity(pPersonDC);
DAOFactory.GenericDAO.Insert(pPerson);
- MakeNewPersonHistoryEntry(pPerson, StatementType.Insert);
+ HistoryCreator.MakeNewPersonHistoryEntry(pPerson, pPersonDC, StatementType.Insert);
return pPerson.Oid.Value;
}
@@ -1254,7 +1254,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Update(lOriginal);
- MakeCustomerHistoryEntry(lOriginal, null, StatementType.Update, Lists[0] as List, Lists[1] as List, Lists[2] as List);
+ HistoryCreator.MakeCustomerHistoryEntry(lOriginal, MapperFactory.CustomerDC_Customer.MapToNewDC(lOriginal), null, StatementType.Update, Lists[0] as List, Lists[1] as List, Lists[2] as List);
CheckUpdatedReferenceNumbers(pCustomerDC, lOriginal);
@@ -1332,8 +1332,8 @@ namespace BeWo.Service.ServiceImplementations
try
{
var lOrigial = DAOFactory.GenericDAO.LoadByID(pPersonDC.PersonOid.Value);
+ HistoryCreator.MakeNewPersonHistoryEntry(lOrigial, pPersonDC, StatementType.Update);
MapperFactory.PersonDC_Person.MergeWithEntity(pPersonDC, lOrigial);
- MakeNewPersonHistoryEntry(lOrigial, StatementType.Update);
DAOFactory.GenericDAO.Update(lOrigial);
return lOrigial.Oid.Value;
}
@@ -1556,6 +1556,7 @@ namespace BeWo.Service.ServiceImplementations
{
List lOriginals = DAOFactory.GenericDAO.LoadByIDs(pDCList.Select(b => b.AbsenceTimeOid.Value));
MapperFactory.AbsenceTimeDC_AppointmentAbsenceTime.MergeWithEntitys(pDCList, lOriginals);
+
DAOFactory.GenericDAO.Update(lOriginals);
return MapperFactory.AbsenceTimeDC_AppointmentAbsenceTime.MapToNewDCs(lOriginals);
@@ -2078,146 +2079,8 @@ namespace BeWo.Service.ServiceImplementations
return dc;
}
- private static void MakeCustomerHistoryEntry(Customer lOriginal, long? Oid, StatementType statementType, List originalCustomer2PersonList, List originalC2OList, List originale2CList)
- {
- var lCustomerHistory = new CustomerHistory
- {
- ChangeType = statementType,
- Childs = lOriginal.Childs,
- CostCenter = lOriginal.CostCenter,
- CustomerInsTs = lOriginal.InsTs,
- CustomerInsUser = lOriginal.InsUser,
- CustomerOid = Oid ?? lOriginal.Oid,
- CustomerUdpUser = lOriginal.UdpUser,
- CustomerVersion = lOriginal.Version ?? 0,
- DebitorNumber = lOriginal.DebitorNumber,
- Diagnosis = lOriginal.Diagnosis,
- Environment = lOriginal.Environment,
- EquityContribution = lOriginal.EquityContribution,
- ICD10Diagnosis = lOriginal.ICD10Diagnosis,
- IsAdvisedOrAttended = lOriginal.IsAdvisedOrAttended,
- Medication = lOriginal.Medication,
- Notice = lOriginal.Notice,
- Person = lOriginal.Person,
- ReferenceNumber = lOriginal.ReferenceNumber,
- TerminationDate = lOriginal.TerminationDate,
- AssistanceBegin = lOriginal.AssistanceBegin
- //Jugendamt = lOriginal.Jugendamt,
- //Ansprechpartner = lOriginal.Ansprechpartner
- };
-
- DAOFactory.GenericDAO.Insert(lCustomerHistory);
-
- MakeHistoryEntry(lOriginal.Customer2PersonList, originalCustomer2PersonList, lOriginal.Oid, statementType);
- MakeHistoryEntry(lOriginal.Customer2OrganisationList, originalC2OList, lOriginal.Oid, statementType);
- MakeHistoryEntry(lOriginal.Employee2CustomerList, originale2CList, lOriginal.Oid, statementType);
-
- var person = lOriginal.Person;
- MakeNewPersonHistoryEntry(person, statementType);
- }
- private static void MakeHistoryEntry(IList lNewList, List lOriginalList, long? customerOid, StatementType sType) where T : BeWoEntityBase
- {
- if (sType.Equals(StatementType.Delete) || sType.Equals(StatementType.Insert) || sType.Equals(StatementType.Archived) || sType.Equals(StatementType.Reactivate))
- {
- foreach (T newObject in lNewList)
- MakeActualHistoryEntry(newObject, sType, customerOid);
-
- return;
- }
-
- List OidOfOriginalsList = lOriginalList.Select(element => element.Oid.Value).Select(oid => (long?)oid).ToList();
- List OidOfNewsList = lNewList.Select(element => element.Oid.Value).Select(oid => (long?)oid).ToList();
-
- if (lOriginalList.Count <= 0 && lNewList.Count <= 0)
- return;
-
- foreach (T newObject in lNewList)
- {
- if (!OidOfOriginalsList.Contains(newObject.Oid))
- MakeActualHistoryEntry(newObject, StatementType.Insert, customerOid);
- else
- {
- T TObject = lOriginalList.Find(t => t.Oid.Equals(newObject.Oid));
- if (TObject.Version != newObject.Version)
- MakeActualHistoryEntry(newObject, StatementType.Update, customerOid);
- }
- }
-
- foreach (T oldObject in lOriginalList.Where(oldObject => !OidOfNewsList.Contains(oldObject.Oid)))
- MakeActualHistoryEntry(oldObject, StatementType.Delete, customerOid);
- }
-
- private static void MakeActualHistoryEntry(T entityObj, StatementType sType, long? customerOid)
- {
- Customer customer = null;
- if (customerOid != null)
- customer = DAOFactory.GenericDAO.LoadByID(customerOid.Value);
-
- if (entityObj is Customer2Person)
- {
- var customer2Person = entityObj as Customer2Person;
- var historyEntry = new Customer2PersonHistory
- {
- ChangeType = sType,
- Customer2PersonInsTs = customer2Person.InsTs,
- Customer2PersonInsUser = customer2Person.InsUser,
- Customer2PersonOid = customer2Person.Oid,
- Customer2PersonUdpUser = customer2Person.UdpUser,
- Customer2PersonVersion = customer2Person.Version.Value,
- Notice = customer2Person.Notice,
- Person = customer2Person.Person,
- CustomerOid = customer.Oid
- };
-
- DAOFactory.GenericDAO.Insert(historyEntry);
- }
- else if (entityObj is Customer2Organisation)
- {
- var customer2Organisation = entityObj as Customer2Organisation;
- var historyEntry = new Customer2OrganisationHistory
- {
- ChangeType = sType,
- Organisation = customer2Organisation.Organisation,
- Notice = customer2Organisation.Notice,
- Customer2OrganisationInsTs = customer2Organisation.InsTs,
- Customer2OrganisationOid = customer2Organisation.Oid,
- Customer2OrganisationInsUser = customer2Organisation.InsUser,
- Customer2OrganisationUdpUser = customer2Organisation.UdpUser,
- Customer2OrganisationVersion = customer2Organisation.Version.Value,
- Info1 = customer2Organisation.Info1,
- Info2 = customer2Organisation.Info2,
- Info3 = customer2Organisation.Info3,
- Info4 = customer2Organisation.Info4,
- Info5 = customer2Organisation.Info5,
- CustomerOid = customer.Oid
- };
-
- DAOFactory.GenericDAO.Insert(historyEntry);
- }
- else if (entityObj is Employee2Customer)
- {
- var employee2Customer = entityObj as Employee2Customer;
- var historyEntry = new Employee2CustomerHistory
- {
- ChangeType = sType,
- Customer = customer,
- CustomerOid = customer.Oid,
- Employee = employee2Customer.Employee,
- EmployeeOid = employee2Customer.EmployeeOid,
- Employee2CustomerInsTs = employee2Customer.InsTs,
- Employee2CustomerInsUser = employee2Customer.InsUser,
- Employee2CustomerOid = employee2Customer.Oid.Value,
- Employee2CustomerUdpUser = employee2Customer.UdpUser,
- Employee2CustomerVersion = employee2Customer.Version.Value,
- Notice = employee2Customer.Notice
- };
-
- DAOFactory.GenericDAO.Insert(historyEntry);
- }
- }
-
private static object[] GetFromNHibernateDecoupledCustomerRelatedLists(Customer customer)
{
var CustomerRelatedListsList = new object[3];
@@ -2439,7 +2302,7 @@ namespace BeWo.Service.ServiceImplementations
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Active);
- MakeCustomerHistoryEntry(c, null, StatementType.Reactivate, null, null, null);
+ HistoryCreator.MakeCustomerHistoryEntry(c, MapperFactory.CustomerDC_Customer.MapToNewDC(c), null, StatementType.Reactivate, null, null, null);
}
public void ReactivateSupportConcept(long pOid, long pVersion)
@@ -2447,7 +2310,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Active);
- CustomerService.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Reactivate);
+ HistoryCreator.MakeSupportConceptHistoryEntry(DAOFactory.GenericDAO.GetByID(pOid), pOid, StatementType.Reactivate);
}
catch (Exception e)
{
@@ -2475,7 +2338,7 @@ namespace BeWo.Service.ServiceImplementations
e.Version = pVersion;
e.IsActive = ActivationTypeId.Active;
- MakeNewPersonHistoryEntry(e, StatementType.Reactivate);
+ HistoryCreator.MakeNewPersonHistoryEntry(e, MapperFactory.PersonDC_Person.MapToNewDC(e), StatementType.Reactivate);
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Active);
}
@@ -3910,99 +3773,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public static void MakeNewPersonHistoryEntry(Person person, StatementType statementType)
- {
- var personHistoryEntry = new PersonHistory
- {
- ChangeType = statementType,
- Person_Oid = person.Oid,
-
- Person_Abbreviation = person.Abbreviation,
- Person_AufenthaltsStatus = person.AufenthaltsStatus?.Value ?? "",
- Person_DateOfBirth = person.DateOfBirth,
- Person_FamilyStatus = person.FamilyStatus,
- Person_FirstName = person.FirstName,
- Person_Function = person.Function?.Value ?? "",
- Person_InsTs = person.InsTs,
- Person_InsUser = person.InsUser,
- Person_IsActive = person.IsActive,
- Person_IsMigrant = person.IsMigrant,
- Person_LastName = person.LastName,
- Person_Nationalitaet = person.Nationalitaet?.Value ?? "",
- Person_Notice = person.Notice,
-
- Person_Profession = person.Profession,
- Person_Sex = person.Sex,
- Person_SystemEntryID = person.SystemEntryID,
-
- Person_Tid = person.Tid,
- Person_Title = person.Title?.Value ?? "",
- Person_Type = person.Type,
- Person_UdpUser = person.UdpUser,
- Person_Version = person.Version
- };
-
- DAOFactory.GenericDAO.Insert(personHistoryEntry);
-
- if (person.Address != null)
- MakeNewAddressHistoryEntry(person.Address, statementType);
-
- if (person.Contacts != null)
- if (personHistoryEntry.Oid != null)
- foreach (var contact in person.Contacts)
- {
- MakeNewContactHistoryEntry(personHistoryEntry.Oid.Value, contact, statementType);
- }
- }
-
- private static void MakeNewContactHistoryEntry(long personId, Contact contact, StatementType statementType)
- {
- var contactHistoryEntry = new ContactHistory
- {
- ChangeType = statementType,
- Contact_InsTs = contact.InsTs,
- Contact_InsUser = contact.InsUser,
- Contact_IsActive = contact.IsActive,
- Contact_Notice = contact.Notice,
- Contact_Tid = contact.Tid,
- Contact_SystemEntryID = contact.SystemEntryID,
- Contact_Type = contact.Type,
- Contact_Value = contact.Value,
- Contact_Oid = contact.Oid,
- Contact_Version = contact.Version,
- Contact_UdpUser = contact.UdpUser,
- Contact_PersonOid = personId
- };
-
- DAOFactory.GenericDAO.Insert(contactHistoryEntry);
- }
-
- private static void MakeNewAddressHistoryEntry(Address address, StatementType statementType)
- {
- var addressHistoryEntry = new AddressHistory
- {
- ChangeType = statementType,
-
- Address_AddressLine1 = address.AddressLine1,
- Address_AddressLine2 = address.AddressLine2,
- Address_Country = address.Country,
- Address_InsTs = address.InsTs,
- Address_InsUser = address.InsUser,
- Address_IsActive = address.IsActive,
- Address_Notice = address.Notice,
- Address_Oid = address.Oid,
- Address_PostalCode = address.PostalCode,
- Address_State = address.State,
- Address_Street = address.Street,
- Address_SystemEntryID = address.SystemEntryID,
- Address_Tid = address.Tid,
- Address_Town = address.Town,
- Address_UdpUser = address.UdpUser,
- Address_Version = address.Version
- };
-
- DAOFactory.GenericDAO.Insert(addressHistoryEntry);
- }
public List LoadContactInformationForCustomer(long customerOid)
{
diff --git a/Service/ServiceImplementations/EmployeeServiceImp.cs b/Service/ServiceImplementations/EmployeeServiceImp.cs
index c5ea8eb39..34c129e01 100644
--- a/Service/ServiceImplementations/EmployeeServiceImp.cs
+++ b/Service/ServiceImplementations/EmployeeServiceImp.cs
@@ -21,6 +21,7 @@ using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using NHibernate;
+using BeWo.ServiceUtils.History;
namespace BeWo.Service.ServiceImplementations
{
@@ -34,7 +35,7 @@ namespace BeWo.Service.ServiceImplementations
var e = DAOFactory.GenericDAO.LoadByID(pOid);
e.Person.IsActive = ActivationTypeId.Archived;
- MakeNewEmployeeHistoryEntry(e, StatementType.Archived);
+ HistoryCreator.MakeNewEmployeeHistoryEntry(e, MapperFactory.EmployeeDC_Employee.MapToNewDC(e), StatementType.Archived);
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Archived);
@@ -93,7 +94,7 @@ namespace BeWo.Service.ServiceImplementations
e.Person.IsActive = ActivationTypeId.Deleted;
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Deleted);
- MakeNewEmployeeHistoryEntry(e, StatementType.Delete);
+ HistoryCreator.MakeNewEmployeeHistoryEntry(e, MapperFactory.EmployeeDC_Employee.MapToNewDC(e), StatementType.Delete);
DeleteEmployeeCustomerRelationForEmployee(pOid);
}
@@ -214,7 +215,7 @@ namespace BeWo.Service.ServiceImplementations
foreach (Employee e in lOriginals)
{
- MakeNewEmployeeHistoryEntry(e, StatementType.Delete);
+ HistoryCreator.MakeNewEmployeeHistoryEntry(e, MapperFactory.EmployeeDC_Employee.MapToNewDC(e), StatementType.Delete);
}
DAOFactory.GenericDAO.Delete(lOriginals);
@@ -717,7 +718,7 @@ namespace BeWo.Service.ServiceImplementations
var id = es.InsertNewEmployee(pEmployeeDC);
var temp = DAOFactory.GenericDAO.LoadByID(id);
- MakeNewEmployeeHistoryEntry(temp, StatementType.Insert);
+ HistoryCreator.MakeNewEmployeeHistoryEntry(temp, pEmployeeDC, StatementType.Insert);
OwnChatHelper.StartOwnChatSync();
@@ -894,9 +895,11 @@ namespace BeWo.Service.ServiceImplementations
try
{
var lOriginal = DAOFactory.GenericDAO.LoadByID(pEmployeeDC.EmployeeOid.Value);
+
+ HistoryCreator.MakeNewEmployeeHistoryEntry(lOriginal, pEmployeeDC, StatementType.Update);
MapperFactory.EmployeeDC_Employee.MergeWithEntity(pEmployeeDC, lOriginal);
- MakeNewEmployeeHistoryEntry(lOriginal, StatementType.Update);
+
DAOFactory.GenericDAO.Update(lOriginal);
@@ -1314,7 +1317,9 @@ namespace BeWo.Service.ServiceImplementations
var lOriginals = DAOFactory.GenericDAO.LoadByIDs(pOid2Version.Select(e => e.Key));
lOriginals.DoForEach(or => MapperFactory.AuszahlungsartDC_Auszahlungsart.ConcurrencyCheck(pOid2Version[or.Oid.Value], or));
- DAOFactory.GenericDAO.Delete(lOriginals);
+ //ServiceLogic.SetActivationType(pOid2Version, ActivationTypeId.Archived);
+
+ DAOFactory.GenericDAO.Delete(lOriginals);
}
catch (Exception e)
{
@@ -1579,7 +1584,7 @@ namespace BeWo.Service.ServiceImplementations
try
{
var e = DAOFactory.GenericDAO.LoadByID(pOid);
- MakeNewEmployeeHistoryEntry(e, StatementType.Reactivate);
+ HistoryCreator.MakeNewEmployeeHistoryEntry(e, MapperFactory.EmployeeDC_Employee.MapToNewDC(e), StatementType.Reactivate);
ServiceLogic.SetActivationType(pOid, pVersion, ActivationTypeId.Active);
}
@@ -1604,64 +1609,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
- public void MakeNewEmployeeHistoryEntry(Employee employee, StatementType statementType)
- {
- try
- {
- var employeeHistory = new EmployeeHistory
- {
- ChangeType = statementType,
-
- Employee_Aggressiv = employee.Aggressiv,
- //Employee_ApplicationUserOid,
- //Employee_CancellationPeriod,
- Employee_EmployeeColor = employee.EmployeeColor,
- //Employee_EntryDate,
- Employee_HealthInsurance = employee.HealthInsurance,
- //Employee_HourlyRate,
- Employee_Hygienebelehrung = employee.Hygienebelehrung,
- Employee_InsTs = employee.InsTs,
- Employee_InsuranceNumber = employee.InsuranceNumber,
- Employee_InsUser = employee.InsUser,
- Employee_IsActive = employee.IsActive,
- Employee_IsQualified = employee.IsQualified,
- //Employee_leavedays,
- Employee_Notice = employee.Notice,
- Employee_Notice2 = employee.Notice2,
- Employee_Oid = employee.Oid,
- Employee_PersonnelNumber = employee.PersonnelNumber,
- //Employee_PersonOid,
- Employee_Pflege = employee.Pflege,
- //Employee_ProbationPeriod,
- Employee_Schutzstufe = employee.Schutzstufe,
- //Employee_Sequence,
- Employee_SystemEntryID = employee.SystemEntryID,
- Employee_TaxNumber = employee.TaxNumber,
- Employee_Text1 = employee.Text1,
- Employee_Text2 = employee.Text2,
- Employee_Text3 = employee.Text3,
- Employee_Text4 = employee.Text4,
- Employee_Text5 = employee.Text5,
- Employee_Tid = employee.Tid,
- Employee_Toilettengang = employee.Toilettengang,
- Employee_UdpUser = employee.UdpUser,
- Employee_Version = employee.Version,
- //Employee_weeklyfls = employee,
- //Employee_weeklytotalhours,
- };
-
- CustomerServiceImp.MakeNewPersonHistoryEntry(employee.Person, statementType);
-
- MakeNewContractHistoryEntry(employee, statementType);
-
- DAOFactory.GenericDAO.Insert(employeeHistory);
- }
- catch (Exception e)
- {
- throw Utils.CreateBeWoFaultException(e);
- }
- }
-
public List LoadTeamsRelatedCustomerOids(long employeeOid)
{
try
@@ -2234,40 +2181,6 @@ namespace BeWo.Service.ServiceImplementations
}
- public void MakeNewContractHistoryEntry(Employee employee, StatementType statementType)
- {
- foreach (var contract in employee.Contracts)
- {
- var historyEntry = new ContractHistory()
- {
- ContractHistoryCancellationPeriod = contract.CancellationPeriod,
- ContractHistoryContractEndDate = contract.ContractEndDate,
- ContractHistoryContractTypeValueListEntry = contract.ContractTypeValueListEntry,
- ContractHistoryEmployeeOid = employee.Oid.Value,
- ContractHistoryEmploymentType = contract.EmploymentType,
- ContractHistoryEntryDate = contract.EntryDate,
- ContractHistoryHourlyRate = contract.HourlyRate,
- ContractHistoryHourlyRateCostRateValue = contract.HourlyRateCostRateValue,
- ContractHistoryLeaveDays = contract.LeaveDays,
- ContractHistoryMonthlyFLS = contract.MonthlyFLS,
- ContractHistoryMonthlyTotalHours = contract.MonthlyTotalHours,
- ContractHistoryProbationPeriod = contract.ProbationPeriod,
- ContractHistoryProbationPeriod2 = contract.ProbationPeriod2,
- ContractHistoryQualifikationsBedarfValueListEntry = contract.QualifikationsBedarfValueListEntry,
- ContractHistoryWeeklyDays = contract.WeeklyDays,
- ContractHistoryWeeklyFLS = contract.WeeklyFLS,
- ContractHistoryWeeklyTotalHours = contract.WeeklyTotalHours,
- IsActive = contract.IsActive,
- Notice = contract.Notice,
- SystemEntryID = contract.SystemEntryID,
- Version = contract.Version,
- ChangeType = statementType,
- InsTs = DateTime.Now
- };
- DAOFactory.GenericDAO.Insert(historyEntry);
-
- };
- }
public CompactEmployeeDC FindCompactEmployeeByFullname(string fullname)
{
diff --git a/Service/ServiceImplementations/OperationsServiceImp.cs b/Service/ServiceImplementations/OperationsServiceImp.cs
index 2b90022ad..9bff62c01 100644
--- a/Service/ServiceImplementations/OperationsServiceImp.cs
+++ b/Service/ServiceImplementations/OperationsServiceImp.cs
@@ -40,6 +40,7 @@ using System.Windows;
using BeWo.Data.Utils;
using Utils = BeWo.Service.Core.Utils;
using System.Collections.Specialized;
+using BeWo.ServiceUtils.History;
namespace BeWo.Service.ServiceImplementations
{
@@ -359,7 +360,7 @@ namespace BeWo.Service.ServiceImplementations
private static void DeleteServiceRecordsFromAppointments(List serviceRecords, bool deleteSignatures)
{
- OperationService.MakeServiceRecordHistoryEntry(serviceRecords, null, StatementType.Delete);
+ HistoryCreator.MakeServiceRecordHistoryEntry(serviceRecords, null, StatementType.Delete);
if (deleteSignatures)
{
@@ -1817,7 +1818,7 @@ namespace BeWo.Service.ServiceImplementations
if (lServiceRecords.Count > 0)
{
- OperationService.MakeServiceRecordHistoryEntry(lServiceRecords, lServiceRecords.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
+ HistoryCreator.MakeServiceRecordHistoryEntry(lServiceRecords, lServiceRecords.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
}
var newGroupDC = MapperFactory.ServiceRecordGroupDC_ServiceRecordGroup.MapToNewDC(group);
@@ -2162,7 +2163,7 @@ namespace BeWo.Service.ServiceImplementations
DAOFactory.GenericDAO.Insert(lServiceRecords);
- OperationService.MakeServiceRecordHistoryEntry(lServiceRecords.ToList(), lServiceRecords.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
+ HistoryCreator.MakeServiceRecordHistoryEntry(lServiceRecords.ToList(), lServiceRecords.Select(sr => sr.Oid.Value).ToList(), StatementType.Insert);
return lServiceRecords.Select(sr => sr.Oid.Value).ToList();
}
@@ -2422,7 +2423,7 @@ namespace BeWo.Service.ServiceImplementations
// Die ServiceRecords, deren Einzelunterschriften duch bearbeitete Zeitangaben im Zuge des Updates gelöscht werden zu der SignatureStatus-Liste hinzugefügt (sollte eigentlich nicht vorkommen)
var serviceRecords2SignatureStates = GenerateSignatureStates(serviceRecordOidsWithDeletedSingleSignatures, serviceRecordsdWithRemovedConfirmationReceiptSignatures, lOriginal.ServiceRecordList.ToList());
- MakeServiceRecordHistoryEntryWithSignatureStates(serviceRecords2SignatureStates, StatementType.Update);
+ HistoryCreator.MakeServiceRecordHistoryEntryWithSignatureStates(serviceRecords2SignatureStates, StatementType.Update);
var newGroupDC = MapperFactory.ServiceRecordGroupDC_ServiceRecordGroup.MapToNewDC(lOriginal);
@@ -2436,68 +2437,7 @@ namespace BeWo.Service.ServiceImplementations
}
}
- private static void MakeServiceRecordHistoryEntryWithSignatureStates(List serviceRecords2SignatureStates, StatementType statementType)
- {
- var serviceRecordHistoryEntries = new List();
-
- foreach (var serviceRecord2SignatureState in serviceRecords2SignatureStates)
- {
- var serviceRecord = serviceRecord2SignatureState.ServiceRecord;
- var singleSignatureState = serviceRecord2SignatureState.SingleSignatureStateType;
- var customerMonthlySignatureState = serviceRecord2SignatureState.CustomerMonthlySignatureStateType;
- var employeeMonthlySignatureState = serviceRecord2SignatureState.EmployeeMonthlySignatreStateType;
-
- SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
-
- if (serviceRecord.Oid.HasValue)
- {
- //previousRecordHistoryEntry = DAOFactory.SearchDAO.FindMostRecentServiceRecordHistoryEntryByServiceRecordOid(serviceRecord.Oid.Value);
- previousRecordHistorySignatureInfo = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecordOid(serviceRecord.Oid.Value);
- }
-
- serviceRecordHistoryEntries.AddIfNotIn(new ServiceRecordHistory
- {
- TimeStamp = DateTime.Now,
- ChangeType = statementType,
- CostBearer2SupportConcept = serviceRecord.CostBearer2SupportConcept,
- CostBearer2SupportConceptOid = serviceRecord.CostBearer2SupportConceptOid,
- Customer = serviceRecord.Customer,
- CustomerOid = serviceRecord.CustomerOid,
- Employee = serviceRecord.Employee,
- EmployeeOid = serviceRecord.EmployeeOid,
- End = serviceRecord.End,
- Group = serviceRecord.Group,
- GroupEmployeeCount = serviceRecord.GroupEmployeeCount,
- GroupOid = serviceRecord.GroupOid,
- GroupPersonCount = serviceRecord.GroupPersonCount,
- GroupRoundedDuration = serviceRecord.GroupRoundedDuration,
- IP = serviceRecord.IP,
- IsActive = serviceRecord.IsActive,
- Notice = serviceRecord.Notice,
- ServiceRecordOid = serviceRecord.Oid,
- RoundedDuration = serviceRecord.RoundedDuration,
- ServiceDescription = serviceRecord.ServiceDescription,
- ServiceRecordType = serviceRecord.ServiceRecordType,
- ServiceRecordInsTs = serviceRecord.InsTs,
- ServiceRecordVersion = serviceRecord.Version ?? 0,
- ServiceRecordInsUser = serviceRecord.InsUser,
- ServiceRecordUdpUser = serviceRecord.UdpUser,
- Start = serviceRecord.Start,
- SupportConcept = serviceRecord.SupportConcept,
- SystemEntryID = serviceRecord.SystemEntryID,
- DistanceInMeter = serviceRecord.DistanceInMeter,
- IsCreatedInMobileClient = serviceRecord.IsCreatedInMobileClient,
- ServiceRecordSignatureStateType = singleSignatureState ?? previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
- CustomerConfirmationReceiptSignatureStateType = customerMonthlySignatureState ?? previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
- EmployeeConfirmationReceiptSignatureStateType = employeeMonthlySignatureState ?? previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
- CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
- EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
- });
- }
-
- DAOFactory.GenericDAO.Insert(serviceRecordHistoryEntries);
- }
-
+
private static List GenerateSignatureStates(List serviceRecordsWithDeletedSingleSignatures, List serviceRecordsdWithRemovedConfirmationReceiptSignatures, List originals)
{
var serviceRecords2SignatureStates = new List();
@@ -2635,7 +2575,7 @@ namespace BeWo.Service.ServiceImplementations
var serviceRecords2SignatureStates = GenerateSignatureStates(serviceRecordsWithDeletedSingleSignatures, serviceRecordsdWithRemovedConfirmationReceiptSignatures, lOriginals);//new List();
- MakeServiceRecordHistoryEntryWithSignatureStates(serviceRecords2SignatureStates, StatementType.Update);
+ HistoryCreator.MakeServiceRecordHistoryEntryWithSignatureStates(serviceRecords2SignatureStates, StatementType.Update);
}
catch (Exception e)
{
@@ -3602,7 +3542,7 @@ namespace BeWo.Service.ServiceImplementations
{
var transaction = DAOFactory.GenericDAO.LoadByID(s.BargeldtransaktionsOid.Value);
- CreateTransactionHistoryObject(transaction, StatementType.Signature, SignatureStateType.Valid);
+ HistoryCreator.CreateTransactionHistoryObject(transaction, StatementType.Signature, SignatureStateType.Valid);
}
return updatedSignatureDC;
@@ -4219,7 +4159,7 @@ namespace BeWo.Service.ServiceImplementations
signatureStateType = SignatureStateType.ManuallyDeleted;
}
- transactionHistoryEntries.Add(CreateTransactionHistoryObject(deletedTransaction, StatementType.Delete, signatureStateType));
+ transactionHistoryEntries.Add(HistoryCreator.CreateTransactionHistoryObject(deletedTransaction, StatementType.Delete, signatureStateType));
}
MapperFactory.BargeldkassenDCBargeldkasseDC_BargeldkassenDCBargeldkasse.MergeWithEntity(pBargeldkasse, lOriginal);
@@ -4231,7 +4171,7 @@ namespace BeWo.Service.ServiceImplementations
// Nach dem Insert der neuen Transaktionen haben diese eine Oid und es können die History-Einträge gemacht werden
foreach (var newTransaction in newTransactions)
{
- transactionHistoryEntries.Add(CreateTransactionHistoryObject(newTransaction, StatementType.Insert, SignatureStateType.None));
+ transactionHistoryEntries.Add(HistoryCreator.CreateTransactionHistoryObject(newTransaction, StatementType.Insert, SignatureStateType.None));
}
// Die History-Einträge für die bearbeiteten werden gemacht
@@ -4244,7 +4184,7 @@ namespace BeWo.Service.ServiceImplementations
continue;
}
- transactionHistoryEntries.Add(CreateTransactionHistoryObject(editedTransaction, oid2ChangeTypes.Value.Key, oid2ChangeTypes.Value.Value));
+ transactionHistoryEntries.Add(HistoryCreator.CreateTransactionHistoryObject(editedTransaction, oid2ChangeTypes.Value.Key, oid2ChangeTypes.Value.Value));
}
DAOFactory.GenericDAO.Insert(transactionHistoryEntries);
@@ -4288,7 +4228,7 @@ namespace BeWo.Service.ServiceImplementations
foreach (var transaction in bargeldkasse.Bargeldtransaktionen)
{
var signatureState = transaction.SignatureOid is null ? SignatureStateType.None : SignatureStateType.AutomaticallyDeleted;
- historyEntries.Add(CreateTransactionHistoryObject(transaction, StatementType.Delete, signatureState));
+ historyEntries.Add(HistoryCreator.CreateTransactionHistoryObject(transaction, StatementType.Delete, signatureState));
}
DAOFactory.GenericDAO.Delete(signatures2Delete);
@@ -4312,26 +4252,6 @@ namespace BeWo.Service.ServiceImplementations
}
}
- private static Bargeldtransaktionshistory CreateTransactionHistoryObject(Bargeldtransaktion transaction, StatementType changeType, SignatureStateType signatureState)
- {
- return new Bargeldtransaktionshistory
- {
- Betrag = transaction.Betrag,
- BargeldtransaktionOid = transaction.Oid,
- BargeldtransaktionInsTs = transaction.InsTs,
- BargeldtransaktionInsUser = transaction.InsUser,
- BargeldtransaktionUdpUser = transaction.UdpUser,
- BargeldtransaktionVersion = transaction.Version,
- ChangeType = changeType,
- Belegnummer = transaction.Belegnummer,
- Notice = transaction.Notice,
- IsActive = ActivationTypeId.Active,
- SignatureOid = transaction.SignatureOid,
- SignatureState = signatureState,
- Zahlungstyp = transaction.Zahlungstyp,
- Zahlungsdatum = transaction.Zahlungsdatum
- };
- }
public List LoadNotizenKategorienForObject(TableID objectTid, long objectOid)
{
@@ -9045,36 +8965,4 @@ namespace BeWo.Service.ServiceImplementations
}
- public class ServiceRecord2SignatureStates
- {
- public ServiceRecord ServiceRecord { get; }
- public SignatureStateType? SingleSignatureStateType { get; set; }
- public SignatureStateType? CustomerMonthlySignatureStateType { get; set; }
- public SignatureStateType? EmployeeMonthlySignatreStateType { get; set; }
-
- ///
- /// Erzeugt das Objekt mit den SignatureStates. Wird als Wert eines States null übergeben, wird beim Erzeugen des ServiceRecordHistory-Eintrags der Wert des vorherigen ServiceRecordHistory-Eintrags genommen, falls vorhanden.
- ///
- ///
- ///
- ///
- ///
- public ServiceRecord2SignatureStates(ServiceRecord serviceRecord, SignatureStateType? singleSignatureStateType, SignatureStateType? customerMonthlySignatureStateType, SignatureStateType? employeeMonthlySignatreStateType)
- {
- ServiceRecord = serviceRecord;
- SingleSignatureStateType = singleSignatureStateType;
- CustomerMonthlySignatureStateType = customerMonthlySignatureStateType;
- EmployeeMonthlySignatreStateType = employeeMonthlySignatreStateType;
- }
-
- public override bool Equals(object obj)
- {
- if (obj is ServiceRecord2SignatureStates sr2Ss && sr2Ss.ServiceRecord != null)
- {
- return ServiceRecord?.Equals(sr2Ss.ServiceRecord) ?? false;
- }
-
- return false;
- }
- }
}
diff --git a/Service/ServiceUtils/History/HistoryCreator.cs b/Service/ServiceUtils/History/HistoryCreator.cs
new file mode 100644
index 000000000..1b81602fe
--- /dev/null
+++ b/Service/ServiceUtils/History/HistoryCreator.cs
@@ -0,0 +1,741 @@
+using BeWo.Data.Access;
+using BeWo.Data.Entities;
+using BeWo.Data.Utils;
+using BeWo.Service.DCEntityMapper;
+using BS.Shared;
+using BS.Shared.DataContracts;
+using BS.Shared.Extensions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BeWo.ServiceUtils.History
+{
+ public class HistoryCreator
+ {
+ public static void MakeNewEmployeeHistoryEntry(Employee originalEmployee, EmployeeDC newEmployee, StatementType statementType)
+ {
+ var employeeHistory = new EmployeeHistory
+ {
+ ChangeType = statementType,
+
+ Employee_Aggressiv = newEmployee.Aggressiv,
+ //Employee_ApplicationUserOid,
+ //Employee_CancellationPeriod,
+ Employee_EmployeeColor = newEmployee.EmployeeColor,
+ //Employee_EntryDate,
+ Employee_HealthInsurance = newEmployee.HealthInsurance,
+ //Employee_HourlyRate,
+ Employee_Hygienebelehrung = newEmployee.Hygienebelehrung,
+ Employee_InsTs = originalEmployee.InsTs,
+ Employee_InsuranceNumber = newEmployee.InsuranceNumber,
+ Employee_InsUser = originalEmployee.InsUser,
+ Employee_IsActive = originalEmployee.IsActive,
+ Employee_IsQualified = newEmployee.IsQualified,
+ //Employee_leavedays,
+ Employee_Notice = originalEmployee.Notice,
+ Employee_Notice2 = newEmployee.Notice2,
+ Employee_Oid = originalEmployee.Oid,
+ Employee_PersonnelNumber = newEmployee.PersonnelNumber,
+ //Employee_PersonOid,
+ Employee_Pflege = newEmployee.Pflege,
+ //Employee_ProbationPeriod,
+ Employee_Schutzstufe = newEmployee.Schutzstufe,
+ //Employee_Sequence,
+ Employee_SystemEntryID = originalEmployee.SystemEntryID,
+ Employee_TaxNumber = newEmployee.TaxNumber,
+ Employee_Text1 = newEmployee.Text1,
+ Employee_Text2 = newEmployee.Text2,
+ Employee_Text3 = newEmployee.Text3,
+ Employee_Text4 = newEmployee.Text4,
+ Employee_Text5 = newEmployee.Text5,
+ Employee_Toilettengang = newEmployee.Toilettengang,
+ Employee_UdpUser = originalEmployee.UdpUser,
+ Employee_Version = originalEmployee.Version,
+ //Employee_weeklyfls = employee,
+ //Employee_weeklytotalhours,
+ };
+
+ MakeNewPersonHistoryEntry(originalEmployee.Person, newEmployee, statementType);
+
+ CreateContractHistoryEntries(originalEmployee.Oid.Value, originalEmployee.Contracts, newEmployee.Contracts);
+
+ foreach (var item in newEmployee.AbsenceTimes)
+ {
+ if (!item.EmployeeOid.HasValue)
+ {
+ item.EmployeeOid = originalEmployee.Oid.Value;
+ }
+ }
+ CreateAbsenceTimeHistoryEntry(originalEmployee.AbsenceTimes, newEmployee.AbsenceTimes);
+
+
+
+ DAOFactory.GenericDAO.Insert(employeeHistory);
+
+ }
+
+ public static void CreateContractHistoryEntries(long employeeOid, IList originalContracts, IList newContracts)
+ {
+ if (newContracts != null)
+ {
+ foreach (var nc in newContracts)
+ {
+ if (!nc.ContractOid.HasValue)
+ {
+ CreateContractHistoryEntry(employeeOid, nc, StatementType.Insert);
+ }
+ else
+ {
+ var oldAt = originalContracts.Where(a => a.Oid == nc.ContractOid).FirstOrDefault();
+
+ if (oldAt != null)
+ {
+ CreateContractHistoryEntry(employeeOid, nc, StatementType.Update);
+ }
+ else
+ {
+ //Wurde gelöscht?
+ }
+ }
+ }
+
+ foreach (var oc in originalContracts)
+ {
+ //wenn es einen Vertrag gibt, der nicht mehr in der neuen Liste enthalten ist, wurde er gelöscht
+
+ var nc = newContracts.Where(c => c.ContractOid == oc.Oid).FirstOrDefault();
+
+ if (nc == null)
+ {
+ CreateContractHistoryEntry(employeeOid, MapperFactory.ContractDC_Contract.MapToNewDC(oc), StatementType.Delete);
+ }
+ }
+ }
+
+ }
+
+ public static void CreateContractHistoryEntry(long employeeOid, ContractDC contract, StatementType statementType)
+ {
+
+ var historyEntry = new ContractHistory()
+ {
+ ContractOid = contract.ContractOid,
+ ContractHistoryCancellationPeriod = contract.CancellationPeriod,
+ ContractHistoryContractEndDate = contract.ContractEndDate,
+ ContractHistoryContractTypeValueListEntryOid = contract.ContractTypeValueListEntry?.ValueListEntryOid,
+ ContractHistoryEmployeeOid = employeeOid,
+ ContractHistoryEmploymentTypeOid = contract.EmploymentType?.EmploymentTypeOid,
+ ContractHistoryEntryDate = contract.EntryDate,
+ ContractHistoryHourlyRate = contract.HourlyRate,
+ ContractHistoryHourlyRateCostRateValueOid = contract.HourlyRateCostRateValue?.CostRatePeriodOid,
+ ContractHistoryLeaveDays = contract.LeaveDays,
+ ContractHistoryMonthlyFLS = contract.MonthlyFLS,
+ ContractHistoryMonthlyTotalHours = contract.MonthlyTotalHours,
+ ContractHistoryProbationPeriod = contract.ProbationPeriod,
+ ContractHistoryProbationPeriod2 = contract.ProbationPeriod2,
+ ContractHistoryQualifikationsBedarfValueListEntryOid = contract.QualifikationsBedarfValueListEntry?.ValueListEntryOid,
+ ContractHistoryWeeklyDays = contract.WeeklyDays,
+ ContractHistoryWeeklyFLS = contract.WeeklyFLS,
+ ContractHistoryWeeklyTotalHours = contract.WeeklyTotalHours,
+ Notice = contract.Notice,
+ ChangeType = statementType
+ };
+ DAOFactory.GenericDAO.Insert(historyEntry);
+
+ }
+
+ public static void CreateAbsenceTimeHistoryEntry(IList originalAbsenceTimes, IList newAbsenceTimes)
+ {
+ if (newAbsenceTimes != null)
+ {
+ foreach (var na in newAbsenceTimes)
+ {
+ if (!na.AbsenceTimeOid.HasValue)
+ {
+ CreateAbsenceTimeHistoryEntry(na, StatementType.Insert);
+ }
+ else
+ {
+ var oldAt = originalAbsenceTimes.Where(a => a.Oid == na.AbsenceTimeOid).FirstOrDefault();
+
+ if (oldAt != null)
+ {
+ CreateAbsenceTimeHistoryEntry(na, StatementType.Update);
+ }
+ else
+ {
+ //Wurde gelöscht?
+ }
+ }
+ }
+ }
+ foreach (var oat in originalAbsenceTimes)
+ {
+ //wenn es eine Abwesenheit gibt, der nicht mehr in der neuen Liste enthalten ist, wurde er gelöscht
+
+ var na = newAbsenceTimes.Where(a => a.AbsenceTimeOid == oat.Oid).FirstOrDefault();
+
+ if (na == null)
+ {
+ CreateAbsenceTimeHistoryEntry(MapperFactory.AbsenceTimeDC_AbsenceTime.MapToNewDC(oat), StatementType.Delete);
+ }
+ }
+ }
+
+ public static void CreateAbsenceTimeHistoryEntry(AbsenceTimeDC newAbsenceTime, StatementType statementType)
+ {
+
+ var historyEntry = new AbsenceTimeHistory()
+ {
+ AbsenceTimeOid = newAbsenceTime.AbsenceTimeOid ?? 0,
+ AbsenceReasonOid = newAbsenceTime.Reason?.AbsenceReasonOid ?? 0,
+ AbsenceTimeStart = newAbsenceTime.Start,
+ AbsenceTimeEnd = newAbsenceTime.End,
+ AbsenceTimeKrankheitsMeldung = newAbsenceTime.KrankheitsMeldung,
+ AbsenceTimeNotice = newAbsenceTime.Notice,
+ AbsenceTimeCustomerOid = newAbsenceTime.CustomerOid,
+ AbsenceTimeEmployeeOid = newAbsenceTime.EmployeeOid,
+ ChangeType = statementType
+ };
+ DAOFactory.GenericDAO.Insert(historyEntry);
+
+ }
+
+ public static void MakeCustomerHistoryEntry(Customer lOriginal, CustomerDC newCustomer, long? Oid, StatementType statementType, List originalCustomer2PersonList, List originalC2OList, List originale2CList)
+ {
+ var lCustomerHistory = new CustomerHistory
+ {
+ ChangeType = statementType,
+ Childs = lOriginal.Childs,
+ CostCenter = lOriginal.CostCenter,
+ CustomerInsTs = lOriginal.InsTs,
+ CustomerInsUser = lOriginal.InsUser,
+ CustomerOid = Oid ?? lOriginal.Oid,
+ CustomerUdpUser = lOriginal.UdpUser,
+ CustomerVersion = lOriginal.Version ?? 0,
+ DebitorNumber = lOriginal.DebitorNumber,
+ Diagnosis = lOriginal.Diagnosis,
+ Environment = lOriginal.Environment,
+ EquityContribution = lOriginal.EquityContribution,
+ ICD10Diagnosis = lOriginal.ICD10Diagnosis,
+ IsAdvisedOrAttended = lOriginal.IsAdvisedOrAttended,
+ Medication = lOriginal.Medication,
+ Notice = lOriginal.Notice,
+ Person = lOriginal.Person,
+ ReferenceNumber = lOriginal.ReferenceNumber,
+ TerminationDate = lOriginal.TerminationDate,
+ AssistanceBegin = lOriginal.AssistanceBegin
+ //Jugendamt = lOriginal.Jugendamt,
+ //Ansprechpartner = lOriginal.Ansprechpartner
+ };
+
+ DAOFactory.GenericDAO.Insert(lCustomerHistory);
+
+ MakeHistoryEntry(lOriginal.Customer2PersonList, originalCustomer2PersonList, lOriginal.Oid, statementType);
+ MakeHistoryEntry(lOriginal.Customer2OrganisationList, originalC2OList, lOriginal.Oid, statementType);
+ MakeHistoryEntry(lOriginal.Employee2CustomerList, originale2CList, lOriginal.Oid, statementType);
+
+ var person = lOriginal.Person;
+ MakeNewPersonHistoryEntry(person, newCustomer, statementType);
+
+ foreach (var item in newCustomer.AbsenceTimes)
+ {
+ if (!item.CustomerOid.HasValue)
+ {
+ item.CustomerOid = lOriginal.Oid.Value;
+ }
+ }
+
+ CreateAbsenceTimeHistoryEntry(lOriginal.AbsenceTimes, newCustomer.AbsenceTimes);
+ }
+
+ public static void MakeNewPersonHistoryEntry(Person originalPerson, PersonDC newPerson, StatementType statementType)
+ {
+ var personHistoryEntry = new PersonHistory
+ {
+ ChangeType = statementType,
+ Person_Oid = originalPerson.Oid,
+
+ Person_Abbreviation = newPerson.Abbreviation,
+ Person_AufenthaltsStatus = newPerson.AufenthaltsStatus?.TypeDescription ?? "",
+ Person_DateOfBirth = newPerson.DateOfBirth,
+ Person_FamilyStatus = newPerson.FamilyStatus,
+ Person_FirstName = newPerson.FirstName,
+ Person_Function = newPerson.Function?.TypeDescription ?? "",
+ Person_InsTs = originalPerson.InsTs,
+ Person_InsUser = originalPerson.InsUser,
+ Person_IsActive = originalPerson.IsActive,
+ Person_IsMigrant = newPerson.IsMigrant,
+ Person_LastName = newPerson.LastName,
+ Person_Nationalitaet = newPerson.Nationalitaet?.TypeDescription ?? "",
+ Person_Notice = newPerson.PersonNotice,
+
+ Person_Profession = newPerson.Profession,
+ Person_Sex = newPerson.Sex,
+ Person_SystemEntryID = originalPerson.SystemEntryID,
+
+ Person_Tid = originalPerson.Tid,
+ Person_Title = newPerson.Title?.TypeDescription ?? "",
+ Person_Type = newPerson.Type,
+ Person_Version = originalPerson.Version
+ };
+
+ DAOFactory.GenericDAO.Insert(personHistoryEntry);
+
+
+ MakeNewAddressHistoryEntry(originalPerson.Address, newPerson, statementType);
+ MakeNewContactHistoryEntry(originalPerson.Oid.Value, originalPerson.Contacts, newPerson.ContactInformations, statementType);
+
+ }
+
+ private static void MakeNewContactHistoryEntry(long personOid, IList originalContacts, IList newContacts, StatementType statementType)
+ {
+ foreach (var nc in newContacts)
+ {
+
+ if (!nc.ContactOID.HasValue)
+ {
+ var ec = originalContacts.Where(c => c.Type == nc.ContactType && c.Value.EqualsNullCheck(nc.ContactValue)).FirstOrDefault();
+ long oid = 0;
+ if (ec != null && ec.Oid.HasValue)
+ {
+ oid = ec.Oid.Value;
+
+ }
+ CreateContactHistoryEntry(personOid, oid, nc.ContactValue, StatementType.Insert);
+ }
+ else
+ {
+ var oldC = originalContacts.Where(c => c.Oid == nc.ContactOID).FirstOrDefault();
+ if (oldC != null && !oldC.Value.EqualsNullCheck(nc.ContactValue))
+ {
+ CreateContactHistoryEntry(personOid, nc.ContactOID.Value, nc.ContactValue, StatementType.Update);
+ }
+ else if (oldC == null)
+ {
+ //Wurde gelöscht?
+ }
+ }
+ }
+
+ foreach (var oc in originalContacts)
+ {
+ //wenn es eine Abwesenheit gibt, der nicht mehr in der neuen Liste enthalten ist, wurde er gelöscht
+
+ var nc = newContacts.Where(c => c.ContactOID == oc.Oid).FirstOrDefault();
+
+ if (nc == null)
+ {
+ CreateContactHistoryEntry(personOid, oc.Oid, oc.Value, StatementType.Delete);
+ }
+ }
+ }
+
+ private static void CreateContactHistoryEntry(long personOid, long? contactOid, String contactAddress, StatementType statementType)
+ {
+ var contactHistoryEntry = new ContactHistory
+ {
+ ChangeType = statementType,
+ Contact_Value = contactAddress,
+ Contact_Oid = contactOid,
+ Contact_PersonOid = personOid
+ };
+
+ DAOFactory.GenericDAO.Insert(contactHistoryEntry);
+ }
+
+ private static void MakeNewAddressHistoryEntry(Address originalAddress, PersonDC newPerson, StatementType statementType)
+ {
+ if (originalAddress != null || !String.IsNullOrEmpty(newPerson.AddressLine1) || !String.IsNullOrEmpty(newPerson.PostalCode) || !String.IsNullOrEmpty(newPerson.Street) || !String.IsNullOrEmpty(newPerson.Town))
+ {
+ long oid = 0;
+ if (originalAddress != null && originalAddress.Oid.HasValue)
+ {
+ oid = originalAddress.Oid.Value;
+ }
+ var addressHistoryEntry = new AddressHistory
+ {
+ ChangeType = statementType,
+
+ Address_AddressLine1 = newPerson.AddressLine1,
+ Address_InsTs = originalAddress?.InsTs,
+ Address_InsUser = originalAddress?.InsUser,
+ Address_Oid = oid,
+ Address_PostalCode = newPerson.PostalCode,
+ Address_Street = newPerson.Street,
+ Address_SystemEntryID = originalAddress?.SystemEntryID,
+ Address_Town = newPerson.Town
+ };
+
+ DAOFactory.GenericDAO.Insert(addressHistoryEntry);
+ }
+ }
+
+ public static void MakeSupportConceptHistoryEntry(SupportConcept lOriginal, long? Oid, StatementType statementType)
+ {
+ var supportConceptHistoryEntry = new SupportConceptHistory()
+ {
+ ChangeType = statementType,
+ SupportConcept_ApprovalDate = lOriginal.ApprovalDate,
+ SupportConcept_Conference = lOriginal.Conference,
+ SupportConcept_ConferenceDate = lOriginal.ConferenceDate,
+ SupportConcept_ConferenceVenue = lOriginal.ConferenceVenue,
+ SupportConcept_ConsultingNeeded = lOriginal.ConsultingNeeded,
+ //SupportConcept_CostBearer2SupportConceptList = lOriginal.CostBearer2SupportConceptList,
+ SupportConcept_CustomerOid = lOriginal.Customer.Oid,
+ SupportConcept_EmployeeOid = lOriginal.Originator.Oid,
+ SupportConcept_RenewalSendDate = lOriginal.RenewalSendDate,
+ SupportConcept_RequisitionSendDate = lOriginal.RequisitionSendDate,
+ SupportConcept_SupportConceptSendDate = lOriginal.RequisitionSendDate,
+ SupportConceptOid = lOriginal.Oid,
+ Notice = lOriginal.Notice
+ };
+
+ DAOFactory.GenericDAO.Insert(supportConceptHistoryEntry);
+
+ List cb2schToInsert = new List();
+ List scApprovalPeriodHistoriesToInsert = new List();
+ foreach (var originalC2S in lOriginal.CostBearer2SupportConceptList)
+ {
+ var C2SHistory = new CostBearer2SupportConceptHistory()
+ {
+ //CostBearer2SupportConcept_AccountingTransactions = originalC2S.AccountingTransactions,
+ CostBearer2SupportConcept_ApprovedEndDate = originalC2S.ApprovedEndDate,
+ CostBearer2SupportConcept_ApprovedStartDate = originalC2S.ApprovedStartDate,
+ CostBearer2SupportConcept_AuswahlBezeichnung = originalC2S.AuswahlBezeichnung,
+ CostBearer2SupportConcept_CostBearerContactPersonOid = originalC2S.CostBearerContactPerson?.Oid,
+ CostBearer2SupportConcept_CostBearerOid = originalC2S.CostBearer?.Oid,
+ CostBearer2SupportConcept_CustomerReferenceNumber = originalC2S.CustomerReferenceNumber,
+ CostBearer2SupportConcept_MonthlyPayment = originalC2S.MonthlyPayment,
+ CostBearer2SupportConcept_RequestedEndDate = originalC2S.RequestedEndDate,
+ CostBearer2SupportConcept_RequestedStartDate = originalC2S.RequestedStartDate,
+ //CostBearer2SupportConcept_ServiceRecords = originalC2S.ServiceRecords,
+ CostBearer2SupportConcept_Status = originalC2S.Status,
+ //CostBearer2SupportConcept_SupportConceptApprovalPeriodList = originalC2S.ApprovalPeriodList
+ CostBearer2SupportConcept_SupportConceptHistoryOid = lOriginal.Oid.Value,
+ ChangeType = statementType,
+ Notice = originalC2S.Notice
+ };
+ DAOFactory.GenericDAO.Insert(C2SHistory);
+
+ foreach (var item in originalC2S.ApprovalPeriodList)
+ {
+ var scApprovalPeriodHistory = new SupportConceptApprovalPeriodHistory()
+ {
+ ChangeType = statementType,
+ SupportConceptApprovalPeriod_ApprovedBEInterval = item.ApprovedBEInterval,
+ SupportConceptApprovalPeriod_ApprovedBEPerInterval = item.ApprovedBEPerInterval,
+ SupportConceptApprovalPeriod_ApprovedBETotal = item.ApprovedBETotal,
+ SupportConceptApprovalPeriod_ApprovedFixedAmount = item.ApprovedFixedAmount,
+ SupportConceptApprovalPeriod_ApprovedFixedAmountInterval = item.ApprovedFixedAmountInterval,
+ SupportConceptApprovalPeriod_Bewilligungsart = item.Bewilligungsart,
+ SupportConceptApprovalPeriod_BudgetOid = item.Budget?.Oid.Value,
+ SupportConceptApprovalPeriod_ContactCountInterval = item.ContactCountInterval,
+ SupportConceptApprovalPeriod_ContactCountPerInterval = item.ContactCountPerInterval,
+ SupportConceptApprovalPeriod_CostBearer2SupportConceptHistoryOid = originalC2S.Oid.Value,
+ SupportConceptApprovalPeriod_EndDate = item.EndDate,
+ SupportConceptApprovalPeriod_IsApprovedBEShifting = item.IsApprovedBEShifting,
+ SupportConceptApprovalPeriod_IsApprovedFixedAmountShifting = item.IsApprovedFixedAmountShifting,
+ SupportConceptApprovalPeriod_MonthlyPayment = item.MonthlyPayment,
+ SupportConceptApprovalPeriod_StartDate = item.StartDate,
+ SupportConceptApprovalPeriod_SupportConceptApprovalPeriod2Employee = item.SupportConceptApprovalPeriod2Employee,
+ SupportConceptApprovalPeriod_SupportConceptHistoryOid = supportConceptHistoryEntry.Oid.Value,
+ Notice = item.Notice
+ };
+ DAOFactory.GenericDAO.Insert(scApprovalPeriodHistory);
+ }
+ }
+ //MakeHistoryEntry(lOriginal.Customer2PersonList, originalCustomer2PersonList, lOriginal.Oid, statementType);
+ //MakeHistoryEntry(lOriginal.Customer2OrganisationList, originalC2OList, lOriginal.Oid, statementType);
+ //MakeHistoryEntry(lOriginal.Employee2CustomerList, originale2CList, lOriginal.Oid, statementType);
+ }
+
+ // ToDo: Unterschriftenbemerkung hier einbauen
+ public static void MakeServiceRecordHistoryEntry(List lOriginals, IEnumerable serviceRecordOidList, StatementType statementType)
+ {
+ var serviceRecordHistoryEntries = new List();
+
+ if (statementType.Equals(StatementType.Insert) && serviceRecordOidList != null)
+ {
+ var iterator = 0;
+ foreach (var history in lOriginals.Select(serviceRecordOriginal => new ServiceRecordHistory
+ {
+ TimeStamp = DateTime.Now,
+ ChangeType = statementType,
+ CostBearer2SupportConcept = serviceRecordOriginal.CostBearer2SupportConcept,
+ CostBearer2SupportConceptOid = serviceRecordOriginal.CostBearer2SupportConceptOid,
+ Customer = serviceRecordOriginal.Customer,
+ CustomerOid = serviceRecordOriginal.CustomerOid,
+ Employee = serviceRecordOriginal.Employee,
+ EmployeeOid = serviceRecordOriginal.EmployeeOid,
+ End = serviceRecordOriginal.End,
+ Group = serviceRecordOriginal.Group,
+ GroupEmployeeCount = serviceRecordOriginal.GroupEmployeeCount,
+ GroupOid = serviceRecordOriginal.GroupOid,
+ GroupPersonCount = serviceRecordOriginal.GroupPersonCount,
+ GroupRoundedDuration = serviceRecordOriginal.GroupRoundedDuration,
+ IP = serviceRecordOriginal.IP,
+ IsActive = serviceRecordOriginal.IsActive,
+ Notice = serviceRecordOriginal.Notice,
+ ServiceRecordOid = serviceRecordOidList.ElementAt(iterator),
+ RoundedDuration = serviceRecordOriginal.RoundedDuration,
+ ServiceDescription = serviceRecordOriginal.ServiceDescription,
+ ServiceRecordType = serviceRecordOriginal.ServiceRecordType,
+ ServiceRecordInsTs = serviceRecordOriginal.InsTs,
+ ServiceRecordVersion = serviceRecordOriginal.Version ?? 0,
+ ServiceRecordInsUser = serviceRecordOriginal.InsUser,
+ ServiceRecordUdpUser = serviceRecordOriginal.UdpUser,
+ Start = serviceRecordOriginal.Start,
+ SupportConcept = serviceRecordOriginal.SupportConcept,
+ SystemEntryID = serviceRecordOriginal.SystemEntryID,
+ DistanceInMeter = serviceRecordOriginal.DistanceInMeter,
+ IsCreatedInMobileClient = serviceRecordOriginal.IsCreatedInMobileClient
+ }))
+ {
+ iterator++;
+ serviceRecordHistoryEntries.Add(history);
+ }
+ }
+ else
+ {
+ foreach (var original in lOriginals)
+ {
+ SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
+
+ if (original.Oid.HasValue)
+ {
+ previousRecordHistorySignatureInfo = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecordOid(original.Oid.Value);
+ }
+
+ serviceRecordHistoryEntries.AddIfNotIn(new ServiceRecordHistory
+ {
+ TimeStamp = DateTime.Now,
+ ChangeType = statementType,
+ CostBearer2SupportConcept = original.CostBearer2SupportConcept,
+ CostBearer2SupportConceptOid = original.CostBearer2SupportConceptOid,
+ Customer = original.Customer,
+ CustomerOid = original.CustomerOid,
+ Employee = original.Employee,
+ EmployeeOid = original.EmployeeOid,
+ End = original.End,
+ Group = original.Group,
+ GroupEmployeeCount = original.GroupEmployeeCount,
+ GroupOid = original.GroupOid,
+ GroupPersonCount = original.GroupPersonCount,
+ GroupRoundedDuration = original.GroupRoundedDuration,
+ IP = original.IP,
+ IsActive = original.IsActive,
+ Notice = original.Notice,
+ ServiceRecordOid = original.Oid,
+ RoundedDuration = original.RoundedDuration,
+ ServiceDescription = original.ServiceDescription,
+ ServiceRecordType = original.ServiceRecordType,
+ ServiceRecordInsTs = original.InsTs,
+ ServiceRecordVersion = original.Version ?? 0,
+ ServiceRecordInsUser = original.InsUser,
+ ServiceRecordUdpUser = original.UdpUser,
+ Start = original.Start,
+ SupportConcept = original.SupportConcept,
+ SystemEntryID = original.SystemEntryID,
+ DistanceInMeter = original.DistanceInMeter,
+ IsCreatedInMobileClient = original.IsCreatedInMobileClient,
+ ServiceRecordSignatureStateType = previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
+ CustomerConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
+ EmployeeConfirmationReceiptSignatureStateType = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
+ CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
+ EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
+ });
+ }
+ }
+
+ DAOFactory.GenericDAO.Insert(serviceRecordHistoryEntries);
+ }
+
+ public static void MakeServiceRecordHistoryEntryWithSignatureStates(List serviceRecords2SignatureStates, StatementType statementType)
+ {
+ var serviceRecordHistoryEntries = new List();
+
+ foreach (var serviceRecord2SignatureState in serviceRecords2SignatureStates)
+ {
+ var serviceRecord = serviceRecord2SignatureState.ServiceRecord;
+ var singleSignatureState = serviceRecord2SignatureState.SingleSignatureStateType;
+ var customerMonthlySignatureState = serviceRecord2SignatureState.CustomerMonthlySignatureStateType;
+ var employeeMonthlySignatureState = serviceRecord2SignatureState.EmployeeMonthlySignatreStateType;
+
+ SignatureStateInfoFromServiceRecordHistoryEntry previousRecordHistorySignatureInfo = null;
+
+ if (serviceRecord.Oid.HasValue)
+ {
+ //previousRecordHistoryEntry = DAOFactory.SearchDAO.FindMostRecentServiceRecordHistoryEntryByServiceRecordOid(serviceRecord.Oid.Value);
+ previousRecordHistorySignatureInfo = DAOFactory.SearchDAO.FindMostRecentSignatureStatusInfoByServiceRecordOid(serviceRecord.Oid.Value);
+ }
+
+ serviceRecordHistoryEntries.AddIfNotIn(new ServiceRecordHistory
+ {
+ TimeStamp = DateTime.Now,
+ ChangeType = statementType,
+ CostBearer2SupportConcept = serviceRecord.CostBearer2SupportConcept,
+ CostBearer2SupportConceptOid = serviceRecord.CostBearer2SupportConceptOid,
+ Customer = serviceRecord.Customer,
+ CustomerOid = serviceRecord.CustomerOid,
+ Employee = serviceRecord.Employee,
+ EmployeeOid = serviceRecord.EmployeeOid,
+ End = serviceRecord.End,
+ Group = serviceRecord.Group,
+ GroupEmployeeCount = serviceRecord.GroupEmployeeCount,
+ GroupOid = serviceRecord.GroupOid,
+ GroupPersonCount = serviceRecord.GroupPersonCount,
+ GroupRoundedDuration = serviceRecord.GroupRoundedDuration,
+ IP = serviceRecord.IP,
+ IsActive = serviceRecord.IsActive,
+ Notice = serviceRecord.Notice,
+ ServiceRecordOid = serviceRecord.Oid,
+ RoundedDuration = serviceRecord.RoundedDuration,
+ ServiceDescription = serviceRecord.ServiceDescription,
+ ServiceRecordType = serviceRecord.ServiceRecordType,
+ ServiceRecordInsTs = serviceRecord.InsTs,
+ ServiceRecordVersion = serviceRecord.Version ?? 0,
+ ServiceRecordInsUser = serviceRecord.InsUser,
+ ServiceRecordUdpUser = serviceRecord.UdpUser,
+ Start = serviceRecord.Start,
+ SupportConcept = serviceRecord.SupportConcept,
+ SystemEntryID = serviceRecord.SystemEntryID,
+ DistanceInMeter = serviceRecord.DistanceInMeter,
+ IsCreatedInMobileClient = serviceRecord.IsCreatedInMobileClient,
+ ServiceRecordSignatureStateType = singleSignatureState ?? previousRecordHistorySignatureInfo?.ServiceRecordSignatureStateType ?? SignatureStateType.None,
+ CustomerConfirmationReceiptSignatureStateType = customerMonthlySignatureState ?? previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
+ EmployeeConfirmationReceiptSignatureStateType = employeeMonthlySignatureState ?? previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureStateType ?? SignatureStateType.None,
+ CustomerConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.CustomerConfirmationReceiptSignatureOid,
+ EmployeeConfirmationReceiptSignatureOid = previousRecordHistorySignatureInfo?.EmployeeConfirmationReceiptSignatureOid
+ });
+ }
+
+ DAOFactory.GenericDAO.Insert(serviceRecordHistoryEntries);
+ }
+
+ public static Bargeldtransaktionshistory CreateTransactionHistoryObject(Bargeldtransaktion transaction, StatementType changeType, SignatureStateType signatureState)
+ {
+ return new Bargeldtransaktionshistory
+ {
+ Betrag = transaction.Betrag,
+ BargeldtransaktionOid = transaction.Oid,
+ BargeldtransaktionInsTs = transaction.InsTs,
+ BargeldtransaktionInsUser = transaction.InsUser,
+ BargeldtransaktionUdpUser = transaction.UdpUser,
+ BargeldtransaktionVersion = transaction.Version,
+ ChangeType = changeType,
+ Belegnummer = transaction.Belegnummer,
+ Notice = transaction.Notice,
+ IsActive = ActivationTypeId.Active,
+ SignatureOid = transaction.SignatureOid,
+ SignatureState = signatureState,
+ Zahlungstyp = transaction.Zahlungstyp,
+ Zahlungsdatum = transaction.Zahlungsdatum
+ };
+ }
+
+ public static void MakeHistoryEntry(IList lNewList, List lOriginalList, long? customerOid, StatementType sType) where T : BeWoEntityBase
+ {
+ if (sType.Equals(StatementType.Delete) || sType.Equals(StatementType.Insert) || sType.Equals(StatementType.Archived) || sType.Equals(StatementType.Reactivate))
+ {
+ foreach (T newObject in lNewList)
+ MakeActualHistoryEntry(newObject, sType, customerOid);
+
+ return;
+ }
+
+ List OidOfOriginalsList = lOriginalList.Select(element => element.Oid.Value).Select(oid => (long?)oid).ToList();
+ List OidOfNewsList = lNewList.Select(element => element.Oid.Value).Select(oid => (long?)oid).ToList();
+
+ if (lOriginalList.Count <= 0 && lNewList.Count <= 0)
+ return;
+
+ foreach (T newObject in lNewList)
+ {
+ if (!OidOfOriginalsList.Contains(newObject.Oid))
+ MakeActualHistoryEntry(newObject, StatementType.Insert, customerOid);
+ else
+ {
+ T TObject = lOriginalList.Find(t => t.Oid.Equals(newObject.Oid));
+ if (TObject.Version != newObject.Version)
+ MakeActualHistoryEntry(newObject, StatementType.Update, customerOid);
+ }
+ }
+
+ foreach (T oldObject in lOriginalList.Where(oldObject => !OidOfNewsList.Contains(oldObject.Oid)))
+ MakeActualHistoryEntry(oldObject, StatementType.Delete, customerOid);
+ }
+
+ public static void MakeActualHistoryEntry(T entityObj, StatementType sType, long? customerOid)
+ {
+ Customer customer = null;
+ if (customerOid != null)
+ customer = DAOFactory.GenericDAO.LoadByID(customerOid.Value);
+
+ if (entityObj is Customer2Person)
+ {
+ var customer2Person = entityObj as Customer2Person;
+ var historyEntry = new Customer2PersonHistory
+ {
+ ChangeType = sType,
+ Customer2PersonInsTs = customer2Person.InsTs,
+ Customer2PersonInsUser = customer2Person.InsUser,
+ Customer2PersonOid = customer2Person.Oid,
+ Customer2PersonUdpUser = customer2Person.UdpUser,
+ Customer2PersonVersion = customer2Person.Version.Value,
+ Notice = customer2Person.Notice,
+ Person = customer2Person.Person,
+ CustomerOid = customer.Oid
+ };
+
+ DAOFactory.GenericDAO.Insert(historyEntry);
+ }
+ else if (entityObj is Customer2Organisation)
+ {
+ var customer2Organisation = entityObj as Customer2Organisation;
+ var historyEntry = new Customer2OrganisationHistory
+ {
+ ChangeType = sType,
+ Organisation = customer2Organisation.Organisation,
+ Notice = customer2Organisation.Notice,
+ Customer2OrganisationInsTs = customer2Organisation.InsTs,
+ Customer2OrganisationOid = customer2Organisation.Oid,
+ Customer2OrganisationInsUser = customer2Organisation.InsUser,
+ Customer2OrganisationUdpUser = customer2Organisation.UdpUser,
+ Customer2OrganisationVersion = customer2Organisation.Version.Value,
+ Info1 = customer2Organisation.Info1,
+ Info2 = customer2Organisation.Info2,
+ Info3 = customer2Organisation.Info3,
+ Info4 = customer2Organisation.Info4,
+ Info5 = customer2Organisation.Info5,
+ CustomerOid = customer.Oid
+ };
+
+ DAOFactory.GenericDAO.Insert(historyEntry);
+ }
+ else if (entityObj is Employee2Customer)
+ {
+ var employee2Customer = entityObj as Employee2Customer;
+ var historyEntry = new Employee2CustomerHistory
+ {
+ ChangeType = sType,
+ Customer = customer,
+ CustomerOid = customer.Oid,
+ Employee = employee2Customer.Employee,
+ EmployeeOid = employee2Customer.EmployeeOid,
+ Employee2CustomerInsTs = employee2Customer.InsTs,
+ Employee2CustomerInsUser = employee2Customer.InsUser,
+ Employee2CustomerOid = employee2Customer.Oid.Value,
+ Employee2CustomerUdpUser = employee2Customer.UdpUser,
+ Employee2CustomerVersion = employee2Customer.Version.Value,
+ Notice = employee2Customer.Notice
+ };
+
+ DAOFactory.GenericDAO.Insert(historyEntry);
+ }
+ }
+ }
+}
diff --git a/Shared/BeWoEntityEnums.cs b/Shared/BeWoEntityEnums.cs
index bf6664b1c..3798a21de 100644
--- a/Shared/BeWoEntityEnums.cs
+++ b/Shared/BeWoEntityEnums.cs
@@ -179,7 +179,8 @@ namespace BS.Shared
TwoFactorCode = 172,
CustomerWohnhilfe = 173,
AiSettings = 174,
- SignatureDeletionHistory = 175
+ SignatureDeletionHistory = 175,
+ AbsenceTimeHistory = 176,
}
public enum SystemEntryID
diff --git a/Shared/Core/SettingsKeys.cs b/Shared/Core/SettingsKeys.cs
index d2004b83d..b59b6b617 100644
--- a/Shared/Core/SettingsKeys.cs
+++ b/Shared/Core/SettingsKeys.cs
@@ -9,6 +9,8 @@
public static string ShowSignature => "ShowSignature";
public static string ShowDistanceFields => "ShowDistanceFields";
public static string IsServiceRecordNoticeMandatory => "IsServiceRecordNoticeMandatory";
+ public static string IsServiceRecordGoalMandatory => "IsServiceRecordGoalMandatory";
+ public static string IsServiceRecordRatingMandatory => "IsServiceRecordRatingMandatory";
public static string IsEndDateVisible => "IsEndDateVisible";
public static string IsZeiterfassungInStdMin => "IsZeiterfassungInStdMin";