FaC:
- Rechte-Bug im Kalender behoben, der verhindert hat, dass man einen Termin mit Ressource und sich selbst in der Mitarbeiterliste bearbeiten konnte. MoK: - Minuten/Stunden/Minuten&Stunden als Zeiterfassungseinheit wie im FaC implementiert - Quittierungsbelegunterschriftenansicht verbessert - Laden der Zeiterfassungseinträge effizienter gemacht
This commit is contained in:
@@ -95,6 +95,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var mandator = GetMandator();
|
||||
var mandatorSettings = mandator.Settings;
|
||||
|
||||
Model.EinheitZeiterfassung = UserSettingsUtils.GetSettingValueAsInteger(mandatorSettings, SettingsKeys.EinheitZeiterfassung, 0);
|
||||
|
||||
Model.SetStartTimeToEndTimeAfterSave = UserSettingsUtils.GetSettingValueAsBool(mandatorSettings, SettingsKeys.SetStartTimeToEndTimeAfterSave);
|
||||
|
||||
var userSettings = AbstractModel.UserSettings;
|
||||
@@ -239,8 +241,6 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.IsEndDateVisible = UserSettingsUtils.GetSettingValueAsBool(mandatorSettings, SettingsKeys.IsEndDateVisible);
|
||||
|
||||
Model.IsZeiterfassungInStdMin = UserSettingsUtils.GetSettingValueAsBool(mandatorSettings, SettingsKeys.IsZeiterfassungInStdMin);
|
||||
|
||||
if(Model.IsZeiterfassungInStdMin)
|
||||
{
|
||||
var x = UserSettingsUtils.GetSettingValueAsInteger(userSettings, SettingsKeys.LetzteZeiterfassungsDauer);
|
||||
@@ -715,8 +715,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
OperationsService.InsertSignature(new SignatureDC
|
||||
{
|
||||
DataBild = blob,
|
||||
Zeitstempel = date,
|
||||
DataBild = blob,
|
||||
Zeitstempel = date,
|
||||
ServiceRecordOid = serviceRecordOid
|
||||
});
|
||||
}
|
||||
@@ -1802,7 +1802,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
SaveServiceRecordTimeIntervalToSession(serviceRecordTimeInterval);
|
||||
|
||||
LoadRecordsToModel();
|
||||
//LoadRecordsToModel();
|
||||
|
||||
return RedirectToActionPermanent("Main");
|
||||
}
|
||||
@@ -1882,12 +1882,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
if(Model.CostBearer2SupportConceptOid is null || Model.CostBearer2SupportConceptOid < 1)
|
||||
{
|
||||
records = Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.ZeitraumWaehlen || Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.Monatsauswahl ?
|
||||
//Zeitraum oder Monat gewählt
|
||||
OperationsService.GetEmployeesServiceRecordsWithStartEndDate(Model.Employee.EmployeeOid.Value, Model.SelectedZeitraum.StartDate.Value, Model.SelectedZeitraum.EndDate.Value).ToList() :
|
||||
OperationsService.GetEmployeesServiceRecords2(Model.Employee.EmployeeOid.Value, selectedDayCount).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
records = Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.ZeitraumWaehlen || Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.Monatsauswahl ?
|
||||
records = Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.ZeitraumWaehlen || Model.ServiceRecordTimeInterval == ServiceRecordTimeInterval.Monatsauswahl ?
|
||||
//Zeitraum oder Monat gewählt
|
||||
OperationsService.GetCustomerServiceRecordsCompactWithStartEndDate(Model.SelectedSupportConcept.Customer.CustomerOid, Model.CostBearer2SupportConceptOid.Value, Model.SelectedZeitraum.StartDate.Value, Model.SelectedZeitraum.EndDate.Value) :
|
||||
OperationsService.FindServiceRecordsForLastDays(Model.CostBearer2SupportConceptOid, Model.SelectedDayCount, Model.Employee.EmployeeOid.Value).ToList();
|
||||
}
|
||||
@@ -1998,15 +2000,15 @@ namespace BeWoPlanerMobil.Controllers
|
||||
[Authorize]
|
||||
public string GetSelectedRecordInformationWithOid(long oid)
|
||||
{
|
||||
if (Model is null)
|
||||
if(Model is null)
|
||||
{
|
||||
Logout();
|
||||
return LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
LoadRecordsToModel();
|
||||
var serviceRecord = Model.ServiceRecords.FirstOrDefault(f => f.ServiceRecordOid.HasValue && f.ServiceRecordOid.Value.Equals(oid)) ?? OperationsService.GetServiceRecordById(oid);
|
||||
|
||||
return SerializeObject(Model.ServiceRecords.First(f => f.ServiceRecordOid == oid));
|
||||
return !(serviceRecord != null && Model.AllEmployees.Contains(serviceRecord.Employee)) ? null : SerializeObject(serviceRecord);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -3148,7 +3150,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
LoadServiceCategoriesToModel(cb2ScOid);
|
||||
|
||||
LoadRecordsToModel();
|
||||
//LoadRecordsToModel();
|
||||
|
||||
LoadGoalRatings();
|
||||
|
||||
|
||||
@@ -65,18 +65,17 @@ namespace BeWoPlanerMobil.Controllers
|
||||
}
|
||||
|
||||
|
||||
// ToDo: Wenn es bereits Einstellungen gibt, den Quittierungsbeleg neuerstellen
|
||||
[Authorize]
|
||||
public ActionResult InitReports()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
if(!MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer"))
|
||||
{
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if (!AbstractModel.IsAllowedToSeeBills)
|
||||
if(!AbstractModel.IsAllowedToSeeBills)
|
||||
{
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
@@ -95,7 +94,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
Model.QbFilters.Clear();
|
||||
|
||||
foreach (var filterEnum in filterEnums)
|
||||
foreach(var filterEnum in filterEnums)
|
||||
{
|
||||
Model.QbFilters.AddIfNotIn(new QbFilterItem(filterEnum));
|
||||
}
|
||||
@@ -113,7 +112,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
CreateReport(null);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch(Exception e)
|
||||
{
|
||||
Log.Error(e.Message, e);
|
||||
}
|
||||
@@ -788,7 +787,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
foreach(var signature in dataContracts)
|
||||
{
|
||||
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") ?? "unbekannt";
|
||||
var date = signature.InsTs?.ToString("dd.MM.yyyy HH:mm:ss") ?? "unbekannt";
|
||||
var personName =
|
||||
signature.SignatureType == SignatureType.Customer ?
|
||||
(Model.Customers.FirstOrDefault(f => f.CustomerOid.Equals(signature.CustomerOid))?.LastNameFirstName ?? "unbekannt") :
|
||||
@@ -1056,7 +1055,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, true);
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("InitReports", Model);
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -1075,7 +1074,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
DeleteSignatures(info, false);
|
||||
}
|
||||
|
||||
return RedirectToActionPermanent("InitReports", Model);
|
||||
return RedirectToActionPermanent("InitReports");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
@@ -1138,11 +1137,10 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
var customerName = obj.CustomerName;
|
||||
var employeeName = MobileSessionFacade.LoggedInCompactEmployee.SimpleDescription;
|
||||
var serviceRecordCount = 0;
|
||||
signatures.DoForEach(sig => serviceRecordCount += sig.ServiceRecords.Count);
|
||||
var serviceRecordCount = obj.Items.Count;
|
||||
var personName = isEmployee ? employeeName : customerName;
|
||||
|
||||
Model.Quittierungsbelegsunterschriftenobjekt = new Quittierungsbelegsunterschriftenobjekt(isEmployee, personName, Model.ConfirmationReceiptObject.TimeSpanString, customerName, serviceRecordCount);
|
||||
Model.Quittierungsbelegsunterschriftenobjekt = new Quittierungsbelegsunterschriftenobjekt(isEmployee, personName, Model.ConfirmationReceiptObject.TimeSpanString, customerName, serviceRecordCount, obj.CustomerOid);
|
||||
|
||||
return PartialView("ConfirmationReceiptSignaturePartial", Model);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using BeWo.Service.Plugins;
|
||||
using BeWo.View.Navigation.Filter;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
@@ -21,10 +16,10 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
public class MainModel : AbstractModel
|
||||
{
|
||||
[Display(Name = "Nur meine Hilfepläne anzeigen")]
|
||||
[Display(Name = "Nur meine Klienten anzeigen")]
|
||||
public bool ShowOnlyOwnSupportConcepts { get; set; }
|
||||
|
||||
[Display(Name = "Nur Hilfepläne meiner Teams anzeigen")]
|
||||
[Display(Name = "Nur Klienten meiner Teams anzeigen")]
|
||||
public bool ShowOnlyMyTeamsSupportConcepts { get; set; }
|
||||
|
||||
public CustomerFilterEnum SelectedSupportConceptFilter { get; set; }
|
||||
@@ -55,9 +50,13 @@ namespace BeWoPlanerMobil.Models
|
||||
|
||||
var user = MobileSessionFacade.LoggedInUser;
|
||||
|
||||
const string allSupportConcepts = "Alle Hilfepläne anzeigen";
|
||||
const string mySupportConceptsOnly = "Nur meine Hilfepläne anzeigen";
|
||||
const string myTeamsSupportConceptsOnly = "Nur Hilfepläne meiner Teams anzeigen";
|
||||
var alle = new CustomerFilterItem(CustomerFilterEnum.All);
|
||||
var nurMeine = new CustomerFilterItem(CustomerFilterEnum.MyCustomer);
|
||||
var meinesTeams = new CustomerFilterItem(CustomerFilterEnum.TeamCustomer);
|
||||
|
||||
var allSupportConcepts = alle.CustomerFilterName;
|
||||
var mySupportConceptsOnly = nurMeine.CustomerFilterName;
|
||||
var myTeamsSupportConceptsOnly = meinesTeams.CustomerFilterName;
|
||||
|
||||
const string allSupportConceptsValue = "0";
|
||||
const string mySupportConceptsValue = "1";
|
||||
@@ -528,7 +527,9 @@ namespace BeWoPlanerMobil.Models
|
||||
return allowed;
|
||||
}
|
||||
|
||||
public bool IsZeiterfassungInStdMin { get; set; }
|
||||
public bool IsZeiterfassungInStdMin => EinheitZeiterfassung == 2;
|
||||
|
||||
public int EinheitZeiterfassung { get; set; }
|
||||
|
||||
public string StartDateToEdit => SelectedServiceRecord?.Start?.ToShortDateString() ?? DateTime.Today.ToShortDateString();
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
function hideSpinner() {
|
||||
$("#mySpinner").modal("hide");
|
||||
$("#loading-info-p").text("Lade ...");
|
||||
}
|
||||
|
||||
function showMessagePopup(title, message) {
|
||||
@@ -380,4 +381,41 @@ function resetTreeSearch(searchInputId, textClass, cardClass) {
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function showMessagePopupWithHtmlAndCallback(title, messageAsHtml, hasCloseButton, callback, executeCallbackByBothButtons) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
if (messageAsHtml !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
|
||||
$("#popupMessage").html(messageAsHtml);
|
||||
|
||||
$("#message-popup-ok-btn").off("click");
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function () {
|
||||
callback();
|
||||
});
|
||||
|
||||
if (hasCloseButton === false) {
|
||||
$("#message-popup-close-btn").hide();
|
||||
} else {
|
||||
$("#message-popup-close-btn").show();
|
||||
}
|
||||
|
||||
if(executeCallbackByBothButtons === true) {
|
||||
$("#message-popup-close-btn, #message-popup-esc-btn").off("click");
|
||||
$("#message-popup-close-btn, #message-popup-esc-btn").on("click",
|
||||
function () {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
backdrop: "static",
|
||||
keyboard: false
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -54,6 +54,20 @@ function initializeSignature(selectedServiceRecordOid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isEmptyOrSpaces(jsonServiceRecord)) {
|
||||
$("#main-container, #checkbox-container").show();
|
||||
$("#signature-container").removeClass("d-block");
|
||||
|
||||
showMessagePopupWithHtmlAndCallback("Fehler", "Der zu unterschreibende Zeiterfassungseintrag konnte nicht geladen werden. Bitte wenden Sie sich an den Support.<br/><br/><a href='mailto:support@bewoplaner.de'>support@bewoplaner.de</a>", false,
|
||||
function () {
|
||||
showSpinner();
|
||||
|
||||
location.reload();
|
||||
},
|
||||
true);
|
||||
return;
|
||||
}
|
||||
|
||||
var record = $.parseJSON(jsonServiceRecord);
|
||||
|
||||
var startDate = record.Start[18] === "1" ? "" : record.Start.slice(11, 16);
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
function calculateTimeWithDuration(timeInputValue, timeElement, startDate, duration, hoursMinutesDropdownBtnId) {
|
||||
var isInMin = getIsZeiterfassungseinheitInMinutes();
|
||||
|
||||
var hoursToMinutes = parseTimeInputToIntegerArray(timeInputValue);
|
||||
var hours = parseInt(hoursToMinutes[0]);
|
||||
var minutes = parseInt(hoursToMinutes[1]);
|
||||
var stdMinDropdown = $("#" + hoursMinutesDropdownBtnId);
|
||||
|
||||
startDate.hours(hours);
|
||||
startDate.minutes(minutes);
|
||||
|
||||
if(stdMinDropdown.length) {
|
||||
isInMin = stdMinDropdown.text().replaceAll(/\s/g, "") === "Minuten";
|
||||
}
|
||||
|
||||
var durationFormat = $("#" + hoursMinutesDropdownBtnId).length && $("#" + hoursMinutesDropdownBtnId).text().replaceAll(/\s/g, "") === "Stunden" ? "h" : "m";
|
||||
var durationFormat = isInMin ? "m" : "h";
|
||||
|
||||
startDate.add(duration, durationFormat);
|
||||
|
||||
@@ -17,20 +24,19 @@
|
||||
|
||||
function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durationId, hoursMinutesDropdownBtnId, startDatePickerId, endDatePickerId) {
|
||||
try {
|
||||
var isInMin = getIsZeiterfassungseinheitInMinutes();
|
||||
|
||||
var startTime = $("#" + startTimeId).val();
|
||||
var endTime = $("#" + endTimeId).val();
|
||||
var duration = $("#" + durationId).val();
|
||||
var hoursMinutesDropdownButton = $("#" + hoursMinutesDropdownBtnId);
|
||||
|
||||
|
||||
var hoursMinutesText = hoursMinutesDropdownButton.length ? hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") : "";
|
||||
|
||||
var startTimeCondition = startTime !== undefined && startTime !== null && startTime.length > 0;
|
||||
var endTimeCondition = endTime !== undefined && endTime !== null && endTime.length > 0;
|
||||
var durationNumber = parseFloat(duration.replace(",", "."));
|
||||
var durationCondition = !isNaN(durationNumber);
|
||||
|
||||
if ((false === startTimeCondition && false === endTimeCondition) || durationCondition === false) {
|
||||
if((false === startTimeCondition && false === endTimeCondition) || durationCondition === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -38,21 +44,25 @@ function onDurationChange(startTimeId, endTimeId, startDateId, endDateId, durati
|
||||
var endDate = moment(new Date());
|
||||
var startDate = moment(new Date());
|
||||
|
||||
if (startDateString.length !== 0) {
|
||||
if(startDateString.length !== 0) {
|
||||
startDate = moment(startDateString);
|
||||
endDate = startDate.clone();
|
||||
}
|
||||
|
||||
if ($("#" + endDatePickerId).length !== 0) {
|
||||
if($("#" + endDatePickerId).length !== 0) {
|
||||
var endDateString = $("#" + endDatePickerId).datetimepicker("date");
|
||||
endDate = moment(endDateString);
|
||||
}
|
||||
|
||||
var h2m = [0, 0];
|
||||
|
||||
var durationFormat = hoursMinutesText === "Stunden" ? "h" : "m";
|
||||
if(hoursMinutesDropdownButton.length) {
|
||||
isInMin = hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") === "Minuten";
|
||||
}
|
||||
|
||||
if (startTimeCondition === true) {
|
||||
var durationFormat = isInMin ? "m" : "h";
|
||||
|
||||
if(startTimeCondition === true) {
|
||||
h2m = parseTimeInputToIntegerArray(startTime);
|
||||
|
||||
startDate = startDate.hours(h2m[0]).minutes(h2m[1]);
|
||||
@@ -80,9 +90,15 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
|
||||
var duration = $("#" + durationId).val();
|
||||
|
||||
var hoursMinutesDropdownButton = $("#" + hoursMinutesDropdownBtnId);
|
||||
var hoursMinutesText = hoursMinutesDropdownButton.length ?
|
||||
hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") :
|
||||
"";
|
||||
var hoursMinutesText = hoursMinutesDropdownButton.length ? hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") : "";
|
||||
|
||||
var isInMin = getIsZeiterfassungseinheitInMinutes();
|
||||
|
||||
if (hoursMinutesDropdownButton.length) {
|
||||
isInMin = hoursMinutesDropdownButton.text().replaceAll(/\s/g, "") === "Minuten";
|
||||
}
|
||||
|
||||
var durationFormat = isInMin ? "m" : "h";
|
||||
|
||||
if((startTime.length > 0 && startTime.length < 5) || (endTime.length > 0 && endTime.length < 5)) {
|
||||
return;
|
||||
@@ -90,9 +106,12 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
|
||||
|
||||
var startTimeCondition = startTime !== undefined && startTime !== null && startTime.length > 0;
|
||||
var endTimeCondition = endTime !== undefined && endTime !== null && endTime.length > 0;
|
||||
|
||||
var durationNumber = parseFloat(duration.replace(",", "."));
|
||||
var durationCondition = !isNaN(durationNumber);
|
||||
|
||||
var startDateString = $("#" + startDatePickerId).datetimepicker("date");
|
||||
|
||||
var endDate = moment(new Date());
|
||||
var startDate = moment(new Date());
|
||||
|
||||
@@ -125,34 +144,30 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
|
||||
var momentDuration = moment.duration(endDate.diff(startDate));
|
||||
|
||||
if(durationNumber > 0 && isInvokedByStartElement && startDate >= endDate) {
|
||||
endDate = startDate.clone().add(durationNumber, hoursMinutesText === "Stunden" ? "h" : "m");
|
||||
endDate = startDate.clone().add(durationNumber, durationFormat);
|
||||
|
||||
$("#" + endTimeId).val(endDate.format("HH:mm"));
|
||||
$("#" + endDatePickerId).val(endDate.format("DD.MM.yyyy"));
|
||||
|
||||
momentDuration = moment.duration(endDate.diff(startDate));
|
||||
}
|
||||
|
||||
if(durationNumber > 0 && isInvokedByEndElement && startDate >= endDate) {
|
||||
startDate = endDate.clone().subtract(durationNumber, hoursMinutesText === "Speichern" ? "h" : "m");
|
||||
if (durationNumber > 0 && isInvokedByEndElement && startDate >= endDate) {
|
||||
startDate = endDate.clone().subtract(durationNumber, durationFormat);
|
||||
|
||||
$("#" + startTimeId).val(startDate.format("HH:mm"));
|
||||
$("#" + startDatePickerId).val(startDate.format("DD.MM.yyyy"));
|
||||
|
||||
momentDuration = moment.duration(endDate.diff(startDate));
|
||||
}
|
||||
|
||||
if(hoursMinutesDropdownButton.length && hoursMinutesText === "Stunden") {
|
||||
newDurationValue = momentDuration.asHours();
|
||||
} else {
|
||||
newDurationValue = momentDuration.asMinutes();
|
||||
}
|
||||
newDurationValue = isInMin ? momentDuration.asMinutes() : momentDuration.asHours();
|
||||
|
||||
$("#" + durationId).val(newDurationValue);
|
||||
// Startdatum und Dauer sind vorhanden
|
||||
} else if(startTimeCondition && durationCondition) {
|
||||
if(hoursMinutesDropdownButton.length) {
|
||||
if(hoursMinutesText === "Stunden") {
|
||||
durationNumber /= 60;
|
||||
} else {
|
||||
durationNumber *= 60;
|
||||
}
|
||||
if (hoursMinutesDropdownButton.length) {
|
||||
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
|
||||
|
||||
$("#" + durationId).val(durationNumber);
|
||||
}
|
||||
@@ -160,12 +175,8 @@ function calculateDuration(isInvocatedByHoursMinutesButton, startTimeId, endTime
|
||||
calculateTimeWithDuration(startTime, $("#" + endTimeId), startDate, durationNumber, hoursMinutesDropdownBtnId);
|
||||
// Enddatum und Dauer sind vorhanden
|
||||
} else if(endTimeCondition && durationCondition) {
|
||||
if(hoursMinutesDropdownButton.length) {
|
||||
if (hoursMinutesText === "Stunden") {
|
||||
durationNumber /= 60;
|
||||
} else {
|
||||
durationNumber *= 60;
|
||||
}
|
||||
if (hoursMinutesDropdownButton.length) {
|
||||
durationNumber = isInMin ? durationNumber *= 60 : durationNumber /= 60;
|
||||
|
||||
$("#" + durationId).val(durationNumber);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
function initializeYearAndMonths() {
|
||||
calculateDays();
|
||||
}
|
||||
|
||||
function initializeReportView() {
|
||||
function initializeReportView() {
|
||||
checkForExistingSignature();
|
||||
calculateDays();
|
||||
qbFilterSelectionChange();
|
||||
}
|
||||
|
||||
@@ -72,7 +67,6 @@ function confirmReportSignatureCancellation() {
|
||||
|
||||
function onMonthOrYearChange() {
|
||||
calculateDays();
|
||||
|
||||
checkForExistingSignature();
|
||||
}
|
||||
|
||||
@@ -137,47 +131,48 @@ function onCustomerSelectionChange() {
|
||||
}
|
||||
|
||||
// Lädt die bisher geleisteten Unterschriften
|
||||
function getSignatures(signatureOidStrings, containerId) {
|
||||
logInfo3("Lade vorhandene Unterschriften für Container '" + containerId + "' mit veralteter Methode");
|
||||
try {
|
||||
showSpinner();
|
||||
//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("");
|
||||
// var container = $(containerId);
|
||||
// container.html("");
|
||||
|
||||
$.get(getLoadConfirmationReceiptSignaturesUrl(), { oidsAsString: signatureOidStrings }).done(function(json) {
|
||||
if(isUndefinedOrNull(json) || !checkJson(json)) {
|
||||
if(!checkJson(json)) {
|
||||
hideSpinner();
|
||||
}
|
||||
}
|
||||
// $.get(getLoadConfirmationReceiptSignaturesUrl(), { oidsAsString: signatureOidStrings }).done(function(json) {
|
||||
// if(isUndefinedOrNull(json) || !checkJson(json)) {
|
||||
// if(!checkJson(json)) {
|
||||
// hideSpinner();
|
||||
// }
|
||||
// }
|
||||
|
||||
if(isEmptyOrSpaces(json)) {
|
||||
hideSpinner();
|
||||
return;
|
||||
}
|
||||
// if(isEmptyOrSpaces(json)) {
|
||||
// hideSpinner();
|
||||
// return;
|
||||
// }
|
||||
|
||||
var signatureList = $.parseJSON(json);
|
||||
// var signatureList = $.parseJSON(json);
|
||||
|
||||
var newHtml = "";
|
||||
// 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>";
|
||||
});
|
||||
// $.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);
|
||||
}
|
||||
}
|
||||
// container.append(newHtml);
|
||||
// hideSpinner();
|
||||
// });
|
||||
// } catch(error) {
|
||||
// showErrorPopup(error);
|
||||
// }
|
||||
//}
|
||||
|
||||
function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, overridingAlertId) {
|
||||
try {
|
||||
@@ -203,8 +198,6 @@ function cancelSignature(canSign, signaturePad, canvasId, signatureContainer, ov
|
||||
|
||||
var isEmpty = signaturePad.isEmpty();
|
||||
|
||||
logInfo3("Canvas ist leer: " + isEmpty);
|
||||
|
||||
if(isEmpty === true) {
|
||||
hideSignatureContainer(signatureContainer, overridingAlertId);
|
||||
signaturePad.clear();
|
||||
@@ -230,59 +223,60 @@ function hideSignatureContainer(signatureContainer, overridingAlertId) {
|
||||
$("#report-form-container").show();
|
||||
}
|
||||
|
||||
function showSignaturePad(overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature, employeeName) {
|
||||
try {
|
||||
cardHeaderButtonClick(cardBodyId);
|
||||
//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");
|
||||
// $("#report-form-container").hide();
|
||||
// $("#report-signature-container-div").addClass("d-block");
|
||||
|
||||
var plural = "";
|
||||
if(!isEmptyOrSpaces(signatureOidsString) && signatureOidsString.includes(",")) {
|
||||
plural = "en";
|
||||
}
|
||||
// var plural = "";
|
||||
// if(!isEmptyOrSpaces(signatureOidsString) && signatureOidsString.includes(",")) {
|
||||
// plural = "en";
|
||||
// }
|
||||
|
||||
var entryCount = parseInt(numberOfEntries, 10);
|
||||
// var entryCount = parseInt(numberOfEntries, 10);
|
||||
|
||||
var leistungPlural = entryCount > 1 ? "en" : "";
|
||||
// var leistungPlural = entryCount > 1 ? "en" : "";
|
||||
|
||||
var signatureGiverName = isEmployeeSignature ? employeeName : customerName;
|
||||
// var signatureGiverName = isEmployeeSignature ? employeeName : customerName;
|
||||
|
||||
$("#report-info-column-h4").html("Unterschrift" + plural + " von " + signatureGiverName + " für " + numberOfEntries + " erbrachte Leistung" + leistungPlural + " von " + customerName + " (" + timeSpan + ")");
|
||||
// $("#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");
|
||||
}
|
||||
// if(overwrite) {
|
||||
// $("#overwriting-signature-alert").addClass("d-block");
|
||||
// }
|
||||
|
||||
getSignatures(signatureOidsString, "#signature-container-div");
|
||||
// getSignatures(signatureOidsString, "#signature-container-div");
|
||||
|
||||
hideSigningParts(canSign);
|
||||
// hideSigningParts(canSign);
|
||||
|
||||
resizeCanvas("#report-sketch-pad-canvas", "#report-canvas-row-div");
|
||||
// resizeCanvas("#report-sketch-pad-canvas", "#report-canvas-row-div");
|
||||
|
||||
var canvas = document.getElementById("report-sketch-pad-canvas");
|
||||
// var canvas = document.getElementById("report-sketch-pad-canvas");
|
||||
|
||||
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
// 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");
|
||||
// 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");
|
||||
});
|
||||
// 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");
|
||||
});
|
||||
// saveButton.addEventListener("click", function() {
|
||||
// saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad, "report-sketch-pad-canvas");
|
||||
// });
|
||||
|
||||
clearButton.addEventListener("click", function() {
|
||||
signaturePad.clear();
|
||||
});
|
||||
} catch(error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
// clearButton.addEventListener("click", function() {
|
||||
// signaturePad.clear();
|
||||
// });
|
||||
// } catch(error) {
|
||||
// showErrorPopup(error);
|
||||
// }
|
||||
//}
|
||||
|
||||
function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad, canvasId) {
|
||||
try {
|
||||
@@ -300,37 +294,26 @@ function saveSignature(customerOid, isEmployeeSignature, overwrite, signaturePad
|
||||
|
||||
var dataUrl = trimmedCanvas.toDataURL("image/png");
|
||||
|
||||
showMessagePopupWithCallback(
|
||||
"Unterschrift speichern",
|
||||
"Mit dem Speichern der Unterschrift ist es nicht mehr möglich, die betroffenen Einträge der Zeiterfassung zu ändern.",
|
||||
function() {
|
||||
try {
|
||||
showSpinner();
|
||||
showSpinner();
|
||||
|
||||
var url = getCreateSignatureForServiceOverviewUrl();
|
||||
var url = getCreateSignatureForServiceOverviewUrl();
|
||||
|
||||
$.post(url, { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: !isEmployeeSignature, overwrite: overwrite }).done(function(json) {
|
||||
hideSpinner();
|
||||
|
||||
if(isEmptyOrSpaces(json)) {
|
||||
showMessagePopupWithCallback("Unterschrift",
|
||||
"Die Unterschrift wurde erfolgreich gespeichert.",
|
||||
function() {
|
||||
showSpinner();
|
||||
location.reload();
|
||||
},
|
||||
true);
|
||||
} else {
|
||||
showMessagePopup("Fehler", json);
|
||||
signaturePad.clear();
|
||||
}
|
||||
});
|
||||
} catch (innerEx) {
|
||||
showErrorPopup(innerEx);
|
||||
}
|
||||
},
|
||||
false);
|
||||
$.post(url, { base64SignatureString: dataUrl, customerOidString: customerOid, isCustomerSignature: !isEmployeeSignature, overwrite: overwrite }).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();
|
||||
location.reload();
|
||||
},
|
||||
true);
|
||||
} else {
|
||||
showMessagePopup("Fehler", json);
|
||||
signaturePad.clear();
|
||||
}
|
||||
});
|
||||
} catch (ex) {
|
||||
showErrorPopup(ex);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using BeWoPlanerMobil.Models;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
@@ -434,5 +436,34 @@ namespace BeWoPlanerMobil.Util
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
|
||||
public static string ToHtml(string s, bool nofollow)
|
||||
{
|
||||
s = HttpUtility.HtmlEncode(s);
|
||||
var paragraphs = s.Split(new[] { "\r\n\r\n" }, StringSplitOptions.None);
|
||||
var stringBuilder = new StringBuilder();
|
||||
|
||||
foreach(var par in paragraphs)
|
||||
{
|
||||
stringBuilder.AppendLine("<p>");
|
||||
var p = par.Replace(Environment.NewLine, "<br />\r\n");
|
||||
|
||||
if(nofollow)
|
||||
{
|
||||
p = Regex.Replace(p, @"\[\[(.+)\]\[(.+)\]\]", "<a href=\"$2\" rel=\"nofollow\">$1</a>");
|
||||
p = Regex.Replace(p, @"\[\[(.+)\]\]", "<a href=\"$1\" rel=\"nofollow\">$1</a>");
|
||||
}
|
||||
else
|
||||
{
|
||||
p = Regex.Replace(p, @"\[\[(.+)\]\[(.+)\]\]", "<a href=\"$2\">$1</a>");
|
||||
p = Regex.Replace(p, @"\[\[(.+)\]\]", "<a href=\"$1\">$1</a>");
|
||||
stringBuilder.AppendLine(p);
|
||||
}
|
||||
|
||||
stringBuilder.AppendLine("</p>");
|
||||
}
|
||||
|
||||
return stringBuilder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,14 +7,16 @@
|
||||
public string TimeSpanInfo { get; }
|
||||
public string CustomerName { get; }
|
||||
public int ServiceRecordCount { get; }
|
||||
public long CustomerOid { get; }
|
||||
|
||||
public Quittierungsbelegsunterschriftenobjekt(bool isEmployeeSignature, string personName, string timeSpanInfo, string customerName, int serviceRecordCount)
|
||||
public Quittierungsbelegsunterschriftenobjekt(bool isEmployeeSignature, string personName, string timeSpanInfo, string customerName, int serviceRecordCount, long customerOid)
|
||||
{
|
||||
IsEmployeeSignature = isEmployeeSignature;
|
||||
PersonName = personName;
|
||||
TimeSpanInfo = timeSpanInfo;
|
||||
CustomerName = customerName;
|
||||
ServiceRecordCount = serviceRecordCount;
|
||||
CustomerOid = customerOid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BeWoPlanerMobil.Util
|
||||
@using BS.Shared
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
<script>
|
||||
@@ -255,8 +256,11 @@
|
||||
<div class="form-group my-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
@{
|
||||
var labelText = Model.EinheitZeiterfassung == 1 ? "Dauer (h)" : "Dauer";
|
||||
}
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
Dauer
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="duration" name="Dauer" onchange="onDurationChange('start-time', 'end-time', 'start-date', 'end-date', 'duration', 'hours-minutes-dropdown-btn', 'start-date-picker', 'end-date-picker')" value="@durationValue">
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
}
|
||||
|
||||
<script>
|
||||
function getIsZeiterfassungseinheitInMinutes() {
|
||||
return "@Model.EinheitZeiterfassung" === "0";
|
||||
}
|
||||
|
||||
function textModuleOnClick(textModuleOid) {
|
||||
var focusedDokuFeld;
|
||||
|
||||
@@ -367,7 +371,7 @@
|
||||
var result = /^\d*$/;
|
||||
var dropdownButton = $("#" + hoursMinutesDropdownBtnId);
|
||||
|
||||
if (dropdownButton.length && dropdownButton.text() === "Stunden") {
|
||||
if (dropdownButton.length && dropdownButton.text() === "Stunden" || getIsZeiterfassungseinheitInMinutes() === false) {
|
||||
result = /^-?\d*[.,]?\d*$/;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@using BeWoPlanerMobil.Models
|
||||
@using BS.Shared
|
||||
@model BeWoPlanerMobil.Models.MainModel
|
||||
|
||||
<script>
|
||||
@@ -443,8 +444,11 @@
|
||||
<div class="form-group my-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
@{
|
||||
var labelText = Model.EinheitZeiterfassung == 1 ? "Dauer (h)" : "Dauer";
|
||||
}
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
Dauer
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="mb-duration" name="Dauer" onchange="onDurationChange('mb-start-time', 'mb-end-time', 'mb-start-date', 'mb-end-date', 'mb-duration', 'mb-hours-minutes-dropdown-btn', 'mb-start-date-picker', 'mb-end-date-picker')" value="@durationValue">
|
||||
|
||||
@@ -282,8 +282,11 @@
|
||||
<div class="form-group my-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
@{
|
||||
var labelText = Model.EinheitZeiterfassung == 1 ? "Dauer (h)" : "Dauer";
|
||||
}
|
||||
<div class="input-group-text prepend-input-group-text">
|
||||
Dauer
|
||||
@labelText
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="duration" name="Dauer" onchange="onDurationChange('start-time', 'end-time', 'start-date', 'end-date', 'duration', 'hours-minutes-dropdown-btn', 'start-date-picker', 'end-date-picker')" value="@durationValue">
|
||||
@@ -882,7 +885,7 @@
|
||||
@header1:
|
||||
</div>
|
||||
<div class="col">
|
||||
@serviceRecord.Notice
|
||||
@Html.Raw(MobileUtils.ToHtml(serviceRecord.Notice, false))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -911,7 +914,7 @@
|
||||
@header:
|
||||
</div>
|
||||
<div class="col">
|
||||
@notice
|
||||
@Html.Raw(MobileUtils.ToHtml(notice, false))
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
@using BeWoPlanerMobil.Util.ReportUtils
|
||||
@model BeWoPlanerMobil.Models.ReportModel
|
||||
|
||||
@{
|
||||
var plural = Model.ConfirmationReceiptObject.NumberOfServiceRecords > 1 ? "en" : string.Empty;
|
||||
@@ -8,70 +9,166 @@
|
||||
var sigInfo = $"Unterschrift{plural} von {Model.Quittierungsbelegsunterschriftenobjekt.PersonName} für {Model.Quittierungsbelegsunterschriftenobjekt.ServiceRecordCount} erbrachte Leistung{leistungsplurarl} von {Model.Quittierungsbelegsunterschriftenobjekt.CustomerName} ({Model.Quittierungsbelegsunterschriftenobjekt.TimeSpanInfo})";
|
||||
}
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$(".left-col").width(getMaxWidth("left-col"));
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
|
||||
$(".signature-card").ready(function () {
|
||||
try {
|
||||
$(".signature-card").height(getMaxElementHeight("signature-card"));
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h4 class="d-inline" id="qb-sig-info-col">@sigInfo</h4>
|
||||
<button type="button" class="btn btn-primary float-right" id="qb-sig-cancel-btn">
|
||||
<span class="fas fa-times-circle"></span>
|
||||
</button>
|
||||
<h4 class="d-inline" id="qb-sig-info-col">@sigInfo</h4>
|
||||
@{
|
||||
|
||||
var xyz = Model.Quittierungsbelegsunterschriftenobjekt;
|
||||
|
||||
var isEmployeeSignature = Model.Quittierungsbelegsunterschriftenobjekt.IsEmployeeSignature;
|
||||
var cro = Model.ConfirmationReceiptObject.ConfirmationReceiptResultList.FirstOrDefault(f => f.CustomerOid.Equals(xyz.CustomerOid));
|
||||
|
||||
string message = null;
|
||||
string message2 = null;
|
||||
|
||||
if(!(cro is null))
|
||||
{
|
||||
if(isEmployeeSignature)
|
||||
{
|
||||
if(cro.EmployeeSignatureState == SignatureState.Some)
|
||||
{
|
||||
message = "Es wurde eine Unterschrift für mehrere Termine geleistet. Danach ist mindestens ein Termin verändert worden oder neu dazugekommen.<br />Ihre Unterschrift muss deshalb erneut erfolgen, um auf dem Quittierunsbeleg angezeigt zu werden.";
|
||||
}
|
||||
|
||||
if(cro.EmployeeSignatureState == SignatureState.All)
|
||||
{
|
||||
message2 = "Es wurde für alle Termine eine Unterschrift hinterlegt.<br />Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(cro.CustomerSignatureState == SignatureState.Some)
|
||||
{
|
||||
message = "Es wurde eine Unterschrift für mehrere Termine geleistet. Danach ist mindestens ein Termin verändert worden oder neu dazugekommen.<br />Die Unterschrift des Klienten muss deshalb erneut erfolgen, um auf dem Quittierunsbeleg angezeigt zu werden.";
|
||||
}
|
||||
|
||||
if(cro.CustomerSignatureState == SignatureState.All)
|
||||
{
|
||||
message2 = "Es wurde für alle Termine eine Unterschrift hinterlegt.<br />Die Unterschrift wird auf dem Quittierungsbeleg angezeigt.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@if(!(message is null))
|
||||
{
|
||||
<div class="alert alert-primary d-block w-100 mt-4" role="alert">
|
||||
@Html.Raw(message)
|
||||
</div>
|
||||
}
|
||||
|
||||
@if(!(message2 is null))
|
||||
{
|
||||
<div class="alert alert-success d-block w-100 mt-4" role="alert">
|
||||
@Html.Raw(message2)
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div id="qb-sig-container" class="container mt-4 w-100">
|
||||
@*
|
||||
ToDo: Hier die bereits geleisteten Unterschriften anzeigen
|
||||
<div id="qb-sig-container">
|
||||
<div class="row justify-content-center">
|
||||
@functions
|
||||
{
|
||||
public string GetColumnClass()
|
||||
{
|
||||
// md: 1 -> 12, ab 2 -> 6
|
||||
// lg: 1 -> 12, 2 -> 6, ab 3 -> 4
|
||||
// xl: 1 -> 12, 2 -> 6, 3 -> 4, ab 4 -> 3
|
||||
|
||||
xs: < 576px
|
||||
sm: >= 576px
|
||||
md: >= 768px
|
||||
lg: >= 992px
|
||||
xl: >= 1200px
|
||||
var count = Model.SelectedConfirmationReceiptSignatures.Count;
|
||||
|
||||
xs: maximal 1
|
||||
sm: maximal 1
|
||||
md: maximal 2
|
||||
lg: maximal 3
|
||||
xl: maximal 4
|
||||
*@
|
||||
var colMd = string.Empty;
|
||||
var colLg = string.Empty;
|
||||
var colXl = string.Empty;
|
||||
|
||||
<div class="row">
|
||||
@{
|
||||
var count = Model.SelectedConfirmationReceiptSignatures.Count;
|
||||
if(count < 2)
|
||||
{
|
||||
colMd += "12";
|
||||
colLg += "3";
|
||||
colXl += "4";
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(count)
|
||||
{
|
||||
case 2:
|
||||
colMd += "6";
|
||||
colLg += "6";
|
||||
colXl += "6";
|
||||
break;
|
||||
case 3:
|
||||
colLg += "4";
|
||||
colXl += "4";
|
||||
break;
|
||||
case 4:
|
||||
colXl += "3";
|
||||
break;
|
||||
default:
|
||||
colMd += "6";
|
||||
colLg += "3";
|
||||
colXl += "4";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var colClass = $"col-sm-12 col-md-";
|
||||
|
||||
|
||||
return $"col-sm-12 col-md-{colMd} col-lg-{colLg} col-xl-{colXl}";
|
||||
}
|
||||
}
|
||||
|
||||
@foreach(var signature in Model.SelectedConfirmationReceiptSignatures)
|
||||
{
|
||||
var blubb = $"{(signature.NumberOfServiceRecords == 1 ? "eine" : signature.NumberOfServiceRecords.ToString())} Leistung{(signature.NumberOfServiceRecords != 1 ? "en" : string.Empty)}";
|
||||
var blubb = $"{(signature.NumberOfServiceRecords == 1 ? "eine" : signature.NumberOfServiceRecords.ToString())} erbrachte Leistung{(signature.NumberOfServiceRecords != 1 ? "en" : string.Empty)}";
|
||||
|
||||
<div class="col-sm-12 col-md-6 col-lg-4 col-xl-3 mx-0 ">
|
||||
<div class="card">
|
||||
<img src="@signature.ImageStr" class="card-img-top" alt="Unterschrift von @signature.PersonName geleistet am @signature.InsTsStr"/>
|
||||
<div class="card-body">
|
||||
<div class="@GetColumnClass()">
|
||||
<div class="card signature-card mt-4">
|
||||
<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-footer">
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="col-auto left-col">
|
||||
Unterschrift von:
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<div class="col">
|
||||
@signature.PersonName
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="col-auto left-col">
|
||||
Geleistet am:
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<div class="col">
|
||||
@signature.InsTsStr
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="col-auto left-col">
|
||||
Geleistet für:
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<div class="col">
|
||||
@blubb
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,44 +33,54 @@
|
||||
cardHeaderButtonClick(cardBodyId);
|
||||
|
||||
$("#report-form-container").hide();
|
||||
|
||||
showSpinner();
|
||||
|
||||
$("#report-signature-container").empty();
|
||||
$("#report-signature-container").addClass("d-block");
|
||||
|
||||
$("#report-signature-container").load("@Url.Action("FetchConfirmationReceiptSignatures", "Report")", { identifier: identifier, isEmployee: isEmployee }, function() {
|
||||
var overrideAlert = $("#qb-sig-override-alert");
|
||||
if (isOverriding === true) {
|
||||
overrideAlert.show();
|
||||
} else {
|
||||
overrideAlert.hide();
|
||||
}
|
||||
try {
|
||||
$("#loading-info-p").text("Lade Unterschriften ...");
|
||||
$("#report-signature-container").load("@Url.Action("FetchConfirmationReceiptSignatures", "Report")",
|
||||
{ identifier: identifier, isEmployee: isEmployee },
|
||||
function () {
|
||||
hideSpinner();
|
||||
$("#loading-info-p").text("Lade ...");
|
||||
|
||||
if (canSign) {
|
||||
$("#qb-sig-canvas-row, #qb-sig-canvas-container, #qb-sig-sketch-pad").show();
|
||||
} else {
|
||||
$("#qb-sig-canvas-row, #qb-sig-canvas-container, #qb-sig-sketch-pad, #qb-sig-save-btn, #qb-sig-clear-canvas-btn").hide();
|
||||
}
|
||||
if(canSign) {
|
||||
$("#qb-sig-canvas-row, #qb-sig-canvas-container, #qb-sig-sketch-pad").show();
|
||||
} else {
|
||||
$("#qb-sig-canvas-row, #qb-sig-canvas-container, #qb-sig-sketch-pad, #qb-sig-save-btn, #qb-sig-clear-canvas-btn").hide();
|
||||
}
|
||||
|
||||
resizeCanvas("#qb-sig-sketch-pad", "#qb-sig-canvas-row");
|
||||
resizeCanvas("#qb-sig-sketch-pad", "#qb-sig-canvas-row");
|
||||
|
||||
var canvas = document.getElementById("qb-sig-sketch-pad");
|
||||
var canvas = document.getElementById("qb-sig-sketch-pad");
|
||||
|
||||
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
var signaturePad = new SignaturePad(canvas, { backgroundColor: "rgba(255, 255, 255, 0)" });
|
||||
|
||||
var cancelButton = document.getElementById("qb-sig-cancel-btn");
|
||||
var saveButton = document.getElementById("qb-sig-save-btn");
|
||||
var clearButton = document.getElementById("qb-sig-clear-canvas-btn");
|
||||
var cancelButton = document.getElementById("qb-sig-cancel-btn");
|
||||
var saveButton = document.getElementById("qb-sig-save-btn");
|
||||
var clearButton = document.getElementById("qb-sig-clear-canvas-btn");
|
||||
|
||||
cancelButton.addEventListener("click", function () {
|
||||
cancelSignature(canSign, signaturePad, "qb-sig-sketch-pad", "report-signature-container", "qb-sig-override-alert");
|
||||
});
|
||||
cancelButton.addEventListener("click",
|
||||
function() {
|
||||
cancelSignature(canSign, signaturePad, "qb-sig-sketch-pad", "report-signature-container", "qb-sig-override-alert");
|
||||
});
|
||||
|
||||
saveButton.addEventListener("click", function () {
|
||||
saveSignature(customerOid, isEmployee, isOverriding, signaturePad, "qb-sig-sketch-pad");
|
||||
});
|
||||
saveButton.addEventListener("click",
|
||||
function() {
|
||||
saveSignature(customerOid, isEmployee, isOverriding, signaturePad, "qb-sig-sketch-pad");
|
||||
});
|
||||
|
||||
clearButton.addEventListener("click", function () {
|
||||
signaturePad.clear();
|
||||
});
|
||||
});
|
||||
clearButton.addEventListener("click",
|
||||
function() {
|
||||
signaturePad.clear();
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -98,20 +108,6 @@
|
||||
<div class="card w-100 mb-3">
|
||||
<div class="card-header" onclick="cardHeaderClick('#chevron-@result.Identifier', '#collapse-result-@result.Identifier')">
|
||||
@{
|
||||
var customerSignatureOidsString = "";
|
||||
|
||||
foreach(var signatureOid in result.CustomerSignatureOids)
|
||||
{
|
||||
customerSignatureOidsString += signatureOid + ",";
|
||||
}
|
||||
|
||||
var employeeSignatureOidsString = "";
|
||||
|
||||
foreach(var employeeSignatureOid in result.EmployeeSignatureOids)
|
||||
{
|
||||
employeeSignatureOidsString += employeeSignatureOid + ",";
|
||||
}
|
||||
|
||||
var employeeSignatureState = result.EmployeeSignatureState;
|
||||
var customerSignatureState = result.CustomerSignatureState;
|
||||
|
||||
@@ -120,65 +116,10 @@
|
||||
|
||||
var employeeName = Model.Employee.ToString();
|
||||
|
||||
//overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature
|
||||
var methodName = "showSignaturePad(" +
|
||||
$"{result.HasCustomerSignature.ToString().ToLower()}, " +
|
||||
$"'{customerSignatureOidsString}', " +
|
||||
$"{canCustomerSign.ToString().ToLower()}, " +
|
||||
$"'#collapse-result-{result.Identifier}', " +
|
||||
$"{result.CustomerOid}, " +
|
||||
$"{result.Items.Count}, " +
|
||||
$"'{result.CustomerName}', " +
|
||||
$"'{Model.ConfirmationReceiptObject.TimeSpanString}', " +
|
||||
"false, " +
|
||||
$"'{employeeName}')";
|
||||
|
||||
//overwrite, signatureOidsString, canSign, cardBodyId, customerOid, numberOfEntries, customerName, timeSpan, isEmployeeSignature
|
||||
var overwrite_ssp = (employeeSignatureState == SignatureState.All).ToString().ToLower();
|
||||
var signatureOidsString_ssp = employeeSignatureOidsString;
|
||||
var canSign_ssp = canEmployeeSign.ToString().ToLower();
|
||||
var cardBodyId_ssp = $"#collapse-result-{result.Identifier}";
|
||||
var numberOfEntries_ssp = result.Items.Count;
|
||||
var customerOid_ssp = result.CustomerOid;
|
||||
var customerName_ssp = result.CustomerName;
|
||||
var timeSpan_ssp = Model.ConfirmationReceiptObject.TimeSpanString;
|
||||
|
||||
|
||||
|
||||
var employeeMethodName = $"showSignaturePad({overwrite_ssp}, '{signatureOidsString_ssp}', {canSign_ssp}, '{cardBodyId_ssp}', {customerOid_ssp}, {numberOfEntries_ssp}, '{customerName_ssp}', '{timeSpan_ssp}', true, '{employeeName}')";
|
||||
|
||||
var employeeBtnColor = "transparent";
|
||||
var customerBtnColor = "transparent";
|
||||
var employeeIcon = "check";
|
||||
var customerIcon = "check";
|
||||
|
||||
switch(employeeSignatureState)
|
||||
{
|
||||
case SignatureState.All:
|
||||
employeeBtnColor = "greenyellow";
|
||||
employeeIcon = "check-double";
|
||||
break;
|
||||
case SignatureState.Some:
|
||||
employeeBtnColor = "yellow";
|
||||
break;
|
||||
case SignatureState.None:
|
||||
employeeBtnColor = "transparent";
|
||||
break;
|
||||
}
|
||||
|
||||
switch(customerSignatureState)
|
||||
{
|
||||
case SignatureState.All:
|
||||
customerBtnColor = "greenyellow";
|
||||
customerIcon = "check-double";
|
||||
break;
|
||||
case SignatureState.Some:
|
||||
customerBtnColor = "yellow";
|
||||
break;
|
||||
case SignatureState.None:
|
||||
customerBtnColor = "transparent";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
@@ -209,12 +150,12 @@
|
||||
<span class="fas fa-trash"></span>
|
||||
</button>
|
||||
}
|
||||
<button class="btn btn-bewo-customers" type="button" onclick="@methodName">
|
||||
<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" style="color: yellow !important"></i>
|
||||
<i class="fas fa-check fa-stack-1x"></i>
|
||||
<i class="fas fa-slash fa-stack-1x text-danger"></i>
|
||||
</span>
|
||||
}
|
||||
@@ -238,7 +179,7 @@
|
||||
@if(employeeSignatureState != SignatureState.All)
|
||||
{
|
||||
<span class="fa-stack align-middle" style="height: auto !important">
|
||||
<i class="fas fa-check fa-stack-1x" style="color: yellow !important"></i>
|
||||
<i class="fas fa-check fa-stack-1x"></i>
|
||||
<i class="fas fa-slash fa-stack-1x text-danger"></i>
|
||||
</span>
|
||||
}
|
||||
|
||||
@@ -385,16 +385,22 @@
|
||||
<div class="modal-body" style="background-color: #F7F7F7 !important">
|
||||
<button type="button" class="btn btn-bewo-customers d-inline">
|
||||
<span class="fas fa-signature"></span>
|
||||
<span class="fas fa-check" style="color: yellow !important"></span>
|
||||
<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>
|
||||
K
|
||||
</button>
|
||||
/
|
||||
<button type="button" class="btn btn-bewo-employee d-inline">
|
||||
<span class="fas fa-signature"></span>
|
||||
<span class="fas fa-check" style="color: yellow !important"></span>
|
||||
<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>
|
||||
M
|
||||
</button>
|
||||
- Nicht alle Zeiterfassungseinträge haben eine Monatsunterschrift; Die Unterschrift wird nicht auf dem Quittierungsbeleg angezeigt.
|
||||
- Es gibt noch keine Monatsunterschrift für alle Zeiterfassungseinträge im ausgewählten Zeitraum; Es wird keine Unterschrift auf dem Quittierungsbeleg angezeigt.
|
||||
<br />
|
||||
<br />
|
||||
|
||||
|
||||
@@ -119,6 +119,13 @@
|
||||
$(document).ready(function() {
|
||||
try {
|
||||
$("textarea").each(function () {
|
||||
var id = this.getAttribute("id");
|
||||
|
||||
// Die textarea des Fehlerpopups soll scrollbar sein!
|
||||
if (id === "fehlerdetail-textarea") {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute("style", "height:" + (this.scrollHeight) + "px;overflow-y:hidden;");
|
||||
}).on("input", function () {
|
||||
this.style.height = 0;
|
||||
@@ -263,6 +270,14 @@
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
|
||||
function getMaxElementHeight(elementClassName) {
|
||||
try {
|
||||
return Math.max.apply(Math, $('.' + elementClassName).map(function () { return $(this).height(); }).get());
|
||||
} catch (error) {
|
||||
showErrorPopup(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -399,6 +414,7 @@
|
||||
<span class="sr-only"></span>
|
||||
</div>
|
||||
</div>
|
||||
<p id="loading-info-p" class="text-white mt-4">Lade ...</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -439,7 +455,7 @@
|
||||
<hr/>
|
||||
<div class="form-group">
|
||||
<label for="fehlerdetail-textarea">Fehlerdetails:</label>
|
||||
<textarea class="form-control font-italic text-monospace" style="height: 20em; max-height: 20em; overflow-y: scroll;" id="fehlerdetail-textarea"></textarea>
|
||||
<textarea class="form-control font-italic text-monospace" style="height: 20em !important; max-height: 20em !important; scroll-behavior: auto !important;" id="fehlerdetail-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
@@ -4305,6 +4305,12 @@ namespace BeWo.Data.Access
|
||||
|
||||
var customerOids = user.Employee.Employee2CustomerList.Where(employee2Customer => employee2Customer.Customer.Oid.HasValue).Select(employee2Customer => employee2Customer.Customer.Oid.Value).Distinct().ToList();
|
||||
|
||||
// Wählt man "Nur Klienten meiner Teams anzeigen", sollen nicht die Hilfepläne der eigenen Klienten angezeigt werden.
|
||||
if(supportConceptFilter == CustomerFilterEnum.TeamCustomer)
|
||||
{
|
||||
customerOids.Clear();
|
||||
}
|
||||
|
||||
// Der ApplicationUser darf die Hilfepläne seiner Teams sehen
|
||||
if(user.CheckForRight(UserRightType.SupportConcept_ViewMyTeams) && (supportConceptFilter == CustomerFilterEnum.TeamCustomer || supportConceptFilter == CustomerFilterEnum.All))
|
||||
{
|
||||
|
||||
@@ -839,6 +839,12 @@ namespace BS.Shared.Core
|
||||
|
||||
if(hasResources)
|
||||
{
|
||||
// ToDo: Hier beachten, ob employeeListOnlyContainsEmployee true ist
|
||||
if(employeeListOnlyContainsEmployee)
|
||||
{
|
||||
return isAllowedToEditResourceAppointments;
|
||||
}
|
||||
|
||||
result = hasEmployees ? isAllowedToEditOtherEmployeesResourceAppointments : isAllowedToEditResourceAppointments;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user