Merge branch 'master' of ssh://float.ownsoft.de/git/beyondSoft/BeWo into master
This commit is contained in:
@@ -5093,6 +5093,9 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Customer\CustomerAbsenceTimeFormPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Report\QuittierungsbelegsPreviewPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
@@ -5111,7 +5114,7 @@
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>False</AutoAssignPort>
|
||||
<DevelopmentServerPort>8808</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<StartPageUrl>http://localhost/BeWoPlanerMobil</StartPageUrl>
|
||||
<StartPageUrl>Views/Login/Index.cshtml</StartPageUrl>
|
||||
<StartAction>CurrentPage</StartAction>
|
||||
<AspNetDebugging>True</AspNetDebugging>
|
||||
<SilverlightDebugging>False</SilverlightDebugging>
|
||||
|
||||
@@ -488,7 +488,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
#region Abwesenheiten
|
||||
|
||||
// ToDo: Zu CreateOrUpdateAbsenceTime umbauen!
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult CreateOrUpdateAbsenceTime(FormCollection formCollection)
|
||||
@@ -496,8 +495,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var selectedAbsenceTime = Model.SelectedAbsenceTime;
|
||||
var oid = selectedAbsenceTime?.AbsenceTimeOid;
|
||||
|
||||
|
||||
|
||||
var isNew = oid is null;
|
||||
|
||||
var startDateString = formCollection["customer-absence-time-start-date"];
|
||||
@@ -506,6 +503,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var endTimeString = formCollection["customer-absence-time-end-time"];
|
||||
var category = formCollection["customer-absence-time-category"];
|
||||
var notice = formCollection["customer-absence-time-notice"];
|
||||
var allDay = "on" == formCollection["customer-absence-time-allday-cb"];
|
||||
|
||||
if(allDay)
|
||||
{
|
||||
startTimeString = null;
|
||||
endTimeString = null;
|
||||
}
|
||||
|
||||
var startString = $"{startDateString} {startTimeString ?? "00:00"}";
|
||||
var endString = $"{endDateString} {endTimeString ?? "00:00"}";
|
||||
@@ -524,18 +528,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var absenceTime = new AbsenceTimeDC
|
||||
{
|
||||
CustomerOid = customer.CustomerOid,
|
||||
Reason = absenceReason,
|
||||
Start = start,
|
||||
End = end,
|
||||
Notice = notice
|
||||
Reason = absenceReason,
|
||||
Start = start,
|
||||
End = end,
|
||||
Notice = notice
|
||||
};
|
||||
|
||||
OperationsService.InsertNewCustomerAbsenceTime(customer.CustomerOid.Value, absenceTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedAbsenceTime.Start = start;
|
||||
selectedAbsenceTime.End = end;
|
||||
selectedAbsenceTime.Start = start;
|
||||
selectedAbsenceTime.End = end;
|
||||
selectedAbsenceTime.Reason = absenceReason;
|
||||
selectedAbsenceTime.Notice = notice;
|
||||
|
||||
@@ -550,35 +554,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Customer", new { id = customer.CustomerOid });
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult DeleteAbsenceTime(FormCollection formCollection)
|
||||
{
|
||||
var customer = Model.SelectedCustomer;
|
||||
|
||||
var isParsingSuccessful = long.TryParse(formCollection["customer-absence-time-to-delete-oid"], out var absenceTimeOid);
|
||||
|
||||
if(isParsingSuccessful)
|
||||
{
|
||||
var absenceTime2Delete = customer.AbsenceTimes.FirstOrDefault(at => at.AbsenceTimeOid.HasValue && at.AbsenceTimeOid.Value.Equals(absenceTimeOid));
|
||||
|
||||
if(!(absenceTime2Delete is null))
|
||||
{
|
||||
customer.AbsenceTimes.Remove(absenceTime2Delete);
|
||||
|
||||
CustomerService.UpdateCustomer(customer);
|
||||
}
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("Customer", new { id = customer?.CustomerOid });
|
||||
}
|
||||
|
||||
// ToDo: Fehlermeldungen einbauen!
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult SelectAbsenceTime(long absenceTimeOid)
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(absenceTimeOid == 0)
|
||||
{
|
||||
return RedirectToActionPermanent("Customer", Model);
|
||||
@@ -630,6 +614,27 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult DeleteAbsenceTime(long absenceTimeOid)
|
||||
{
|
||||
var absenceTime2Delete = Model.SelectedCustomer.AbsenceTimes.FirstOrDefault(absenceTime => absenceTime.AbsenceTimeOid.HasValue && absenceTime.AbsenceTimeOid.Equals(absenceTimeOid));
|
||||
|
||||
if(absenceTime2Delete is null)
|
||||
{
|
||||
ViewData["AbsenceTimeError"] = "Beim Löschen der Abwesenheit ist ein Fehler aufgetreten!<br/><br/>Bitte wenden Sie sich an Ihren Administrator.";
|
||||
}
|
||||
|
||||
var customer = Model.SelectedCustomer;
|
||||
|
||||
customer.AbsenceTimes.Remove(absenceTime2Delete);
|
||||
|
||||
CustomerService.UpdateCustomer(customer);
|
||||
|
||||
LoadCustomerToModel(customer.CustomerOid);
|
||||
|
||||
return PartialView("CustomerAbsenceTimePartial", Model);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
@@ -2629,7 +2629,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
if(Model?.SelectedSupportConcept?.Customer?.Oid.HasValue ?? false)
|
||||
{
|
||||
//return RedirectToActionPermanent("PreselectCustomer", "Customer", new {Model.SelectedSupportConcept.Customer.CustomerOid});
|
||||
return RedirectToActionPermanent("Customer", "Customer", new { id = Model.SelectedSupportConcept.Customer.Oid });
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
@@ -32,9 +31,9 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
if(((ReportModel) Session[ModelSessionConstants.ReportModelKey])?.Employee == null)
|
||||
if(((ReportModel) Session[ModelSessionConstants.ReportModelKey])?.Employee is null)
|
||||
{
|
||||
_Model = new ReportModel {Employee = MobileSessionFacade.LoggedInEmployee};
|
||||
_Model = new ReportModel {Employee = MobileSessionFacade.LoggedInEmployee, ReportCreator = GetReportCreator()};
|
||||
Session[ModelSessionConstants.ReportModelKey] = _Model;
|
||||
}
|
||||
else
|
||||
@@ -46,6 +45,18 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
private static AbstractReportCreator GetReportCreator()
|
||||
{
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>();
|
||||
|
||||
#if DEBUG
|
||||
creator.TempPath = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"demo\temp");
|
||||
#else
|
||||
creator.TempPath = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, PluginLoader.Tenant + @"\temp");
|
||||
#endif
|
||||
return creator;
|
||||
}
|
||||
|
||||
// Veraltet, wird nicht mehr benutzt.
|
||||
[Authorize]
|
||||
public ActionResult Report()
|
||||
@@ -60,8 +71,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
|
||||
//CreateServiceOverview(null);
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
|
||||
@@ -110,8 +119,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
Model.Organisations.Sort((x, y) => x.Name.CompareTo(y.Name));
|
||||
|
||||
Model.AllTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(MobileSessionFacade.LoggedInEmployee.EmployeeOid);
|
||||
|
||||
CreateReport(null);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -122,235 +129,234 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult CreateServiceOverview(FormCollection formCollection)
|
||||
{
|
||||
if(Model?.Employee?.EmployeeOid is null)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
//[Authorize]
|
||||
//[HttpPost]
|
||||
//public ActionResult CreateServiceOverview(FormCollection formCollection)
|
||||
//{
|
||||
// if(Model?.Employee?.EmployeeOid is null)
|
||||
// {
|
||||
// return Logout();
|
||||
// }
|
||||
|
||||
if(Model.SelectedFilterItem is null)
|
||||
{
|
||||
return RedirectToActionPermanent("Report");
|
||||
}
|
||||
// if(Model.SelectedFilterItem is null)
|
||||
// {
|
||||
// return RedirectToActionPermanent("Report");
|
||||
// }
|
||||
|
||||
CreateReport(formCollection);
|
||||
// CreateReport(formCollection);
|
||||
|
||||
return RedirectToActionPermanent("Report");
|
||||
}
|
||||
// return RedirectToActionPermanent("Report");
|
||||
//}
|
||||
|
||||
[Authorize]
|
||||
private void CreateReport(NameValueCollection formCollection)
|
||||
{
|
||||
if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
||||
{
|
||||
var customerOidString = formCollection == null ? Model.SelectedCustomerOid.ToString() : formCollection[FormCollectionConstants.SelectedCustomerOidKey];
|
||||
//[Authorize]
|
||||
//private void CreateReport(NameValueCollection formCollection)
|
||||
//{
|
||||
// if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
||||
// {
|
||||
// var customerOidString = formCollection is null ? Model.SelectedCustomerOid.ToString() : formCollection[FormCollectionConstants.SelectedCustomerOidKey];
|
||||
|
||||
var isCustomerOidSuccessful = long.TryParse(customerOidString, out var selectedCustomerOid);
|
||||
// var isCustomerOidSuccessful = long.TryParse(customerOidString, out var selectedCustomerOid);
|
||||
|
||||
if(isCustomerOidSuccessful)
|
||||
{
|
||||
var selectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == selectedCustomerOid);
|
||||
// if(isCustomerOidSuccessful)
|
||||
// {
|
||||
// var selectedCustomer = Model.Customers.FirstOrDefault(customer => customer.CustomerOid == selectedCustomerOid);
|
||||
|
||||
Model.SelectedCustomer = selectedCustomer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedCustomer = null;
|
||||
}
|
||||
// Model.SelectedCustomer = selectedCustomer;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Model.SelectedCustomer = null;
|
||||
// }
|
||||
|
||||
if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.TeamAuswahl)
|
||||
{
|
||||
var teamOidString = formCollection == null ? Model.SelectedTeamOid.ToString() : formCollection[FormCollectionConstants.SelectedTeamOidKey];
|
||||
// if(Model.SelectedFilterItem?.FilterEnum == QBFilterEnum.TeamAuswahl)
|
||||
// {
|
||||
// var teamOidString = formCollection is null ? Model.SelectedTeamOid.ToString() : formCollection[FormCollectionConstants.SelectedTeamOidKey];
|
||||
|
||||
var isTeamOidSuccessful = long.TryParse(teamOidString, out var selectedTeamOid);
|
||||
// var isTeamOidSuccessful = long.TryParse(teamOidString, out var selectedTeamOid);
|
||||
|
||||
if(isTeamOidSuccessful)
|
||||
{
|
||||
var selectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == selectedTeamOid);
|
||||
// if(isTeamOidSuccessful)
|
||||
// {
|
||||
// var selectedTeam = Model.AllTeams.FirstOrDefault(team => team.TeamOid == selectedTeamOid);
|
||||
|
||||
Model.SelectedTeam = selectedTeam;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.SelectedTeam = null;
|
||||
}
|
||||
// Model.SelectedTeam = selectedTeam;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Model.SelectedTeam = null;
|
||||
// }
|
||||
|
||||
// Datumsangaben laden in separater Methode
|
||||
var reportTimeFrame = GetReportTimeFrame();
|
||||
// var reportTimeFrame = GetReportTimeFrame();
|
||||
|
||||
var reportObjects = new List<ServicesOverviewRO>();
|
||||
// var reportObjects = new List<ServicesOverviewRO>();
|
||||
|
||||
var organisationOid = Model.SelectedOrganisationOid ?? 0;
|
||||
var employeeOid = Model.SelectedEmployeeOid ?? 0;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var customerOid = Model.SelectedCustomerOid ?? 0;
|
||||
// var organisationOid = Model.SelectedOrganisationOid ?? 0;
|
||||
// var employeeOid = Model.SelectedEmployeeOid ?? 0;
|
||||
// var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
// var teamOid = Model.SelectedTeamOid;
|
||||
// var customerOid = Model.SelectedCustomerOid ?? 0;
|
||||
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>() ?? new DefaultReportCreator();
|
||||
// var creator = PluginLoader.FindClass<DefaultReportCreator>() ?? new DefaultReportCreator();
|
||||
|
||||
switch(Model.SelectedFilterItem?.FilterEnum)
|
||||
{
|
||||
case QBFilterEnum.AlleKlienten:
|
||||
reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid);
|
||||
break;
|
||||
case QBFilterEnum.NurKlientenMeinesTeams:
|
||||
var teamRelatedCustomerOids = creator.GetKlientenOidsMeinesTeams(null);
|
||||
reportObjects.AddRange(teamRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
case QBFilterEnum.MeineKlienten:
|
||||
var myRelatedCustomerOids = creator.GetMeineKlientenOids();
|
||||
reportObjects.AddRange(myRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
case QBFilterEnum.KlientenAuswahl:
|
||||
reportObjects = new List<ServicesOverviewRO> { ServicesOverviewRO.Create(customerOid, reportTimeFrame.Month, reportTimeFrame.Year, false, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid) };
|
||||
break;
|
||||
case QBFilterEnum.TeamAuswahl:
|
||||
var customerOids = creator.GetKlientenOidsMeinesTeams(teamOid);
|
||||
reportObjects.AddRange(customerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
break;
|
||||
default:
|
||||
reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid, true, false);
|
||||
break;
|
||||
}
|
||||
// switch(Model.SelectedFilterItem?.FilterEnum)
|
||||
// {
|
||||
// case QBFilterEnum.AlleKlienten:
|
||||
// reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid);
|
||||
// break;
|
||||
// case QBFilterEnum.NurKlientenMeinesTeams:
|
||||
// var teamRelatedCustomerOids = creator.GetKlientenOidsMeinesTeams(null);
|
||||
// reportObjects.AddRange(teamRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
// break;
|
||||
// case QBFilterEnum.MeineKlienten:
|
||||
// var myRelatedCustomerOids = creator.GetMeineKlientenOids();
|
||||
// reportObjects.AddRange(myRelatedCustomerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
// break;
|
||||
// case QBFilterEnum.KlientenAuswahl:
|
||||
// reportObjects = new List<ServicesOverviewRO> { ServicesOverviewRO.Create(customerOid, reportTimeFrame.Month, reportTimeFrame.Year, false, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid) };
|
||||
// break;
|
||||
// case QBFilterEnum.TeamAuswahl:
|
||||
// var customerOids = creator.GetKlientenOidsMeinesTeams(teamOid);
|
||||
// reportObjects.AddRange(customerOids.Select(cOid => ServicesOverviewRO.Create(cOid, reportTimeFrame.Month, reportTimeFrame.Year, true, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid)));
|
||||
// break;
|
||||
// default:
|
||||
// reportObjects = ServicesOverviewRO.Create(reportTimeFrame.Month, reportTimeFrame.Year, organisationOid, employeeOid, reportTimeFrame.StartDay, reportTimeFrame.EndDay, serviceCategoryOid, true, false);
|
||||
// break;
|
||||
// }
|
||||
|
||||
reportObjects = reportObjects.Where(x => x != null).ToList();
|
||||
// reportObjects = reportObjects.Where(x => x != null).ToList();
|
||||
|
||||
var srOids = new List<long>();
|
||||
// var srOids = new List<long>();
|
||||
|
||||
reportObjects.DoForEach(x => x.Services.DoForEach(s => srOids.AddIfNotIn(s.ServiceRecordOid)));
|
||||
// reportObjects.DoForEach(x => x.Services.DoForEach(s => srOids.AddIfNotIn(s.ServiceRecordOid)));
|
||||
|
||||
Model.ConfirmationReceiptSignatures = OperationsService.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(srOids, out var serviceRecordOidsWithSignature);
|
||||
// Model.ConfirmationReceiptSignatures = OperationsService.LoadAllConfirmationReceiptSignaturesByServiceRecordOids(srOids, out var serviceRecordOidsWithSignature);
|
||||
|
||||
var customerSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Customer).ToList();
|
||||
var employeeSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Employee).ToList();
|
||||
// var customerSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Customer).ToList();
|
||||
// var employeeSignatures = Model.ConfirmationReceiptSignatures.Where(crs => crs.SignatureType == SignatureType.Employee).ToList();
|
||||
|
||||
Model.ReportServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(ro => ro.Services.DoForEach(s =>
|
||||
{
|
||||
Model.ReportServiceRecordOids.AddIfNotIn(s.ServiceRecordOid);
|
||||
}));
|
||||
// Model.ReportServiceRecordOids = new List<long>();
|
||||
// reportObjects.DoForEach(ro => ro.Services.DoForEach(s =>
|
||||
// {
|
||||
// Model.ReportServiceRecordOids.AddIfNotIn(s.ServiceRecordOid);
|
||||
// }));
|
||||
|
||||
var hasEmployeeSignature = srOids.All(
|
||||
a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
// var hasEmployeeSignature = srOids.All(
|
||||
// a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
// serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
|
||||
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
// var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
// serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
|
||||
var employeeSignatureState = SignatureState.None;
|
||||
// var employeeSignatureState = SignatureState.None;
|
||||
|
||||
if(anyEmployeeSignatures)
|
||||
{
|
||||
employeeSignatureState = SignatureState.Some;
|
||||
}
|
||||
// if(anyEmployeeSignatures)
|
||||
// {
|
||||
// employeeSignatureState = SignatureState.Some;
|
||||
// }
|
||||
|
||||
if(hasEmployeeSignature)
|
||||
{
|
||||
employeeSignatureState = SignatureState.All;
|
||||
}
|
||||
// if(hasEmployeeSignature)
|
||||
// {
|
||||
// employeeSignatureState = SignatureState.All;
|
||||
// }
|
||||
|
||||
Model.ConfirmationReceiptObject = null;
|
||||
Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
|
||||
BuildInformationString(),
|
||||
new List<QuittierungsbelegResult>(),
|
||||
BuildInformationString(true),
|
||||
GetTimeSpanString(),
|
||||
hasEmployeeSignature,
|
||||
employeeSignatures.ToList(),
|
||||
employeeSignatureState);
|
||||
// Model.ConfirmationReceiptObject = null;
|
||||
// Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
|
||||
// BuildInformationString(),
|
||||
// new List<QuittierungsbelegResult>(),
|
||||
// BuildInformationString(true),
|
||||
// GetTimeSpanString(),
|
||||
// hasEmployeeSignature,
|
||||
// employeeSignatures.ToList(),
|
||||
// employeeSignatureState);
|
||||
|
||||
reportObjects.DoForEach(reportObject =>
|
||||
{
|
||||
var quittierungsbelegItems = new List<QuittierungsbelegItem>();
|
||||
// reportObjects.DoForEach(reportObject =>
|
||||
// {
|
||||
// var quittierungsbelegItems = new List<QuittierungsbelegItem>();
|
||||
|
||||
reportObject.Services.DoForEach(serviceDetail =>
|
||||
{
|
||||
quittierungsbelegItems.Add(new QuittierungsbelegItem(serviceDetail));
|
||||
});
|
||||
// reportObject.Services.DoForEach(serviceDetail =>
|
||||
// {
|
||||
// quittierungsbelegItems.Add(new QuittierungsbelegItem(serviceDetail));
|
||||
// });
|
||||
|
||||
if(quittierungsbelegItems.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// if(quittierungsbelegItems.Count == 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
|
||||
// var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
|
||||
|
||||
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a));
|
||||
// var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer) &&
|
||||
// serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a));
|
||||
|
||||
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
|
||||
// var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
|
||||
|
||||
var customerSignatureState = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Customer);
|
||||
// var customerSignatureState = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Customer);
|
||||
|
||||
var customerSignatureOid = hasCustomerSignature ? customerSignatures.FirstOrDefault(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value)))?.ConfirmationReceiptSignatureOid : null;
|
||||
var sigs = customerSignatures.Where(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value))).ToList();
|
||||
// var customerSignatureOid = hasCustomerSignature ? customerSignatures.FirstOrDefault(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value)))?.ConfirmationReceiptSignatureOid : null;
|
||||
// var sigs = customerSignatures.Where(cs => cs.ServiceRecords.All(a => a.Customer.CustomerOid.Equals(reportObject.CustomerOid) && a.ServiceRecordOid.HasValue && serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a.ServiceRecordOid.Value))).ToList();
|
||||
|
||||
var customerSignatureOids = sigs.Where(signature => signature.ConfirmationReceiptSignatureOid.HasValue).Select(signature => signature.ConfirmationReceiptSignatureOid.Value).ToList();
|
||||
// var customerSignatureOids = sigs.Where(signature => signature.ConfirmationReceiptSignatureOid.HasValue).Select(signature => signature.ConfirmationReceiptSignatureOid.Value).ToList();
|
||||
|
||||
var employeeSignatureOids = new List<long>();
|
||||
// var employeeSignatureOids = new List<long>();
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
foreach(var signature in employeeSignatures.Where(s => s.ConfirmationReceiptSignatureOid.HasValue))
|
||||
{
|
||||
foreach(var serviceRecord in signature.ServiceRecords)
|
||||
{
|
||||
var oid = serviceRecord.ServiceRecordOid;
|
||||
// if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
// {
|
||||
// foreach(var signature in employeeSignatures.Where(s => s.ConfirmationReceiptSignatureOid.HasValue))
|
||||
// {
|
||||
// foreach(var serviceRecord in signature.ServiceRecords)
|
||||
// {
|
||||
// var oid = serviceRecord.ServiceRecordOid;
|
||||
|
||||
if(oid.HasValue && oids.Contains(oid.Value))
|
||||
{
|
||||
employeeSignatureOids.AddIfNotIn(signature.ConfirmationReceiptSignatureOid.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(oid.HasValue && oids.Contains(oid.Value))
|
||||
// {
|
||||
// employeeSignatureOids.AddIfNotIn(signature.ConfirmationReceiptSignatureOid.Value);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
var customerSignatureServiceRecordOids = new List<long>();
|
||||
var employeeSignatureServiceRecordOids = new List<long>();
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer))
|
||||
{
|
||||
customerSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Customer];
|
||||
}
|
||||
// var customerSignatureServiceRecordOids = new List<long>();
|
||||
// var employeeSignatureServiceRecordOids = new List<long>();
|
||||
// if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer))
|
||||
// {
|
||||
// customerSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Customer];
|
||||
// }
|
||||
|
||||
if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
{
|
||||
employeeSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Employee];
|
||||
}
|
||||
// if(serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee))
|
||||
// {
|
||||
// employeeSignatureServiceRecordOids = serviceRecordOidsWithSignature[SignatureType.Employee];
|
||||
// }
|
||||
|
||||
foreach(var quittierungsbelegItem in quittierungsbelegItems)
|
||||
{
|
||||
var serviceRecordOid = quittierungsbelegItem.ServiceRecordOid;
|
||||
// foreach(var quittierungsbelegItem in quittierungsbelegItems)
|
||||
// {
|
||||
// var serviceRecordOid = quittierungsbelegItem.ServiceRecordOid;
|
||||
|
||||
quittierungsbelegItem.HasCustomerSignature = customerSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
quittierungsbelegItem.HasEmployeeSignature = employeeSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
}
|
||||
// quittierungsbelegItem.HasCustomerSignature = customerSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
// quittierungsbelegItem.HasEmployeeSignature = employeeSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
// }
|
||||
|
||||
Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.Add(
|
||||
item: new QuittierungsbelegResult
|
||||
(
|
||||
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
|
||||
quittierungsbelegItems,
|
||||
reportObject.CustomerOid,
|
||||
hasCustomerSignature,
|
||||
customerSignatureOid,
|
||||
customerSignatureState,
|
||||
customerSignatureOids,
|
||||
employeeSignatureState2,
|
||||
employeeSignatureOids
|
||||
)
|
||||
);
|
||||
});
|
||||
// Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.Add(
|
||||
// item: new QuittierungsbelegResult
|
||||
// (
|
||||
// $"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
|
||||
// quittierungsbelegItems,
|
||||
// reportObject.CustomerOid,
|
||||
// hasCustomerSignature,
|
||||
// customerSignatureOid,
|
||||
// customerSignatureState,
|
||||
// customerSignatureOids,
|
||||
// employeeSignatureState2,
|
||||
// employeeSignatureOids
|
||||
// )
|
||||
// );
|
||||
// });
|
||||
|
||||
if(Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.All(qbItem => qbItem.Items.Count == 0))
|
||||
{
|
||||
TempData["HasWarningMessage"] = true;
|
||||
}
|
||||
}
|
||||
// if(Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.All(qbItem => qbItem.Items.Count == 0))
|
||||
// {
|
||||
// TempData["HasWarningMessage"] = true;
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Ermittelt den Unterschriftenstatus, der besagt, ob für alle ausgewählten Zeiterfassungseinträge eine Unterschrift existiert.
|
||||
@@ -361,11 +367,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
/// <returns></returns>
|
||||
private static SignatureState GetSignatureState(List<long> oids, Dictionary<SignatureType, List<long>> serviceRecordOidsWithSignature, SignatureType signatureType)
|
||||
{
|
||||
var hasSignatures = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(signatureType) &&
|
||||
serviceRecordOidsWithSignature[signatureType].Contains(a));
|
||||
//var hasSignatures = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(signatureType) &&
|
||||
// serviceRecordOidsWithSignature[signatureType].Contains(a));
|
||||
|
||||
var hasSomeSignatures = oids.Any(a => serviceRecordOidsWithSignature.ContainsKey(signatureType) &&
|
||||
serviceRecordOidsWithSignature[signatureType].Contains(a));
|
||||
//var hasSomeSignatures = oids.Any(a => serviceRecordOidsWithSignature.ContainsKey(signatureType) &&
|
||||
// serviceRecordOidsWithSignature[signatureType].Contains(a));
|
||||
|
||||
var hasSignatures = oids.All(signatureOid => serviceRecordOidsWithSignature.ContainsValueAtKey(signatureType, signatureOid));
|
||||
|
||||
var hasSomeSignatures = oids.Any(signatureOid => serviceRecordOidsWithSignature.ContainsValueAtKey(signatureType, signatureOid));
|
||||
|
||||
if(hasSignatures)
|
||||
{
|
||||
@@ -692,6 +702,12 @@ namespace BeWoPlanerMobil.Controllers
|
||||
foreach(var csr in existingServiceRecordSignatures)
|
||||
{
|
||||
var temp = csr.ServiceRecords.Where(sr => sr.ServiceRecordOid.HasValue && !serviceRecordOidsWithSignature.Contains(sr.ServiceRecordOid.Value));
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
temp = temp.Where(sr => sr.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee));
|
||||
}
|
||||
|
||||
csr.ServiceRecords.Clear();
|
||||
csr.ServiceRecords.AddRangeIfElementsNotIn(temp);
|
||||
|
||||
@@ -716,9 +732,20 @@ namespace BeWoPlanerMobil.Controllers
|
||||
timeSpanString = timeSpanString.Substring(4);
|
||||
}
|
||||
|
||||
var filteredServiceRecords = new List<ServiceRecordDC>();
|
||||
|
||||
if(!isCustomerSig && !AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
filteredServiceRecords = serviceRecords.Where(sr => sr.Employee.Equals(MobileSessionFacade.LoggedInCompactEmployee)).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
filteredServiceRecords = serviceRecords;
|
||||
}
|
||||
|
||||
var confirmationReceiptSignature = new ConfirmationReceiptSignatureDC
|
||||
{
|
||||
ServiceRecords = serviceRecords,
|
||||
ServiceRecords = filteredServiceRecords,
|
||||
CustomerOid = isCustomerSig ? (long?) customerOid : null,
|
||||
Employee = isCustomerSig ? null : MobileSessionFacade.LoggedInCompactEmployee,
|
||||
SignatureImage = base64SignatureString,
|
||||
@@ -779,7 +806,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return result;
|
||||
}
|
||||
|
||||
foreach(var signature in dataContracts)
|
||||
foreach(var signature in dataContracts.OrderBy(o => o.InsTs))
|
||||
{
|
||||
var img = MainController.ApplyWatermark(signature.SignatureImage, Server.MapPath("../Content/images/bewoplaner_by_ownsoft_logo_mok.png"));
|
||||
var date = signature.InsTs?.ToString("dd.MM.yyyy HH:mm:ss") ?? "unbekannt";
|
||||
@@ -812,6 +839,13 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return RedirectToActionPermanent("Report");
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
private void LoadServiceOverviewToModel()
|
||||
{
|
||||
if(Model.SelectedFilterItem.FilterEnum == QBFilterEnum.KlientenAuswahl)
|
||||
{
|
||||
var customerOidString = Model.SelectedCustomerOid.ToString();
|
||||
@@ -901,13 +935,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
Model.ReportServiceRecordOids.AddIfNotIn(s.ServiceRecordOid);
|
||||
}));
|
||||
|
||||
var hasEmployeeSignature = srOids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var hasEmployeeSignature = srOids.All(
|
||||
a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
|
||||
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Employee) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Employee].Contains(a));
|
||||
var anyEmployeeSignatures = srOids.Any(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, a));
|
||||
|
||||
var employeeSignatureState = SignatureState.None;
|
||||
|
||||
@@ -921,6 +952,22 @@ namespace BeWoPlanerMobil.Controllers
|
||||
employeeSignatureState = SignatureState.All;
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
// Prüfen, ob alle eigenen ServiceRecords unterschrieben sind
|
||||
var ownServiceRecordOids = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => ownServiceRecordOids.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
// Prüfen, ob Einträge von anderen Mitarbeitern existieren
|
||||
var serviceRecordOidsFromOtherEmployees = new List<long>();
|
||||
reportObjects.DoForEach(reportObject => serviceRecordOidsFromOtherEmployees.AddRangeIfElementsNotIn(reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid)));
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState;
|
||||
}
|
||||
|
||||
Model.ConfirmationReceiptObject = null;
|
||||
Model.ConfirmationReceiptObject = new ConfirmationReceiptObject(
|
||||
BuildInformationString(),
|
||||
@@ -948,9 +995,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
var oids = quittierungsbelegItems.Select(s => s.ServiceRecordOid).ToList();
|
||||
|
||||
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsKey(SignatureType.Customer) &&
|
||||
serviceRecordOidsWithSignature[SignatureType.Customer].Contains(a));
|
||||
|
||||
var hasCustomerSignature = oids.All(a => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Customer, a));
|
||||
|
||||
var employeeSignatureState2 = GetSignatureState(oids, serviceRecordOidsWithSignature, SignatureType.Employee);
|
||||
|
||||
@@ -999,7 +1045,24 @@ namespace BeWoPlanerMobil.Controllers
|
||||
quittierungsbelegItem.HasEmployeeSignature = employeeSignatureServiceRecordOids.Contains(serviceRecordOid);
|
||||
}
|
||||
|
||||
confirmationReceiptResults.Add(
|
||||
var employeeOids = new List<long>();
|
||||
foreach(var serviceDetail in reportObject.Services)
|
||||
{
|
||||
employeeOids.AddIfNotIn(serviceDetail.EmployeeOid);
|
||||
}
|
||||
|
||||
if(!AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
var serviceRecordOidsFromOtherEmployees = reportObject.Services.Where(serviceDetail => !serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
var ownServiceRecordOids = reportObject.Services.Where(serviceDetail => serviceDetail.EmployeeOid.Equals(Model.Employee.EmployeeOid)).Select(serviceDetail => serviceDetail.ServiceRecordOid).ToList();
|
||||
|
||||
var areAllForeignEntriesSigned = serviceRecordOidsFromOtherEmployees.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
var areAllOwnEntriesSigned = ownServiceRecordOids.All(srOid => serviceRecordOidsWithSignature.ContainsValueAtKey(SignatureType.Employee, srOid));
|
||||
|
||||
employeeSignatureState2 = !areAllForeignEntriesSigned && areAllOwnEntriesSigned ? SignatureState.AllOwnServiceRecords : employeeSignatureState2;
|
||||
}
|
||||
|
||||
confirmationReceiptResults.Add(
|
||||
item: new QuittierungsbelegResult
|
||||
(
|
||||
$"{reportObject.CustomerLastName}, {reportObject.CustomerFirstName}",
|
||||
@@ -1010,7 +1073,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
customerSignatureState,
|
||||
customerSignatureOids,
|
||||
employeeSignatureState2,
|
||||
employeeSignatureOids
|
||||
employeeSignatureOids,
|
||||
employeeOids.Count
|
||||
)
|
||||
);
|
||||
});
|
||||
@@ -1021,8 +1085,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
{
|
||||
TempData["HasWarningMessage"] = true;
|
||||
}
|
||||
|
||||
return PartialView("QuittierungsbelegsResultPartial", Model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1056,6 +1118,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, true);
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
|
||||
@@ -1075,6 +1139,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, false);
|
||||
}
|
||||
|
||||
LoadServiceOverviewToModel();
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
|
||||
@@ -1138,13 +1204,77 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var customerName = obj.CustomerName;
|
||||
var employeeName = MobileSessionFacade.LoggedInCompactEmployee.SimpleDescription;
|
||||
var serviceRecordCount = obj.Items.Count;
|
||||
|
||||
var serviceRecordCount = isEmployee && AbstractModel.HasRightToProvideEmployeeSignatureForOthers ? obj.Items.Count : obj.Items.Count(x => x.EmployeeOid.Equals(Model.Employee.EmployeeOid));
|
||||
var personName = isEmployee ? employeeName : customerName;
|
||||
|
||||
Model.Quittierungsbelegsunterschriftenobjekt = new Quittierungsbelegsunterschriftenobjekt(isEmployee, personName, Model.ConfirmationReceiptObject.TimeSpanString, customerName, serviceRecordCount, obj.CustomerOid);
|
||||
|
||||
return PartialView("ConfirmationReceiptSignaturePartial", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public ActionResult LoadReportToModel()
|
||||
{
|
||||
var month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
var year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
var customerOid = Model.SelectedCustomerOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var organisationOid = Model.SelectedOrganisationOid;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var startDate = Model.SelectedStartDay ?? 1;
|
||||
|
||||
var date = new DateTime(year, month, startDate);
|
||||
|
||||
var endDate = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
var filterType = Model.SelectedFilterItem;
|
||||
|
||||
Model.QuittierungsbelegsReportObject = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
|
||||
return PartialView("QuittierungsbelegsPreviewPartial", Model);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string ResetQuittierungsbeleg()
|
||||
{
|
||||
Model.QuittierungsbelegsReportObject = null;
|
||||
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public ActionResult LoadQuittierungsbeleg()
|
||||
{
|
||||
if(Model is null)
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
var month = Model.SelectedMonth ?? DateTime.Now.AddMonths(-1).Month;
|
||||
var year = Model.SelectedYear ?? DateTime.Now.Year;
|
||||
var customerOid = Model.SelectedCustomerOid;
|
||||
var teamOid = Model.SelectedTeamOid;
|
||||
var employeeOid = Model.SelectedEmployeeOid;
|
||||
var organisationOid = Model.SelectedOrganisationOid;
|
||||
var serviceCategoryOid = Model.SelectedServiceCategoryOid;
|
||||
var startDate = Model.SelectedStartDay ?? 1;
|
||||
|
||||
var date = new DateTime(year, month, startDate);
|
||||
|
||||
var endDate = Model.SelectedEndDay ?? date.GetLastOfMonth().Day;
|
||||
var filterType = Model.SelectedFilterItem;
|
||||
|
||||
Model.QuittierungsbelegsReportObject = Model.ReportCreator.CreateServiceOverviewReportNew(month, year, filterType.FilterEnum, customerOid, teamOid, employeeOid, organisationOid, serviceCategoryOid, startDate, endDate, false);
|
||||
|
||||
//var employeeOid = Model.Employee.EmployeeOid;
|
||||
//var report = Model.ReportCreator.CreateEmployeeHourReport(employeeOid, null, new DateTime(2023, 10, 1), new DateTime(2023, 10, 31), 0);
|
||||
|
||||
//Model.QuittierungsbelegsReportObject = report;
|
||||
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfirmationReceiptSignatureObject
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return PartialView("DocumentWebViewerPartial", Model);
|
||||
}
|
||||
|
||||
private AbstractReportCreator GetReportCreator()
|
||||
private static AbstractReportCreator GetReportCreator()
|
||||
{
|
||||
var creator = PluginLoader.FindClass<DefaultReportCreator>();
|
||||
|
||||
|
||||
@@ -206,5 +206,7 @@ namespace BeWoPlanerMobil.Models
|
||||
public static bool HasRightToEditCustomerBargeldkassen => CheckRight(UserRightType.BargeldverwaltungBearbeiten);
|
||||
|
||||
public static bool HasRightToViewCustomerAbsenceTimes => CheckRight(UserRightType.Customer_ViewAbsenceTimes);
|
||||
|
||||
public static bool HasRightToProvideEmployeeSignatureForOthers => CheckRight(UserRightType.Signature_ProvideMonthlySignatureByProxy);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
|
||||
@@ -3,12 +3,14 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.Report;
|
||||
using BeWoPlanerMobil.Controllers;
|
||||
using BeWoPlanerMobil.Util.ReportUtils;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
using DevExpress.XtraReports.UI;
|
||||
|
||||
namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
@@ -281,5 +283,9 @@ namespace BeWoPlanerMobil.Models
|
||||
public List<ConfirmationReceiptSignatureObject> SelectedConfirmationReceiptSignatures { get; set; }
|
||||
|
||||
public Quittierungsbelegsunterschriftenobjekt Quittierungsbelegsunterschriftenobjekt { get; set; }
|
||||
|
||||
public AbstractReportCreator ReportCreator { get; set; }
|
||||
|
||||
public XtraReport QuittierungsbelegsReportObject { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,12 @@ function showMessagePopupWithHtml(title, messageAsHtml) {
|
||||
|
||||
$("#modal-body").html(messageAsHtml);
|
||||
|
||||
$("#message-popup-ok-btn").off("click");
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function () {
|
||||
$("#messagePopup").modal("hide");
|
||||
});
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
backdrop: "static",
|
||||
@@ -282,8 +288,6 @@ function cardHeaderClick2(element, callback) {
|
||||
return;
|
||||
}
|
||||
|
||||
logInfo("card header geklickt");
|
||||
|
||||
var jQElement = $(element);
|
||||
|
||||
var icon = jQElement.find("svg.chevron-identifier-class");
|
||||
|
||||
@@ -130,50 +130,6 @@ function onCustomerSelectionChange() {
|
||||
});
|
||||
}
|
||||
|
||||
// Lädt die bisher geleisteten Unterschriften
|
||||
//function getSignatures(signatureOidStrings, containerId) {
|
||||
// alert("löschen?");
|
||||
// logInfo3("Lade vorhandene Unterschriften für Container '" + containerId + "' mit veralteter Methode");
|
||||
// try {
|
||||
// showSpinner();
|
||||
|
||||
// var container = $(containerId);
|
||||
// container.html("");
|
||||
|
||||
// $.get(getLoadConfirmationReceiptSignaturesUrl(), { oidsAsString: signatureOidStrings }).done(function(json) {
|
||||
// if(isUndefinedOrNull(json) || !checkJson(json)) {
|
||||
// if(!checkJson(json)) {
|
||||
// hideSpinner();
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(isEmptyOrSpaces(json)) {
|
||||
// hideSpinner();
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var signatureList = $.parseJSON(json);
|
||||
|
||||
// var newHtml = "";
|
||||
|
||||
// $.each(signatureList, function(index, signature) {
|
||||
// newHtml +=
|
||||
// '<div class="row justify-content-md-center mt-2">' +
|
||||
// '<div class="col">' +
|
||||
// "<div>Unterschrift vom " + signature.InsTsStr + "</div>" +
|
||||
// '<img src="' + signature.ImageStr + '" class="img-fluid mx-auto d-block"/>' +
|
||||
// "</div>" +
|
||||
// "</div>";
|
||||
// });
|
||||
|
||||
// container.append(newHtml);
|
||||
// hideSpinner();
|
||||
// });
|
||||
// } catch(error) {
|
||||
// showErrorPopup(error);
|
||||
// }
|
||||
//}
|
||||
|
||||
function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, overridingAlertId) {
|
||||
try {
|
||||
if (canSign === false) {
|
||||
@@ -223,61 +179,7 @@ function hideSignatureContainer(signatureContainer, overridingAlertId) {
|
||||
$("#report-form-container").show();
|
||||
}
|
||||
|
||||
//function showSignaturePad(overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature, employeeName) {
|
||||
// try {
|
||||
// alert("Kann das gelöscht werden?");
|
||||
// cardHeaderButtonClick(cardBodyId);
|
||||
|
||||
// $("#report-form-container").hide();
|
||||
// $("#report-signature-container-div").addClass("d-block");
|
||||
|
||||
// var plural = "";
|
||||
// if(!isEmptyOrSpaces(signatureOidsString) && signatureOidsString.includes(",")) {
|
||||
// plural = "en";
|
||||
// }
|
||||
|
||||
// var entryCount = parseInt(numberOfEntries, 10);
|
||||
|
||||
// var leistungPlural = entryCount > 1 ? "en" : "";
|
||||
|
||||
// var signatureGiverName = isEmployeeSignature ? employeeName : customerName;
|
||||
|
||||
// $("#report-info-column-h4").html("Unterschrift" + plural + " von " + signatureGiverName + " für " + numberOfEntries + " erbrachte Leistung" + leistungPlural + " von " + customerName + " (" + timeSpan + ")");
|
||||
|
||||
// if(overwrite) {
|
||||
// $("#overwriting-signature-alert").addClass("d-block");
|
||||
// }
|
||||
|
||||
// getSignatures(signatureOidsString, "#signature-container-div");
|
||||
|
||||
// hideSigningParts(canSign);
|
||||
|
||||
// resizeCanvas("#report-sketch-pad-canvas", "#report-canvas-row-div");
|
||||
|
||||
// var canvas = document.getElementById("report-sketch-pad-canvas");
|
||||
|
||||
// var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
|
||||
// var cancelButton = document.getElementById("cancel-report-signature-button");
|
||||
// var saveButton = document.getElementById("save-report-signature-button");
|
||||
// var clearButton = document.getElementById("clear-report-canvas-button");
|
||||
|
||||
// cancelButton.addEventListener("click", function() {
|
||||
// cancelSignature(canSign, signaturePad, "report-sketch-pad-canvas", "report-signature-container-div", "overwriting-signature-alert");
|
||||
// });
|
||||
|
||||
// saveButton.addEventListener("click", function() {
|
||||
// saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad, "report-sketch-pad-canvas");
|
||||
// });
|
||||
|
||||
// clearButton.addEventListener("click", function() {
|
||||
// signaturePad.clear();
|
||||
// });
|
||||
// } catch(error) {
|
||||
// showErrorPopup(error);
|
||||
// }
|
||||
//}
|
||||
|
||||
// ToDo: Löschen. An andere Stelle verlegt!
|
||||
function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad, canvasId) {
|
||||
try {
|
||||
var canvas = document.getElementById(canvasId);
|
||||
@@ -287,9 +189,6 @@ function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad
|
||||
var context = trimmedCanvas.getContext("2d");
|
||||
context.globalCompositeOperation = "destination-over";
|
||||
context.fillStyle = "white";
|
||||
|
||||
logInfo3(trimmedCanvas.width + " x " + trimmedCanvas.height);
|
||||
|
||||
context.fillRect(0, 0, trimmedCanvas.width, trimmedCanvas.height);
|
||||
|
||||
var dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
@@ -306,6 +205,7 @@ function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad
|
||||
"Die Unterschrift wurde erfolgreich gespeichert.<br/><br/>Verändern Sie jedoch Einträge der Zeiterfassung in dem ausgewählten Zeitraum, muss die Unterschrift erneut geleistet werden.", false,
|
||||
function () {
|
||||
showSpinner();
|
||||
// ToDo: Seite neuladen und Quittierungsbelegsobjekt neuerstellen!
|
||||
location.reload();
|
||||
},
|
||||
true);
|
||||
|
||||
@@ -23,8 +23,11 @@ namespace BeWoPlanerMobil.Util
|
||||
|
||||
public bool HasEmployeeSignature { get; set; }
|
||||
|
||||
public long EmployeeOid { get; set; }
|
||||
|
||||
public QuittierungsbelegItem(ServicesOverviewRO.ServiceDetail serviceDetail)
|
||||
{
|
||||
EmployeeOid = serviceDetail.EmployeeOid;
|
||||
Kontaktart = serviceDetail.IsGroup ? "GR" : "E";
|
||||
CustomersCount = serviceDetail.CustomerCount;
|
||||
Minutes = serviceDetail.Minutes;
|
||||
|
||||
@@ -27,7 +27,9 @@ namespace BeWoPlanerMobil.Util
|
||||
|
||||
public List<long> EmployeeSignatureOids { get; }
|
||||
|
||||
public QuittierungsbelegResult(string customerName, List<QuittierungsbelegItem> items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid, SignatureState customerSignatureStatus, List<long> customerSignatureOids, SignatureState employeeSignatureState, List<long> employeeSignatureOids)
|
||||
public int EmployeeCount { get; }
|
||||
|
||||
public QuittierungsbelegResult(string customerName, List<QuittierungsbelegItem> items, long customerOid, bool hasCustomerSignature, long? customerSignatureOid, SignatureState customerSignatureStatus, List<long> customerSignatureOids, SignatureState employeeSignatureState, List<long> employeeSignatureOids, int employeeCount)
|
||||
{
|
||||
CustomerName = customerName;
|
||||
Items = items;
|
||||
@@ -39,6 +41,7 @@ namespace BeWoPlanerMobil.Util
|
||||
CustomerSignatureOids = customerSignatureOids;
|
||||
EmployeeSignatureState = employeeSignatureState;
|
||||
EmployeeSignatureOids = employeeSignatureOids;
|
||||
EmployeeCount = employeeCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@ namespace BeWoPlanerMobil.Util.ReportUtils
|
||||
{
|
||||
None,
|
||||
Some,
|
||||
All
|
||||
All,
|
||||
AllOwnServiceRecords
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,17 @@
|
||||
}
|
||||
|
||||
<script>
|
||||
$(window).ready(function () {
|
||||
@if(Model.Report != null)
|
||||
{
|
||||
<text>
|
||||
var windowHeight = $(window).height() * .8;
|
||||
$("#med-list-report-container").height(windowHeight);
|
||||
$("#report-popup").modal("show");
|
||||
</text>
|
||||
}
|
||||
});
|
||||
|
||||
function closeReport() {
|
||||
try {
|
||||
$.get("@Url.Action("ResetReport")");
|
||||
@@ -128,15 +139,6 @@
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
$(window).ready(function() {
|
||||
@if(Html.IsInDebugMode() && ViewData["Testmeldung"] is string testMessage)
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithHtml("Fehler", "<div class='alert' role='alert'>@ViewData["Testmeldung"]</div>");
|
||||
</text>
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="container mt-3">
|
||||
@@ -462,7 +464,6 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<hr />
|
||||
</div>
|
||||
@@ -956,7 +957,8 @@
|
||||
|
||||
var isAllowedToViewBargeldkassen = AbstractModel.HasRightToViewAllCustomersBargeldkassen || (isRelatedCustomer && AbstractModel.HasRightToViewOwnCustomersBargeldkassen);
|
||||
}
|
||||
|
||||
|
||||
@* Bargeldverwaltung *@
|
||||
@if(Html.IsInDebugMode() && isAllowedToViewBargeldkassen && !(Model.Bargeldkassen is null) && Model.Bargeldkassen.Any())
|
||||
{
|
||||
<!-- Bargeldkassen -->
|
||||
@@ -982,11 +984,12 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(Html.IsInDebugMode() && AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
|
||||
@* Abwesenheiten *@
|
||||
@if(AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
{
|
||||
<div class="col-12 my-3">
|
||||
<div class="card w-100 h-100 bg-bewo-dev">
|
||||
<div class="card w-100 h-100">
|
||||
<div class="card-header" onclick="cardHeaderClick('#chevron-customer-absencetimes', '#collapse-customer-absencetimes')">
|
||||
<div class="d-inline-flex">
|
||||
<i class="fas fa-chevron-down h-100 text-bewo-customer-card-header" id="chevron-customer-absencetimes"></i>
|
||||
@@ -1003,7 +1006,9 @@
|
||||
Abwesenheit hinzufügen
|
||||
</button>
|
||||
<hr />
|
||||
@Html.Partial("CustomerAbsenceTimePartial", Model)
|
||||
<div id="absence-times-container">
|
||||
@Html.Partial("CustomerAbsenceTimePartial", Model)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1015,9 +1020,8 @@
|
||||
}
|
||||
</div>
|
||||
|
||||
@if(Html.IsInDebugMode() && AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
@if(AbstractModel.HasRightToViewCustomerAbsenceTimes)
|
||||
{
|
||||
<!-- ToDo: Popup für Abwesenheitsformular -->
|
||||
<div class="modal" tabindex="-1" role="dialog" id="customer-absence-times-form-popup">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
@@ -1041,21 +1045,18 @@
|
||||
|
||||
@if(!(Model?.Report is null) && Html.IsInDebugMode())
|
||||
{
|
||||
<div class="modal modal-fullscreen" tabindex="-1" role="dialog" id="report-popup">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal" data-backdrop="static" tabindex="-1" role="dialog" id="report-popup">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" onclick="debugOnclick()">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">@Model.ReportName</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" onclick="closeReport()">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" id="med-list-report-container">
|
||||
@Html.Partial("CustomerReportPartial", Model)
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="closeReport()">Schließen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1076,11 +1077,6 @@
|
||||
<input type="hidden" name="med-list-oid" id="med-list-oid-delete" />
|
||||
}
|
||||
|
||||
@using(Html.BeginForm("DeleteAbsenceTime", "Customer", FormMethod.Post, new { id = "customer-absence-delete-form" }))
|
||||
{
|
||||
<input type="hidden" id="customer-absence-time-to-delete-oid" name="customer-absence-time-to-delete-oid" />
|
||||
}
|
||||
|
||||
@using(Html.BeginForm("SelectAbsenceTime", "Customer", FormMethod.Post, new { id = "customer-absence-selection-form" }))
|
||||
{
|
||||
<input type="hidden" id="customer-absence-time-to-edit-oid" name="customer-absence-time-to-edit-oid" />
|
||||
|
||||
@@ -84,7 +84,13 @@
|
||||
|
||||
function toggleAllDay() {
|
||||
try {
|
||||
$("#customer-absence-time-start-time, #customer-absence-time-end-time").prop("disabled", $("#customer-absence-time-allday-cb").is(":checked"));
|
||||
var isChecked = $("#customer-absence-time-allday-cb").is(":checked");
|
||||
|
||||
if(isChecked === true) {
|
||||
$("#customer-absence-time-start-time, #customer-absence-time-end-time").val("");
|
||||
}
|
||||
|
||||
$("#customer-absence-time-start-time, #customer-absence-time-end-time").prop("disabled", isChecked);
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
@@ -103,6 +109,7 @@
|
||||
|
||||
showSpinner();
|
||||
$("#create-absence-time-form").submit();
|
||||
$("#customer-absence-times-form-popup").modal("hide");
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
@@ -130,9 +137,19 @@
|
||||
var startTime = Model.SelectedAbsenceTime?.Start?.ToString("HH:mm");
|
||||
var endTime = Model.SelectedAbsenceTime?.End?.ToString("HH:mm");
|
||||
|
||||
if(startTime?.Equals("00:00") ?? false)
|
||||
{
|
||||
startTime = string.Empty;
|
||||
}
|
||||
|
||||
if(endTime?.Equals("00:00") ?? false)
|
||||
{
|
||||
endTime = string.Empty;
|
||||
}
|
||||
|
||||
<input type="hidden" name="customer-absence-time-oid" value="@Model.SelectedAbsenceTime?.AbsenceTimeOid" />
|
||||
<div class="form-row">
|
||||
<div class="col-lg d-none" id="form-validation-result-column">
|
||||
<div class="col-12 d-none" id="form-validation-result-column">
|
||||
<div class="alert alert-danger" role="alert" id="form-validation-result-container"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
@using BeWoPlanerMobil.Models;
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BS.Shared.Extensions
|
||||
|
||||
@model CustomerModel
|
||||
|
||||
<script type="text/javascript">
|
||||
@if(ViewData["AbsenceTimeError"] is string testMessage)
|
||||
{
|
||||
<text>
|
||||
showMessagePopupWithHtml("Fehler", "<div class='alert' role='alert'>@Html.Raw(ViewData["AbsenceTimeError"])</div>");
|
||||
</text>
|
||||
}
|
||||
|
||||
$(window).ready(function() {
|
||||
@if(!(Model.SelectedAbsenceTime is null))
|
||||
{
|
||||
@@ -22,12 +30,11 @@
|
||||
showMessagePopupWithCallback("Abwesenheit löschen",
|
||||
"Möchten Sie wirklich die Abwesenheit " + word + absenceTimeSpanDescription.toLowerCase() + " löschen?",
|
||||
function() {
|
||||
$("#customer-absence-time-to-delete-oid").val(absenceTimeOid);
|
||||
|
||||
showSpinner();
|
||||
|
||||
document.getElementById("customer-absence-delete-form").submit();
|
||||
$("#customer-absence-delete-form").submit();
|
||||
$("#absence-times-container").load("@Url.Action("DeleteAbsenceTime")", {absenceTimeOid: absenceTimeOid}, function() {
|
||||
hideSpinner();
|
||||
});
|
||||
},
|
||||
false);
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,100 +1,6 @@
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.CustomerModel
|
||||
|
||||
<script type="text/javascript">
|
||||
function customerReportInitEvent(s, e) {
|
||||
@if(Model?.Report != null && Html.IsInDebugMode())
|
||||
{
|
||||
<text>
|
||||
$("#report-popup").modal('show');
|
||||
</text>
|
||||
}
|
||||
}
|
||||
|
||||
function getReportImageElement() {
|
||||
var viewer = $("#webDocumentViewer2");
|
||||
if (viewer.length === 0) {
|
||||
logError("webDocumentViewer2 nicht gefunden!");
|
||||
return null;
|
||||
}
|
||||
|
||||
return viewer.find("div.dx-designer")
|
||||
.find("div.dx-viewport.dx-theme-desktop.dx-theme-desktop-typography")
|
||||
.find("div.dxrd-designer-wrapper.dx-editors.dxrd-preview.dxrdp-mobile.dx-ltr")
|
||||
.find("div.dxrd-preview-wrapper.dxrdp-fullscreen")
|
||||
.find("div.dxrd-mobile-content")
|
||||
.find("div.dxrd-mobile-gallery.dx-gallery.dx-gallery-loop.dx-widget.dx-visibility-change-handler.dx-swipeable.dx-collection")
|
||||
.find("div.dx-gallery-wrapper")
|
||||
.find("div.dx-gallery-container")
|
||||
.find("div.dx-item.dx-gallery-item.dx-item-selected.dx-gallery-item-selected")
|
||||
.find("div.dx-template-wrapper.dx-item-content.dx-gallery-item-content")
|
||||
.find("div.dxrd-scrollView-mobile.dx-scrollable.dx-scrollview.dx-scrollable-both.dx-scrollable-simulated.dx-visibility-change-handler")
|
||||
.find("div.dx-scrollable-wrapper")
|
||||
.find("div.dx-scrollable-container")
|
||||
.find("div.dx-scrollable-content")
|
||||
.find("div.dx-scrollview-content")
|
||||
.find("div.dxrd-gallery-blocks")
|
||||
.find("div.dxrd-gallery-block")
|
||||
.find("div.dxrd-gallery-block-content")
|
||||
.find("div.dxrd-mobile-page")
|
||||
.find("div.dxrdp-content")
|
||||
.find("img");
|
||||
}
|
||||
|
||||
$("div.dx-designer>" +
|
||||
"div.dx-viewport.dx-theme-desktop.dx-theme-desktop-typography>" +
|
||||
"div.dxrd-designer-wrapper.dx-editors.dxrd-preview.dxrdp-mobile.dx-ltr>" +
|
||||
"div.dxrd-preview-wrapper.dxrdp-fullscreen>div.dxrd-mobile-content>div.dxrd-mobile-gallery.dx-gallery.dx-gallery-loop.dx-widget.dx-visibility-change-handler.dx-swipeable.dx-collection>" +
|
||||
"div.dx-gallery-wrapper>div.dx-gallery-container>div.dx-item.dx-gallery-item.dx-item-selected.dx-gallery-item-selected>" +
|
||||
"div.dx-template-wrapper.dx-item-content.dx-gallery-item-content>div.dxrd-scrollView-mobile.dx-scrollable.dx-scrollview.dx-scrollable-both.dx-scrollable-simulated.dx-visibility-change-handler>" +
|
||||
"div.dx-scrollable-wrapper>div.dx-scrollable-container>div.dx-scrollable-content>div.dx-scrollview-content>div.dxrd-gallery-blocks>div.dxrd-gallery-block>div.dxrd-gallery-block-content>" +
|
||||
"div.dxrd-mobile-page>div.dxrdp-content>img").on("load", function() {
|
||||
alert("test");
|
||||
});
|
||||
|
||||
var test = $("div.dx-designer>" +
|
||||
"div.dx-viewport.dx-theme-desktop.dx-theme-desktop-typography>" +
|
||||
"div.dxrd-designer-wrapper.dx-editors.dxrd-preview.dxrdp-mobile.dx-ltr>" +
|
||||
"div.dxrd-preview-wrapper.dxrdp-fullscreen>div.dxrd-mobile-content>div.dxrd-mobile-gallery.dx-gallery.dx-gallery-loop.dx-widget.dx-visibility-change-handler.dx-swipeable.dx-collection>" +
|
||||
"div.dx-gallery-wrapper>div.dx-gallery-container>div.dx-item.dx-gallery-item.dx-item-selected.dx-gallery-item-selected>" +
|
||||
"div.dx-template-wrapper.dx-item-content.dx-gallery-item-content>div.dxrd-scrollView-mobile.dx-scrollable.dx-scrollview.dx-scrollable-both.dx-scrollable-simulated.dx-visibility-change-handler>" +
|
||||
"div.dx-scrollable-wrapper>div.dx-scrollable-container>div.dx-scrollable-content>div.dx-scrollview-content>div.dxrd-gallery-blocks>div.dxrd-gallery-block>div.dxrd-gallery-block-content>" +
|
||||
"div.dxrd-mobile-page>div.dxrdp-content>img")[0];
|
||||
|
||||
var observer = new MutationObserver(
|
||||
function (mutations) {
|
||||
if (document.contains(test)) {
|
||||
alert("Im DOM enthalten!");
|
||||
observer.disconnect();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
observer.observe(document, { attributes: false, childList: true, characterData: false, subtree: true });
|
||||
|
||||
function getHeight() {
|
||||
return getReportImageElement().height();
|
||||
}
|
||||
|
||||
function getWidth() {
|
||||
return getReportImageElement().width();
|
||||
}
|
||||
|
||||
function debugOnclick() {
|
||||
var viewer = $("#webDocumentViewer2");
|
||||
|
||||
var reportImg = getReportImageElement();
|
||||
|
||||
if (reportImg.length > 0) {
|
||||
viewer.height(getHeight());
|
||||
viewer.width(getWidth());
|
||||
}
|
||||
|
||||
logColorfulMessage(`Größe des Report-Img: ${reportImg.height()}x${reportImg.width()}`, '#daf700');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@if(Model?.Report != null && Html.IsInDebugMode())
|
||||
{
|
||||
@Html.DevExpress().WebDocumentViewer(settings =>
|
||||
@@ -105,6 +11,5 @@
|
||||
settings.MobileMode = true;
|
||||
settings.SettingsMobile.ReaderMode = true;
|
||||
settings.SettingsMobile.AnimationEnabled = false;
|
||||
settings.ClientSideEvents.Init = "customerReportInitEvent";
|
||||
}).Bind(Model.Report).GetHtml()
|
||||
}
|
||||
@@ -59,6 +59,12 @@
|
||||
{
|
||||
message2 = "Es wurde für alle Termine eine Unterschrift hinterlegt.<br /><br />Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.";
|
||||
}
|
||||
|
||||
if(cro.EmployeeSignatureState == SignatureState.AllOwnServiceRecords)
|
||||
{
|
||||
// Wenn die eigenen Einträge unterschrieben sind, die der anderen Mitarbeiter aber noch nicht und daher wird auch auf dem QB keine Unterschrift angezeigt.
|
||||
message = "Es wurden nicht für alle Einträge anderer Mitarbeiter eine Mitarbeiterunterschrift geleistet.<br /><br />Die Unterschrift wird nicht auf dem Quittierungsbeleg angezeigt.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -147,7 +153,7 @@
|
||||
<div class="justify-content-center">
|
||||
<img style="display: block; margin-left: auto; margin-right: auto; max-width: 100% !important;" src="@signature.ImageStr" alt="Unterschrift von @signature.PersonName geleistet am @signature.InsTsStr"/>
|
||||
</div>
|
||||
<div class="card-body m-0 p-0" style="height: 0px !important;"></div>
|
||||
<div class="card-body m-0 p-0" style="height: 0 !important;"></div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-auto left-col">
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
{
|
||||
@Html.DevExpress().WebDocumentViewer(settings =>
|
||||
{
|
||||
settings.Name = "quittierungsbelegsViewer";
|
||||
settings.Width = Unit.Percentage(100);
|
||||
settings.Height = Unit.Percentage(100);
|
||||
settings.MobileMode = true;
|
||||
settings.SettingsMobile.ReaderMode = true;
|
||||
settings.SettingsMobile.AnimationEnabled = false;
|
||||
}).Bind(Model.QuittierungsbelegsReportObject).GetHtml()
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
@using BeWoPlanerMobil.Util.ReportUtils
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
|
||||
<script>
|
||||
<script type="text/javascript">
|
||||
function deleteCustomerSignatures(cardBodyId, resultIdentifier, customerName, timeSpan) {
|
||||
try {
|
||||
cardHeaderButtonClick(cardBodyId);
|
||||
@@ -70,7 +70,45 @@
|
||||
|
||||
saveButton.addEventListener("click",
|
||||
function() {
|
||||
saveSignature(customerOid, isEmployee, isOverriding, signaturePad, "qb-sig-sketch-pad");
|
||||
//saveSignature(customerOid, isEmployee, isOverriding, signaturePad, "qb-sig-sketch-pad");
|
||||
var canvas = document.getElementById("qb-sig-sketch-pad");
|
||||
var clonedCanvas = cloneCanvas(canvas);
|
||||
var trimmedCanvas = trimCanvas(clonedCanvas);
|
||||
|
||||
var context = trimmedCanvas.getContext("2d");
|
||||
context.globalCompositeOperation = "destination-over";
|
||||
context.fillStyle = "white";
|
||||
context.fillRect(0, 0, trimmedCanvas.width, trimmedCanvas.height);
|
||||
|
||||
var dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
|
||||
showSpinner();
|
||||
|
||||
$.post("@Url.Action("CreateSignatureForServiceOverview")", { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: !isEmployee, overwrite: isOverriding }).done(function (json) {
|
||||
hideSpinner();
|
||||
|
||||
if (isEmptyOrSpaces(json)) {
|
||||
showMessagePopupWithHtmlAndCallback("Unterschrift",
|
||||
"Die Unterschrift wurde erfolgreich gespeichert.<br/><br/>Verändern Sie jedoch Einträge der Zeiterfassung in dem ausgewählten Zeitraum, muss die Unterschrift erneut geleistet werden.", false,
|
||||
function () {
|
||||
showSpinner();
|
||||
$("#report-signatures-container").load("@Url.Action("LoadServiceOverview")", function() {
|
||||
try {
|
||||
hideSpinner();
|
||||
$("#report-signature-container").removeClass("d-block");
|
||||
$("#report-signature-container").addClass("d-none");
|
||||
$("#report-form-container").show();
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
},
|
||||
true);
|
||||
} else {
|
||||
showMessagePopup("Fehler", json);
|
||||
signaturePad.clear();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
clearButton.addEventListener("click",
|
||||
@@ -105,168 +143,184 @@
|
||||
|
||||
foreach(var result in Model.ConfirmationReceiptObject.ConfirmationReceiptResultList)
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="cardHeaderClick('#chevron-@result.Identifier', '#collapse-result-@result.Identifier')">
|
||||
@{
|
||||
var employeeSignatureState = result.EmployeeSignatureState;
|
||||
var customerSignatureState = result.CustomerSignatureState;
|
||||
|
||||
var canCustomerSign = customerSignatureState != SignatureState.All;
|
||||
var canEmployeeSign = employeeSignatureState != SignatureState.All;
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="cardHeaderClick2(this)">
|
||||
@{
|
||||
var employeeSignatureState = result.EmployeeSignatureState;
|
||||
var customerSignatureState = result.CustomerSignatureState;
|
||||
|
||||
var employeeName = Model.Employee.ToString();
|
||||
var canCustomerSign = customerSignatureState != SignatureState.All;
|
||||
var canEmployeeSign = employeeSignatureState != SignatureState.All && employeeSignatureState != SignatureState.AllOwnServiceRecords; // || (employeeSignatureState != SignatureState.AllOwnServiceRecords);
|
||||
|
||||
//overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature
|
||||
var overwrite_ssp = (employeeSignatureState == SignatureState.All).ToString().ToLower();
|
||||
var cardBodyId_ssp = $"#collapse-result-{result.Identifier}";
|
||||
var timeSpan_ssp = Model.ConfirmationReceiptObject.TimeSpanString;
|
||||
}
|
||||
var employeeName = Model.Employee.ToString();
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-auto mr-auto">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-@result.Identifier"></i>
|
||||
</div>
|
||||
<p class="form-control text-primary border-0 bg-transparent" style="user-select: none !important;">
|
||||
@result.CustomerName
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-auto">
|
||||
@using(Html.BeginForm("DeleteCustomerSignature", "Report", FormMethod.Post, new { id = "delCSigForm-" + result.Identifier }))
|
||||
{
|
||||
<input type="hidden" name="deleteCustomerSignaturesInfo" value="@result.Identifier" />
|
||||
}
|
||||
@using(Html.BeginForm("DeleteEmployeeSignature", "Report", FormMethod.Post, new { id = "delESigForm-" + result.Identifier }))
|
||||
{
|
||||
<input type="hidden" name="deleteEmployeeSignatureInfo" value="@result.Identifier" />
|
||||
}
|
||||
<div class="btn-toolbar justify-content-between">
|
||||
<div class="btn-group pr-1 customer-sig-group" role="group">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.CustomerSignatureOids.Any())
|
||||
{
|
||||
<button class="btn btn-danger" type="button" onclick="deleteCustomerSignatures('#collapse-result-@result.Identifier', '@result.Identifier', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-bewo-customers" type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', false, @result.HasCustomerSignature.ToString().ToLower(), @canCustomerSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<span class="fas fa-signature mr-0 pr-0"></span>
|
||||
@if(customerSignatureState != SignatureState.All)
|
||||
{
|
||||
<span class="fa-stack align-middle bg-dark" style="height: auto !important">
|
||||
<i class="fas fa-check fa-stack-1x"></i>
|
||||
<i class="fas fa-slash fa-stack-1x text-danger"></i>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="fas fa-check-double" style="color: yellowgreen !important"></span>
|
||||
}
|
||||
K
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group employee-sig-group" role="group">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.EmployeeSignatureOids.Any())
|
||||
{
|
||||
<button class="btn btn-danger" type="button" onclick="deleteEmployeeSignature('#collapse-result-@result.Identifier', '@result.Identifier', '@employeeName', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
|
||||
<button class="btn btn-bewo-employee" type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', true, @overwrite_ssp, @canEmployeeSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<span class="fas fa-signature mr-0 pr-0"></span>
|
||||
@if(employeeSignatureState != SignatureState.All)
|
||||
{
|
||||
<span class="fa-stack align-middle" style="height: auto !important">
|
||||
<i class="fas fa-check fa-stack-1x"></i>
|
||||
<i class="fas fa-slash fa-stack-1x text-danger"></i>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="fas fa-check-double" style="color: yellowgreen !important"></span>
|
||||
}
|
||||
M
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
var overwrite_ssp = (employeeSignatureState == SignatureState.All).ToString().ToLower();
|
||||
var cardBodyId_ssp = $"#collapse-result-{result.Identifier}";
|
||||
var timeSpan_ssp = Model.ConfirmationReceiptObject.TimeSpanString;
|
||||
|
||||
var hasNoOwnEntries = !AbstractModel.HasRightToProvideEmployeeSignatureForOthers && result.Items.All(item => !item.EmployeeOid.Equals(Model.Employee.EmployeeOid));
|
||||
var disabledString = hasNoOwnEntries ? "disabled" : string.Empty;
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-auto mr-auto">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<i class="fas fa-chevron-down text-primary h-100" id="chevron-@result.Identifier"></i>
|
||||
</div>
|
||||
<p class="form-control text-primary border-0 bg-transparent" style="user-select: none !important;">
|
||||
@result.CustomerName
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="collapse-result-@result.Identifier">
|
||||
<div class="card-body mx-0 px-0">
|
||||
<div class="container-fluid">
|
||||
@foreach(var item in result.Items)
|
||||
<div class="col-sm-auto">
|
||||
@using(Html.BeginForm("DeleteCustomerSignature", "Report", FormMethod.Post, new { id = "delCSigForm-" + result.Identifier }))
|
||||
{
|
||||
<input type="hidden" name="deleteCustomerSignaturesInfo" value="@result.Identifier" />
|
||||
}
|
||||
@using(Html.BeginForm("DeleteEmployeeSignature", "Report", FormMethod.Post, new { id = "delESigForm-" + result.Identifier }))
|
||||
{
|
||||
<input type="hidden" name="deleteEmployeeSignatureInfo" value="@result.Identifier" />
|
||||
}
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group pr-1 w-auto customer-sig-group" role="group">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.CustomerSignatureOids.Any())
|
||||
{
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="cardHeaderClick('#chevron-@item.Identifier', '#collapse-item-@item.Identifier')">
|
||||
<div class="d-inline-flex">
|
||||
<i class="fas fa-chevron-down h-100 text-primary" id="chevron-@item.Identifier"></i>
|
||||
</div>
|
||||
<div class="p2 d-inline-flex text-primary h-100">
|
||||
<button type="button" class="btn btn-link">
|
||||
@item.DateTimeString
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@{
|
||||
var hasEmployeeSignatureTextColorClass = item.HasEmployeeSignature ? "text-bewo-employee" : "text-light";
|
||||
}
|
||||
|
||||
<span class="fas fa-check h-100 @hasEmployeeSignatureTextColorClass float-right pt-2"></span>
|
||||
|
||||
<span class="float-right pt-2 text-light">m</span>
|
||||
|
||||
@if(item.HasCustomerSignature)
|
||||
{
|
||||
<span class="fas fa-check h-100 text-bewo-customers float-right pt-2"></span>
|
||||
}
|
||||
</div>
|
||||
<div class="collapse" id="collapse-item-@item.Identifier">
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Kontaktart:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Kontaktart
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Anzahl Klienten:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.CustomersCount
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
FLS in Minuten (ohne 1,2):
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Minutes
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Mitarbeiter:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Employees
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-danger mx-0" type="button" onclick="deleteCustomerSignatures('#collapse-result-@result.Identifier', '@result.Identifier', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-bewo-customers" type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', false, @result.HasCustomerSignature.ToString().ToLower(), @canCustomerSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<span class="fas fa-signature mr-0 pr-0"></span>
|
||||
@if(customerSignatureState != SignatureState.All)
|
||||
{
|
||||
<span class="fa-stack align-middle mx-0 px-0" style="height: auto !important">
|
||||
<i class="fas fa-check fa-stack-1x mx-0 px-0"></i>
|
||||
<i class="fas fa-slash fa-stack-1x mx-0 px-0" style="color: tomato;"></i>
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="fas fa-check-double" style="color: yellowgreen !important"></span>
|
||||
}
|
||||
K
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group w-auto employee-sig-group" role="group">
|
||||
@if(AbstractModel.HasRightToDeleteReceiptSignatures && result.EmployeeSignatureOids.Any())
|
||||
{
|
||||
<button class="btn btn-danger mx-0" type="button" onclick="deleteEmployeeSignature('#collapse-result-@result.Identifier', '@result.Identifier', '@employeeName', '@result.CustomerName', '@timeSpan_ssp')">
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-bewo-employee" @disabledString type="button" onclick="loadConfirmationReceiptSignatures('@cardBodyId_ssp', '@result.Identifier', true, @overwrite_ssp, @canEmployeeSign.ToString().ToLower(), @result.CustomerOid)">
|
||||
<span class="fas fa-signature mr-0 pr-0"></span>
|
||||
@if(employeeSignatureState == SignatureState.Some || employeeSignatureState == SignatureState.None)
|
||||
{
|
||||
<span class="fa-stack align-middle mx-0 px-0" style="height: auto !important">
|
||||
<i class="fas fa-check fa-stack-1x mx-0 px-0"></i>
|
||||
<i class="fas fa-slash fa-stack-1x mx-0 px-0" style="color: tomato;"></i>
|
||||
</span>
|
||||
}
|
||||
else if(employeeSignatureState == SignatureState.AllOwnServiceRecords && !AbstractModel.HasRightToProvideEmployeeSignatureForOthers)
|
||||
{
|
||||
<span class="fas fa-ban" style="color: tomato;"></span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="fas fa-check-double" style="color: yellowgreen !important"></span>
|
||||
}
|
||||
M
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="collapse-result-@result.Identifier">
|
||||
<div class="card-body mx-0 px-0">
|
||||
<div class="container-fluid">
|
||||
@foreach(var item in result.Items)
|
||||
{
|
||||
var isNotOwnEntry = !AbstractModel.HasRightToProvideEmployeeSignatureForOthers && !item.EmployeeOid.Equals(Model.Employee.EmployeeOid);
|
||||
|
||||
var headerTextColorClass = isNotOwnEntry ? "text-secondary" : "text-primary";
|
||||
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="cardHeaderClick('#chevron-@item.Identifier', '#collapse-item-@item.Identifier')">
|
||||
<div class="d-inline-flex">
|
||||
<i class="fas fa-chevron-down h-100 @headerTextColorClass" id="chevron-@item.Identifier"></i>
|
||||
</div>
|
||||
<div class="p2 d-inline-flex @headerTextColorClass h-100">
|
||||
<button type="button" class="btn btn-link @headerTextColorClass">
|
||||
@item.DateTimeString
|
||||
</button>
|
||||
@if(isNotOwnEntry)
|
||||
{
|
||||
<span class="fa-stack fa-1x text-secondary mt-1">
|
||||
<i class="fas fa-signature fa-stack-1x"></i>
|
||||
<i class="fas fa-ban fa-stack-2x"></i>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
@{
|
||||
var hasEmployeeSignatureTextColorClass = item.HasEmployeeSignature ? "text-bewo-employee" : "text-light";
|
||||
}
|
||||
|
||||
<span class="fas fa-check h-100 @hasEmployeeSignatureTextColorClass float-right pt-2"></span>
|
||||
|
||||
<span class="float-right pt-2 text-light">m</span>
|
||||
|
||||
@if(item.HasCustomerSignature)
|
||||
{
|
||||
<span class="fas fa-check h-100 text-bewo-customers float-right pt-2"></span>
|
||||
}
|
||||
</div>
|
||||
<div class="collapse" id="collapse-item-@item.Identifier">
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Kontaktart:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Kontaktart
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Anzahl Klienten:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.CustomersCount
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
FLS in Minuten (ohne 1,2):
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Minutes
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-secondary">
|
||||
Mitarbeiter:
|
||||
</div>
|
||||
<div class="col">
|
||||
@item.Employees
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -1,5 +1,4 @@
|
||||
@using BeWoPlanerMobil.Util
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Quittierungsbeleg";
|
||||
@@ -54,6 +53,15 @@
|
||||
$("#test-div3").removeClass("d-none");
|
||||
$("#test-div3").addClass("d-block");
|
||||
}
|
||||
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
{
|
||||
<text>
|
||||
var windowHeight = $(window).height() * .8;
|
||||
$("#qb-container").height(windowHeight);
|
||||
$("#qb-report-popup").modal("show");
|
||||
</text>
|
||||
}
|
||||
});
|
||||
|
||||
$(window).resize(function() {
|
||||
@@ -171,6 +179,24 @@
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function previewQBReport() {
|
||||
try {
|
||||
showSpinner();
|
||||
|
||||
$("#load-report-form").submit();
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetQuittierungsbeleg() {
|
||||
try {
|
||||
$.get("@Url.Action("ResetQuittierungsbeleg")");
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container-fluid my-3" id="report-form-container">
|
||||
@@ -313,13 +339,21 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="clearfix mt-3">
|
||||
<button type="button" class="btn btn-primary float-left" data-toggle="modal" data-target="#qb-info-popup">
|
||||
<span class="fas fa-info"></span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-primary float-right" id="create-button" onclick="createServiceOverview()">Erstellen</button>
|
||||
|
||||
@using(Html.BeginForm("LoadQuittierungsbeleg", "Report", FormMethod.Post, new {id="load-report-form"}))
|
||||
{
|
||||
<button type="button" class="btn btn-primary float-right mr-2" onclick="previewQBReport()">
|
||||
<span class="fas fa-file-alt"></span>
|
||||
Vorschau
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col col-12" id="report-signatures-container">
|
||||
@@ -330,7 +364,7 @@
|
||||
|
||||
<!-- Container für die Mitarbeiterunterschrift -->
|
||||
<div class="container-fluid d-none my-3" id="report-signature-container">
|
||||
|
||||
|
||||
</div>
|
||||
<!-- /Container für die Mitarbeiterunterschrift -->
|
||||
<!-- Container für die Unterschrift -->
|
||||
@@ -368,7 +402,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Container für die Unterschrift -->
|
||||
|
||||
<!-- Popup der Legende -->
|
||||
<div class="modal" tabindex="-1" role="dialog" id="qb-info-popup">
|
||||
<div class="modal-dialog" role="document">
|
||||
@@ -398,6 +431,7 @@
|
||||
M
|
||||
</button>
|
||||
- Es gibt noch keine Monatsunterschrift für alle Zeiterfassungseinträge im ausgewählten Zeitraum; Es wird keine Unterschrift auf dem Quittierungsbeleg angezeigt.
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
@@ -413,11 +447,30 @@
|
||||
M
|
||||
</button>
|
||||
- Alle Zeiterfassungseinträge haben eine Monatsunterschrift; Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<button type="button" class="btn btn-bewo-employee d-inline">
|
||||
<span class="fas fa-signature"></span>
|
||||
<span class="fas fa-ban" style="color: tomato;"></span>
|
||||
M
|
||||
</button>
|
||||
- Es wurden die von Ihnen geleisteten Zeiterfassungseinträge unterschrieben. Es fehlen jedoch die Unterschriften der anderen Mitarbeiter, für die das Recht "Unterschriften für den Quittierungsbeleg stellvertretend leisten (monatlich)" notwendig wäre.
|
||||
|
||||
<br />
|
||||
<hr />
|
||||
|
||||
<p><span class="fas fa-check text-bewo-customers"></span> - Dieser Zeiterfassungseintrag hat vom Klienten eine Monatsunterschrift.</p>
|
||||
<p><span class="fas fa-check text-bewo-employee"></span> - Dieser Zeiterfassungseintrag hat vom Mitarbeiter eine Monatsunterschrift.</p>
|
||||
|
||||
<p>
|
||||
<span class="fa-stack fa-1x text-secondary">
|
||||
<i class="fas fa-signature fa-stack-1x"></i>
|
||||
<i class="fas fa-ban fa-stack-2x"></i>
|
||||
</span>
|
||||
- Dieser Zeiterfassungseinträge kann von Ihnen nicht unterschrieben werden, da Ihnen das dazu notwendige Recht "Unterschriften für den Quittierungsbeleg stellvertretend leisten (monatlich)." fehlt.
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="clearfix">
|
||||
@@ -427,4 +480,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Popup der Legende -->
|
||||
<!-- /Popup der Legende -->
|
||||
|
||||
<!-- Popup des Quittierungsbelegsdokuments -->
|
||||
<div class="modal" tabindex="-1" data-backdrop="static" role="dialog" id="qb-report-popup">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header py-1">
|
||||
<p class="modal-title">Quittierungsbeleg</p>
|
||||
<button class="close" type="button" data-dismiss="modal" aria-label="close" onclick="resetQuittierungsbeleg()">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body" id="qb-container">
|
||||
@if(Model.QuittierungsbelegsReportObject != null)
|
||||
{
|
||||
@Html.Partial("QuittierungsbelegsPreviewPartial", Model)
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Popup des Quittierungsbelegsdokuments -->
|
||||
@@ -4794,9 +4794,6 @@ namespace BeWo.Data.Access
|
||||
|
||||
var subset = IntervalFinderHelper.GenereateIntervalsForChecking(intervalStart, intervalEnd);
|
||||
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
|
||||
foreach (var dts in subset)
|
||||
{
|
||||
var start = dts.StartDate.MergeDatesByDate(intervalStart);
|
||||
@@ -4807,20 +4804,12 @@ namespace BeWo.Data.Access
|
||||
result.AddRangeIfElementsNotIn(apptmts);
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
|
||||
var ms = sw.ElapsedMilliseconds;
|
||||
Debug.WriteLine($"FindAppointmentsInRange: Es dauerte {ms}ms {result.Count} Termine zwischen dem {intervalStart:dd.MM.yyyy HH:mm} und dem {intervalEnd:dd.MM.yyyy HH:mm} aus der Datenbank zu laden");
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Normal = 0,
|
||||
Pattern = 1,
|
||||
Occurrence = 2,
|
||||
ChangedOccurrence = 3,
|
||||
DeletedOccurrence = 4
|
||||
|
||||
*/
|
||||
|
||||
var changedOccurrences = result.Where(a => a.Type == 3).Select(s => BS.Shared.Core.Utils.GetOccurrenceId(s.RecurrenceInfo)).ToList();
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BeWo.Service.Plugins
|
||||
//t = "6586058528"; // Freundeskreis Suchtkrankenhilfe e.V. (FFS)
|
||||
//t = "2632162696"; // Hand in Hand (ehemals Pro BeWo Düren)
|
||||
//t = "6340891020"; // Caritas Ahlen
|
||||
//t = "3659854106"; // alpha e.V.
|
||||
t = "3659854106"; // alpha e.V.
|
||||
//t = "5809130435"; // Lebenshilfe Kusel
|
||||
//t = "3367947706"; // PaS Mönchengladbach
|
||||
//t = "2331203795"; // BeWo für dich
|
||||
|
||||
@@ -75,5 +75,10 @@ namespace BS.Shared.Extensions
|
||||
pDictionary.Add(kvp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool ContainsValueAtKey<T, U>(this IDictionary<T, List<U>> dictionary, T key, U value)
|
||||
{
|
||||
return dictionary.ContainsKey(key) && (dictionary[key]?.Contains(value) ?? false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user