From 2a92b0bc107d2670b1773880afc26b0fe082482f Mon Sep 17 00:00:00 2001 From: Alexandra Date: Tue, 24 Mar 2026 13:42:20 +0100 Subject: [PATCH] =?UTF-8?q?SearchDAO=20und=20EmployeeKilometerauswertungsL?= =?UTF-8?q?istRO=20-=20Erweiterung=20um=20auf=20Unterschriften=20QBs=20zug?= =?UTF-8?q?reifen=20zu=20k=C3=B6nnen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/Access/SearchDAO.cs | 27 ++++++++++++++----- .../EmployeeKilometerauswertungsListRO.cs | 5 ++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Data/Access/SearchDAO.cs b/Data/Access/SearchDAO.cs index 7650017d2..5920a4e85 100644 --- a/Data/Access/SearchDAO.cs +++ b/Data/Access/SearchDAO.cs @@ -4149,14 +4149,29 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{ // TODO 16.02.2021: Alias für EmployeeOid erstellen? public IList GetConfirmationReceiptSignaturesByEmployee(long employeeOid, DateTimeSpan timeSpan) { + var liste = CreateCriteria() + .Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.SignatureType), SignatureType.Employee)) + .Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active)) + //.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid)) + .CreateAlias(nameof(ConfirmationReceiptSignature.Employee), "e", JoinType.InnerJoin) + .Add(Restrictions.Eq(nameof(BeWoEntityBase.Oid), employeeOid)) + .CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "s", JoinType.InnerJoin) + .Add(CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, "s.Start", "s.End")).List(); + + return liste; + } + + public IList GetConfirmationReceiptSignaturesByEmployeeInTimeSpan(long employeeOid, DateTimeSpan timeSpan) + { + var start = timeSpan.StartDate; + var end = timeSpan.EndDate; + + var timeSpanCriterion = CreateBetweenDateTimesCriterion(start, end, $"serviceRecord.{nameof(ServiceRecord.Start)}", $"serviceRecord.{nameof(ServiceRecord.End)}"); var liste = CreateCriteria() .Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.SignatureType), SignatureType.Employee)) - .Add(Restrictions.Eq(nameof(BeWoEntityBase.IsActive), ActivationTypeId.Active)) - //.Add(Restrictions.Eq(nameof(ConfirmationReceiptSignature.EmployeeOid), employeeOid)) - .CreateAlias(nameof(ConfirmationReceiptSignature.Employee), "e", JoinType.InnerJoin) - .Add(Restrictions.Eq(nameof(BeWoEntityBase.Oid), employeeOid)) - .CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "s", JoinType.InnerJoin) - .Add(CreateBetweenDateTimesCriterion(timeSpan.StartDateTime, timeSpan.EndDateTime, "s.Start", "s.End")).List(); + .CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "serviceRecord") + .Add(Restrictions.Eq($"serviceRecord.{nameof(ServiceRecord.EmployeeOid)}", employeeOid)) + .Add(timeSpanCriterion).List(); return liste; } diff --git a/Report/ReportObjects/EmployeeKilometerauswertungsListRO.cs b/Report/ReportObjects/EmployeeKilometerauswertungsListRO.cs index 74c499ab8..33273929f 100644 --- a/Report/ReportObjects/EmployeeKilometerauswertungsListRO.cs +++ b/Report/ReportObjects/EmployeeKilometerauswertungsListRO.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using BeWo.Data.Access; using BeWo.Data.Entities; @@ -79,6 +80,10 @@ namespace BeWo.Report.ReportObjects public String TotalCustom1 { get; set; } + public Bitmap EmployeeSignature { get; set; } + + public DateTime? EmployeeSignatureDate { get; set; } + public Employee2EmployeeKilometerauswertungsEntry(CompactEmployeeDC employee, IEnumerable serviceRecords) { Employee = employee;