Kalender:
- Scheduler/View/SchedulerAppointmentEditForm.xaml:
Ist die Ganztägig-CheckBox angehakt, sind die Uhrzeitfelder deaktiviert
Wird die Ganztägig-CheckBox auf false gesetzt, wird das Ende automatisch auf denselben Tag des vormals ganztägigen Termin gesetzt
-> 20.10.2020 00:00 bis 21.10.2020 00:00 wird zu 20.10.2020 00:30 - 20.10.2020 01:00
Mobilklient:
- Weiterarbeit an der Unterschriftenfunktion für Mitarbeiter im Mobilklienten
This commit is contained in:
@@ -8,9 +8,9 @@ namespace BeWo.Converter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is bool)
|
||||
if (value is bool buhl)
|
||||
{
|
||||
return !(bool) value;
|
||||
return !buhl;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1854,6 +1854,40 @@ namespace BeWo.Core
|
||||
}
|
||||
|
||||
break;
|
||||
case ServiceRecordValidationResult.HasEmployeeSignature:
|
||||
// Prüfen, ob eine Änderung oder Erstellung stattfindet
|
||||
if(dc.ServiceRecordVersion.HasValue)
|
||||
{
|
||||
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.EditAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowEditAfterEmployeeSignature))
|
||||
{
|
||||
MessageBox.Show($"Sie können den Eintrag nicht speichern, da bereits eine Mitarbeiterunterschrift geleistet wurde.", "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
else if(MessageBox.Show($"Es existiert bereits eine Mitarbeiterunterschrift. Möchten Sie trotzdem speichern?", "Speichern nicht möglich", MessageBoxButton.YesNo, MessageBoxImage.Warning).Equals(MessageBoxResult.No))
|
||||
{
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.CreateAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowCreateAfterEmployeeSignature))
|
||||
{
|
||||
MessageBox.Show($"Sie können den Eintrag nicht speichern, da bereits eine Mitarbeiterunterschrift geleistet wurde.", "Speichern nicht möglich", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
else if(MessageBox.Show($"Es existiert bereits eine Mitarbeiterunterschrift.\nMöchten Sie trotzdem speichern?", "Speichern", MessageBoxButton.YesNo, MessageBoxImage.Warning).Equals(MessageBoxResult.No))
|
||||
{
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (exitLoop) break;
|
||||
@@ -1903,6 +1937,20 @@ namespace BeWo.Core
|
||||
exitLoop = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case ServiceRecordValidationResult.HasEmployeeSignature:
|
||||
if(!BeWoApp.LoggedOnUser.HasRight(UserRightType.DeleteAll) && !BeWoApp.LoggedOnUser.HasRight(UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature))
|
||||
{
|
||||
MessageBox.Show($"Sie können den Eintrag nicht löschen, da bereits eine Mitarbeiterunterschrift geleistet wurde.", "Löschen nicht möglich", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
else if(MessageBox.Show($"Es existiert bereits eine Mitarbeiterunterschrift.\nMöchten Sie trotzdem löschen?", "Löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning).Equals(MessageBoxResult.No))
|
||||
{
|
||||
lValid = false;
|
||||
exitLoop = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1912,7 +1960,7 @@ namespace BeWo.Core
|
||||
else
|
||||
{
|
||||
var msg = vm.GroupOid != null
|
||||
? "ACHTUNG, wenn Sie fortfahren, löschen Sie die gesamte Gruppenbuchung.\nWenn Sie nur einzelne Klienten aus der Gruppe entfernen möchten,\neditieren Sie die Gruppe und entfernen den Klienten aus der Liste aller Hilfepläne.\nSind Sie sicher, dass Sie dem gesamten Gruppeneintrag löschen möchten?"
|
||||
? "ACHTUNG, wenn Sie fortfahren, löschen Sie die gesamte Gruppenbuchung.\nWenn Sie nur einzelne Klienten aus der Gruppe entfernen möchten,\neditieren Sie die Gruppe und entfernen den Klienten aus der Liste aller Hilfepläne.\nSind Sie sicher, dass Sie den gesamten Gruppeneintrag löschen möchten?"
|
||||
: "Sind Sie sicher, dass Sie den gewählten Eintrag löschen möchten?";
|
||||
|
||||
if (MessageBox.Show(msg, "Eintrag löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning) !=
|
||||
|
||||
@@ -292,14 +292,14 @@
|
||||
<!-- Region Start -->
|
||||
<Label x:Name="StartLabel" Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Content="Start"/>
|
||||
<dxe:DateEdit Grid.Column="1" Grid.Row="2" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding Controller.DisplayStartDate}" x:Name="StartDate"/>
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="2" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayStartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" x:Name="StartTime"/>
|
||||
<dxe:CheckEdit x:Name="AllDay" Grid.Column="3" Grid.Row="2" Content="Ganztägig" EditValue ="{Binding Controller.AllDay}" HorizontalAlignment="Right" Margin="3" />
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="2" IsEnabled="{Binding Path=Controller.AllDay, Converter={StaticResource BoolReverseConverter}}" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayStartTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" x:Name="StartTime"/>
|
||||
<dxe:CheckEdit x:Name="AllDay" Grid.Column="3" Grid.Row="2" Content="Ganztägig" Checked="AllDay_OnCheckedChange" Unchecked="AllDay_OnCheckedChange" EditValue ="{Binding Controller.AllDay}" HorizontalAlignment="Right" Margin="3" />
|
||||
<!-- Endregion -->
|
||||
|
||||
<!-- Region Ende -->
|
||||
<Label x:Name="EndLabel" Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Content="Ende"/>
|
||||
<dxe:DateEdit Grid.Column="1" Grid.Row="3" MaskType="DateTimeAdvancingCaret" Background="White" Height="23" MinWidth="80" Margin="3" EditValue="{Binding Controller.DisplayEndDate}" x:Name="EndDate"/>
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="3" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayEndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" x:Name="EndTime"/>
|
||||
<dxe:TextEdit Grid.Column="2" Grid.Row="3" IsEnabled="{Binding Path=Controller.AllDay, Converter={StaticResource BoolReverseConverter}}" MaskType="DateTime" Mask="t" MaskUseAsDisplayFormat="True" Margin="3" Height="23" EditValue ="{Binding Controller.DisplayEndTime, Converter={StaticResource TimeSpanToDateTimeConverter}}" x:Name="EndTime"/>
|
||||
<!-- Endregion -->
|
||||
|
||||
<!-- Region Zu erledigen bis -->
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace BeWo.Scheduler.View
|
||||
|
||||
private void InitRights()
|
||||
{
|
||||
var darfKlientermineAnsehen = BeWoUtils.HasRight(UserRightType.CustomerView_View);
|
||||
var darfKlientenAnsehen = BeWoUtils.HasRight(UserRightType.CustomerView_View);
|
||||
var darfKliententermineAnlegen = BeWoUtils.HasRight(UserRightType.KalenderKliententermineAnlegen);
|
||||
var darfKliententermineAendern = BeWoUtils.HasRight(UserRightType.KalenderKliententermineAendern);
|
||||
|
||||
@@ -202,13 +202,17 @@ namespace BeWo.Scheduler.View
|
||||
var darfRessourcentermineAnlegen = BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAnlegen);
|
||||
var darfRessourcentermineAendern = BeWoUtils.HasRight(UserRightType.KalenderRessourcentermineAendern);
|
||||
|
||||
var darfAllesAnsehen = BeWoUtils.HasRight(UserRightType.ViewAll);
|
||||
var darfAllesAendern = BeWoUtils.HasRight(UserRightType.EditAll);
|
||||
var darfAllesLoeschen = BeWoUtils.HasRight(UserRightType.DeleteAll);
|
||||
|
||||
if(IsNew && !darfKliententermineAnlegen)
|
||||
{
|
||||
KlientenPopUpOeffnenBtn.Visibility = Visibility.Hidden;
|
||||
SelectedCustomers.Clear();
|
||||
}
|
||||
|
||||
if(!IsNew && (!darfKliententermineAendern || !darfKlientermineAnsehen) || !darfKlientermineAnsehen)
|
||||
if(!IsNew && (!darfKliententermineAendern || !darfKlientenAnsehen) || !darfKlientenAnsehen)
|
||||
{
|
||||
KlientenPopUpOeffnenBtn.Visibility = Visibility.Hidden;
|
||||
}
|
||||
@@ -636,7 +640,46 @@ namespace BeWo.Scheduler.View
|
||||
OnPropertyChanged(nameof(CountSelectedSupportConcepts));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool _HasBeenUnchecked;
|
||||
|
||||
private void AllDay_OnCheckedChange(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var source = (CheckEdit) e.Source;
|
||||
var value = source.IsChecked ?? false;
|
||||
|
||||
if(value == false && _HasBeenUnchecked == false)
|
||||
{
|
||||
var displayStart = NewSchedulerAppointmentFormController.DisplayStart;
|
||||
var start = NewSchedulerAppointmentFormController.Start;
|
||||
var end = NewSchedulerAppointmentFormController.End;
|
||||
|
||||
if(!end.Equals(start))
|
||||
{
|
||||
_HasBeenUnchecked = true;
|
||||
|
||||
var day = displayStart.Day;
|
||||
var month = displayStart.Month;
|
||||
var year = displayStart.Year;
|
||||
|
||||
var newEndDay = (end.AddDays(-1) >= start ? end.AddDays(-1) : start).Day;
|
||||
|
||||
var newStart = new DateTime(year, month, day, 0, 0, 0);
|
||||
var newEnd = new DateTime(year, month, newEndDay, 1, 0, 0);
|
||||
|
||||
NewSchedulerAppointmentFormController.Start = newStart;
|
||||
NewSchedulerAppointmentFormController.End = newEnd;
|
||||
|
||||
NewSchedulerAppointmentFormController.DisplayStart = newStart;
|
||||
NewSchedulerAppointmentFormController.DisplayEnd = newEnd;
|
||||
|
||||
NewSchedulerAppointmentFormController.DisplayStartTime = new TimeSpan(0, 0, 0, 0);
|
||||
NewSchedulerAppointmentFormController.DisplayEndTime = new TimeSpan(0, 1, 0, 0);
|
||||
_HasBeenUnchecked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class NewSchedulerAppointmentFormController : AppointmentFormController
|
||||
{
|
||||
|
||||
@@ -1741,11 +1741,26 @@ namespace BeWoPlanerMobil.Controllers
|
||||
var allowMoreFLSThanApproved = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreateMoreFLSThanApproved);
|
||||
var bookAfterSettlementInvoice = MobileSessionFacade.CheckForUserRight(UserRightType.BookServiceRecordAfterSettlementInvoice);
|
||||
var bookServiceRecordOutOfSupportConcept = MobileSessionFacade.CheckForUserRight(UserRightType.BookServiceRecordOutOfSupportConcept);
|
||||
var allowCreateAfterEmployeeSignature = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowCreateAfterEmployeeSignature);
|
||||
var allowEditAfterEmployeeSignature = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowEditAfterEmployeeSignature);
|
||||
var allowDeleteAfterEmployeeSignature = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature);
|
||||
|
||||
var allowCreateAll = MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
|
||||
var allowEditAll = MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
|
||||
var allowDeleteAll = MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
|
||||
|
||||
// TODO: Prüfen, ob Stunden übertragbar sind. Wenn nicht, prüfen, ob nach Ausreizung des FLS-Zeitraums die Anzahl der FLS pro Zeitraum überschritten werden darf!
|
||||
|
||||
var newResult = new ValidationResult();
|
||||
var exitLoop = false;
|
||||
|
||||
|
||||
if(Model.SelectedSupportConcept != null && Model.SelectedSupportConcept.Goals.Any() && Model.SelectedGoals.Count == 0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach (var sr2V in validationResults)
|
||||
{
|
||||
if(exitLoop)
|
||||
@@ -1847,6 +1862,39 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
exitLoop = true;
|
||||
newResult.KannTrotzdemGespeichertWerden = false;
|
||||
break;
|
||||
case HasEmployeeSignature:
|
||||
if(checkServiceRecord.ServiceRecordOid.HasValue)
|
||||
{
|
||||
if(!allowEditAll && !allowEditAfterEmployeeSignature)
|
||||
{
|
||||
newResult.Message += "Sie können den Eintrag nicht speichern, da bereits eine Mitarbeiterunterschrift geleistet wurde.<br/><br/>";
|
||||
exitLoop = true;
|
||||
newResult.KannTrotzdemGespeichertWerden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
newResult.Message += "Es existiert bereits eine Mitarbeiterunterschrift. Möchten Sie trotzdem speichern?<br/><br/>";
|
||||
exitLoop = false;
|
||||
newResult.KannTrotzdemGespeichertWerden = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!allowCreateAll && !allowCreateAfterEmployeeSignature)
|
||||
{
|
||||
newResult.Message += "Sie können den Eintrag nicht speichern, da bereits eine Mitarbeiterunterschrift geleistet wurde.<br/><br/>";
|
||||
exitLoop = true;
|
||||
newResult.KannTrotzdemGespeichertWerden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
newResult.Message += "Es existiert bereits eine Mitarbeiterunterschrift. Möchten Sie trotzdem speichern?<br/><br/>";
|
||||
exitLoop = false;
|
||||
newResult.KannTrotzdemGespeichertWerden = true;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1862,6 +1910,74 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return SerializeObject(newResult);
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public string ValidateServiceRecordDeletion(string serviceRecordOidString)
|
||||
{
|
||||
if(Model == null)
|
||||
{
|
||||
Logout();
|
||||
return _LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
var isSuccessful = long.TryParse(serviceRecordOidString, out var serviceRecordOid);
|
||||
|
||||
if(!isSuccessful)
|
||||
{
|
||||
return "Error";
|
||||
}
|
||||
|
||||
var newResult = new ValidationResult();
|
||||
|
||||
var serviceRecord = OperationsService.GetServiceRecordById(serviceRecordOid);
|
||||
|
||||
var allowDeleteAfterEmployeeSignature = MobileSessionFacade.CheckForUserRight(UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature);
|
||||
|
||||
var allowDeleteAll = MobileSessionFacade.CheckForUserRight(UserRightType.CreateAll);
|
||||
|
||||
var validationResultList = OperationsService.ValidateServiceRecordDeletion(serviceRecord, Model.Employee.EmployeeOid.Value);
|
||||
|
||||
if(validationResultList.Count > 0)
|
||||
{
|
||||
var exitLoop = false;
|
||||
|
||||
foreach(var result in validationResultList)
|
||||
{
|
||||
switch(result.ResultType)
|
||||
{
|
||||
case Custom:
|
||||
newResult.KannTrotzdemGespeichertWerden = true;
|
||||
newResult.Message += "Dieser Eintrag wurde bereits unterschrieben.<br/>Möchten Sie ihn trotzdem löschen?<br/><br/>";
|
||||
break;
|
||||
case HasEmployeeSignature:
|
||||
if(!allowDeleteAll && !allowDeleteAfterEmployeeSignature)
|
||||
{
|
||||
exitLoop = true;
|
||||
newResult.KannTrotzdemGespeichertWerden = false;
|
||||
newResult.Message += "Sie können den Eintrag nicht löschen, da bereits eine Mitarbeiterunterschrift geleistet wurde.<br/><br/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
newResult.KannTrotzdemGespeichertWerden = true;
|
||||
newResult.Message += "Es existiert bereits eine Mitarbeiterunterschrift.<br/>Möchten Sie ihn trotzdem löschen?<br/><br/>";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(exitLoop)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return SerializeObject(newResult);
|
||||
}
|
||||
|
||||
return serviceRecord.GroupOid != null ?
|
||||
"ACHTUNG, wenn Sie fortfahren, löschen Sie die gesamte Gruppenbuchung.<br/>Wenn Sie nur einzelne Klienten aus der Gruppe entfernen möchten, editieren Sie die Gruppe und entfernen den Klienten aus der Liste der Hilfepläne.<br/>Sind Sie sicher, dass Sie den gesamten Gruppeneintrag löschen möchten?<br/><br/>" :
|
||||
_LeerzeichenFuerGetMethoden;
|
||||
}
|
||||
|
||||
public string SetServiceRecordEmployee(long employeeOid)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Razor.Parser.SyntaxTree;
|
||||
|
||||
using BeWo.Report.ReportObjects;
|
||||
using BeWoPlanerMobil.Models;
|
||||
using BeWoPlanerMobil.Service;
|
||||
using BeWoPlanerMobil.Util;
|
||||
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.Extensions;
|
||||
@@ -17,9 +18,8 @@ namespace BeWoPlanerMobil.Controllers
|
||||
* Mit Unterschriftenfunktion für den Mitarbeiter.
|
||||
* Liste mit allen ServiceRecords des Mitarbeiters für einen Klienten.
|
||||
*
|
||||
* TODO: Warnung anzeigen, dass man die betroffenen Einträge nicht mehr ändern kann.
|
||||
*
|
||||
* TODO: Unterschrift zu hinzufügen
|
||||
* TODO: Beim Speichern von ServiceRecords prüfen, ob es schon eine Mitarbeiterunterschrift für Quittierungsbelege gibt
|
||||
* TODO: Unterschrift in Quittierungsbeleg einbauen
|
||||
*/
|
||||
|
||||
public class ReportController : AbstractBaseController
|
||||
@@ -58,18 +58,14 @@ namespace BeWoPlanerMobil.Controllers
|
||||
return Logout();
|
||||
}
|
||||
|
||||
if(!AbstractModel.IsAllowedToSeeBills)
|
||||
{
|
||||
return RedirectToActionPermanent("Main", "Main");
|
||||
}
|
||||
|
||||
var customers = EmployeeService.GetActiveCompactCustomersForEmployee(null);
|
||||
|
||||
Model.Customers = customers;
|
||||
|
||||
var kek = new ConfirmationReceiptSignatureDC();
|
||||
|
||||
OperationsService.InsertConfirmationReceiptSignature(kek);
|
||||
|
||||
var alle = OperationsService.GetAllConfirmationReceiptSignatures();
|
||||
|
||||
|
||||
var test = OperationsService.GetConfirmationReceiptSignaturesByEmployee(1, new DateTimeSpan(new DateTime(2020, 1, 1), new DateTime(2020, 2, 1)));
|
||||
Model.Customers = customers.OrderBy(d => d.ToString()).ToList();
|
||||
|
||||
return View(Model);
|
||||
}
|
||||
@@ -134,7 +130,7 @@ namespace BeWoPlanerMobil.Controllers
|
||||
|
||||
[Authorize]
|
||||
[HttpPost]
|
||||
public string CreateEmployeeSignatureForServiceOverview(string base64SignatureString, string date)
|
||||
public string CreateEmployeeSignatureForServiceOverview(string base64SignatureString)
|
||||
{
|
||||
if(Model == null)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace BeWoPlanerMobil.Models
|
||||
{
|
||||
var result = new List<SelectListItem>();
|
||||
|
||||
for(var i = DateTime.Today.Year + 1; i > DateTime.Today.Year - 11; i--)
|
||||
for(var i = DateTime.Today.Year; i > DateTime.Today.Year - 11; i--)
|
||||
{
|
||||
result.Add(new SelectListItem
|
||||
{
|
||||
|
||||
@@ -92,9 +92,11 @@ function isInArray(value, array) {
|
||||
|
||||
function showMessagePopupWithHtml(title, html) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
if(message !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
|
||||
$("#popupMessage").html(html);
|
||||
|
||||
$("#messagePopup").modal(
|
||||
@@ -153,3 +155,53 @@ function cloneCanvas(oldCanvas) {
|
||||
|
||||
return newCanvas;
|
||||
}
|
||||
|
||||
function showAlertMessageBox(title, message, callback, executeCallbackByBothButtons) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">' + message + "</div>");
|
||||
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function() {
|
||||
callback();
|
||||
});
|
||||
|
||||
if(executeCallbackByBothButtons === true) {
|
||||
$("#message-popup-close-btn").on("click", function() {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
backdrop: "static",
|
||||
keyboard: false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function showWarningMessageBox(title, message, callback, executeCallbackByBothButtons) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
$("#messagePopup .modal-body").html('<div class="alert alert-warning" role="alert">' + message + "</div>");
|
||||
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function() {
|
||||
callback();
|
||||
});
|
||||
|
||||
if(executeCallbackByBothButtons === true) {
|
||||
$("#message-popup-close-btn").on("click", function() {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
backdrop: "static",
|
||||
keyboard: false
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -31,7 +31,6 @@ function resizeCanvas(sketchPadId, canvasRoId) {
|
||||
}
|
||||
|
||||
if(isMinDifferenceMet) {
|
||||
console.log("changing canvas size");
|
||||
var sourceCanvas = document.getElementById(sketchPadId.split("#")[1]);
|
||||
var canvasContext = sourceCanvas.getContext("2d");
|
||||
var imageData = sourceCanvas.toDataURL("image/png");
|
||||
|
||||
@@ -303,17 +303,56 @@ function activateGroupBookingForm() {
|
||||
$("#employees-button, #category-select, #leistung-select, #start-date, #end-date, #start-time, #end-time, #duration, #distance, textarea, #reset-button, #create-button, #textbausteine-button").prop("disabled", false);
|
||||
}
|
||||
|
||||
// TODO: Validierung wie im Fat-Client einbauen
|
||||
function deleteServiceRecord(serviceRecordOid) {
|
||||
|
||||
showMessagePopupWithCallback("Eintrag löschen", "Sind Sie sicher, dass Sie den Eintrag löschen möchten?",
|
||||
function() {
|
||||
var form = $("#deletion-form");
|
||||
var url = getValidateServiceRecordDeletionUrl();
|
||||
|
||||
if (form.length !== 0) {
|
||||
$("#oidHolder").val(serviceRecordOid);
|
||||
$.get(url, { serviceRecordOidString: serviceRecordOid }).done(function(result) {
|
||||
if (result === "Error") {
|
||||
// TODO: Fehlermeldung anzeigen
|
||||
showAlertMessageBox("Fehler", "Es ist ein Fehler aufgetreten", null, false);
|
||||
return;
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
form.submit();
|
||||
}
|
||||
var form = $("#deletion-form");
|
||||
|
||||
if(result.length === 0) {
|
||||
if(form.length !== 0) {
|
||||
$("#oidHolder").val(serviceRecordOid);
|
||||
|
||||
showSpinner();
|
||||
form.submit();
|
||||
}
|
||||
} else { // Meldungen
|
||||
hideSpinner();
|
||||
var validationResult = $.parseJSON(result);
|
||||
|
||||
if(validationResult.Message === null) {
|
||||
showSpinner();
|
||||
form.submit();
|
||||
return;
|
||||
}
|
||||
|
||||
var kannTrotzdemGespeichertWerden = message.KannTrotzdemGespeichertWerden;
|
||||
|
||||
var validationCallback = function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
if(kannTrotzdemGespeichertWerden) {
|
||||
showSpinner();
|
||||
form.submit();
|
||||
}
|
||||
};
|
||||
|
||||
if(kannTrotzdemGespeichertWerden) {
|
||||
showWarningMessageBox("Fehler", message.Message, validationCallback, false);
|
||||
} else {
|
||||
showAlertMessageBox("Fehler", message.Message, validationCallback, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
|
||||
@@ -362,11 +401,14 @@ function validateForm(form) {
|
||||
|
||||
if(isValid === false) {
|
||||
hideSpinner();
|
||||
$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">' + errorMessage + "</div>");
|
||||
|
||||
showMessagePopupWithCallback("Fehler", null, function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
}, true);
|
||||
showAlertMessageBox("Fehler",
|
||||
errorMessage,
|
||||
function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
},
|
||||
true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -384,17 +426,19 @@ function validateForm(form) {
|
||||
|
||||
var kannTrotzdemGespeichertWerden = message.KannTrotzdemGespeichertWerden;
|
||||
|
||||
var background = kannTrotzdemGespeichertWerden ? "alert-warning" : "alert-danger";
|
||||
|
||||
$("#messagePopup .modal-body").html('<div class="alert ' + background + '" role="alert">' + message.Message + "</div>");
|
||||
|
||||
showMessagePopupWithCallback("Fehler", null, function() {
|
||||
var testCallback = function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
if(kannTrotzdemGespeichertWerden) {
|
||||
showSpinner();
|
||||
form.submit();
|
||||
}
|
||||
}, false);
|
||||
};
|
||||
|
||||
if (kannTrotzdemGespeichertWerden) {
|
||||
showWarningMessageBox("Fehler", message.Message, testCallback, false);
|
||||
} else {
|
||||
showAlertMessageBox("Fehler", message.Message, testCallback, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,8 +28,27 @@
|
||||
|
||||
var dataUrl = clonedCanvas.toDataURL("image/png");
|
||||
|
||||
var date = moment(new Date());
|
||||
var formattedDate = date.format("DD.MM.YYYY HH:mm:ss");
|
||||
showMessagePopupWithCallback("Unterschrift speichern", "Mit dem Speichern der Unterschrift ist es nicht mehr möglich, die betroffenen Einträge der Zeiterfassung zu ändern.", function() {
|
||||
showSpinner();
|
||||
|
||||
var url = getCreateEmployeeSignatureForServiceOverviewUrl();
|
||||
|
||||
$.post(url, { base64SignatureString: dataUrl}).done(function(json) {
|
||||
hideSpinner();
|
||||
|
||||
if(isEmptyOrSpaces(json)) {
|
||||
$("#signature-container").removeClass("d-block");
|
||||
$("#main-container, #checkbox-container").show();
|
||||
showMessagePopupWithCallback("Unterschrift", "Die Unterschrift wurde erfolgreich gespeichert.", function() {
|
||||
showSpinner();
|
||||
location.reload();
|
||||
}, true);
|
||||
} else {
|
||||
showMessagePopup("Fehler", json);
|
||||
signaturePad.clear();
|
||||
}
|
||||
});
|
||||
}, false);
|
||||
});
|
||||
|
||||
clearButton.addEventListener("click", function(event) {
|
||||
|
||||
@@ -252,6 +252,10 @@
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getValidateServiceRecordDeletionUrl() {
|
||||
return "@Url.Action("ValidateServiceRecordDeletion")";
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container mt-3" id="checkbox-container">
|
||||
|
||||
@@ -4,15 +4,11 @@
|
||||
ViewBag.Title = "Quittierungsbeleg";
|
||||
}
|
||||
|
||||
<!-- Klient, Monat, Jahr
|
||||
|
||||
Liste:
|
||||
Info:
|
||||
Name Klient, Vorname Klient, Aktenzeichen, Bewilligte FLS wöchentlich:
|
||||
|
||||
Datum, Uhrzeit, Anzahl Minuten, Gruppe, Mitarbeiter
|
||||
|
||||
-->
|
||||
<script>
|
||||
function getCreateEmployeeSignatureForServiceOverviewUrl() {
|
||||
return "@Url.Action("CreateEmployeeSignatureForServiceOverview")";
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container-fluid my-3" id="report-form-container">
|
||||
<div class="row">
|
||||
@@ -57,7 +53,7 @@ Info:
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col col-12 col-md-6 col-lg-5">
|
||||
<div class="col col-12 col-md-6 col-lg-7">
|
||||
<div class="mt-3">
|
||||
@if(TempData["HasWarningMessage"] != null)
|
||||
{
|
||||
|
||||
@@ -3128,6 +3128,14 @@ namespace BeWo.Data.Access
|
||||
|
||||
private static AbstractCriterion CreateBetweenDateTimesCriterion(DateTime start, DateTime end, string propertyNameStart, string propertyNameEnd)
|
||||
{
|
||||
/*
|
||||
* Sql für Spalten namens 'StartDate' und 'EndDate':
|
||||
* WHERE
|
||||
* ((start >= StartDate AND end <= StartDate) OR (start <= StartDate AND end >= EndDate))
|
||||
* OR
|
||||
* ((start <= StartDate AND start >= EndDate) OR (start >= StartDate AND end <= EndDate))
|
||||
*/
|
||||
|
||||
var inBetween1 = Restrictions.And(Restrictions.Ge(propertyNameStart, start), Restrictions.Le(propertyNameStart, end));
|
||||
var inBetween2 = Restrictions.And(Restrictions.Le(propertyNameStart, start), Restrictions.Ge(propertyNameEnd, end));
|
||||
var inBetween3 = Restrictions.And(Restrictions.Le(propertyNameStart, start), Restrictions.Ge(propertyNameEnd, start));
|
||||
@@ -3446,10 +3454,11 @@ namespace BeWo.Data.Access
|
||||
|
||||
public List<ConfirmationReceiptSignature> GetConfirmationReceiptSignaturesByServiceRecord(long serviceRecordOid)
|
||||
{
|
||||
var detachedCriteria = DetachedCriteria.For<ServiceRecord>()
|
||||
.Add(Subqueries.PropertyIn(nameof(ServiceRecord.Oid), DetachedCriteria.For<ServiceRecord>().SetProjection(Projections.Property(nameof(ServiceRecord.Oid)))));
|
||||
var criteria = CreateCriteria<ConfirmationReceiptSignature>()
|
||||
.CreateAlias(nameof(ConfirmationReceiptSignature.ServiceRecords), "serviceRecord")
|
||||
.Add(Restrictions.Eq("serviceRecord.Oid", serviceRecordOid));
|
||||
|
||||
return null;
|
||||
return criteria.List<ConfirmationReceiptSignature>().ToList();
|
||||
}
|
||||
|
||||
public IList<ServiceRecord> FindEmployeeServiceRecordsForKilometerauswertung(long employeeOid, DateTimeSpan timeSpan)
|
||||
@@ -3570,5 +3579,22 @@ namespace BeWo.Data.Access
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool HasEmployeeSignatureForCustomerInTimeSpan(long customerOid, DateTimeSpan timeSpan)
|
||||
{
|
||||
var startString = timeSpan.StartDate.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
var endString = timeSpan.EndDate.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
var sql = $" this_.Oid IN (SELECT ConfirmationReceiptSignatureOid FROM ConfirmationReceiptSignature2ServiceRecord WHERE ServiceRecordOid IN (SELECT Oid FROM ServiceRecord WHERE CustomerOid = {customerOid} AND ((('{startString}' >= StartDate AND '{endString}' <= StartDate) OR ('{startString}' <= StartDate AND '{endString}' >= EndDate)) OR (('{startString}' <= StartDate AND '{startString}' >= EndDate) OR ('{startString}' >= StartDate AND '{endString}' <= EndDate)))))";
|
||||
|
||||
var c = CreateCriteria<ConfirmationReceiptSignature>().Add(Expression.Sql(sql)).List<ConfirmationReceiptSignature>().Any();
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public bool HasEmployeeSignaturesForServiceRecord(long serviceRecordOid)
|
||||
{
|
||||
return GetConfirmationReceiptSignaturesByServiceRecord(serviceRecordOid).Any();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<property name="UdpUser" />
|
||||
<property name="IsActive" type="BS.Shared.ActivationTypeId, BS.Shared" />
|
||||
<property name="SystemEntryID" type="BS.Shared.SystemEntryID, BS.Shared" />
|
||||
<property name="Notice" />
|
||||
<property name="Notice" />
|
||||
<property name="SignatureImage" column="SignatureImage" />
|
||||
<property name="EmployeeOid" />
|
||||
|
||||
<bag name="ServiceRecords" table="ConfirmationReceiptSignature2ServiceRecord" generic="true" cascade="none" batch-size="250">
|
||||
<bag name="ServiceRecords" table="confirmationreceiptsignature2servicerecord" generic="true" cascade="all-delete-orphan" batch-size="250">
|
||||
<key column="ConfirmationReceiptSignatureOid" />
|
||||
<many-to-many column="ServiceRecordOid" class="BeWo.Data.Entities.ServiceRecord, BeWo.Data" />
|
||||
</bag>
|
||||
|
||||
@@ -15,11 +15,12 @@ CREATE TABLE `confirmationreceiptsignature` (
|
||||
CONSTRAINT `FK_CONFIRMATIONRECEIPTSIGNATURE2EMPLOYEE` FOREIGN KEY (`EmployeeOid`) REFERENCES `Employee` (`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
CREATE TABLE `confirmationsignature2servicerecord` (
|
||||
`ConfirmationSignatureOid` bigint(19) DEFAULT NULL,
|
||||
CREATE TABLE `confirmationreceiptsignature2servicerecord` (
|
||||
`ConfirmationReceiptSignatureOid` bigint(19) DEFAULT NULL,
|
||||
`ServiceRecordOid` bigint(19) DEFAULT NULL,
|
||||
KEY `CONFSIG2SERVREC_CONFSIG_FK` (`ConfirmationSignatureOid`),
|
||||
CONSTRAINT `FK_CONFSIG2SERVREC_CONFSIG` FOREIGN KEY (`ConfirmationSignatureOid`) REFERENCES `confirmationreceiptsignature` (`Oid`),
|
||||
KEY `CONFSIG2SERVREC_CONFSIG_FK` (`ConfirmationReceiptSignatureOid`),
|
||||
CONSTRAINT `FK_CONFSIG2SERVREC_CONFSIG` FOREIGN KEY (`ConfirmationReceiptSignatureOid`) REFERENCES `confirmationreceiptsignature` (`Oid`),
|
||||
KEY `CONFSIG2SERVREC_SERVREC_FK` (`ServiceRecordOid`),
|
||||
CONSTRAINT `FK_CONFSIG2SERVREC_SERVREC` FOREIGN KEY (`ServiceRecordOid`) REFERENCES `servicerecord` (`Oid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
@@ -448,7 +448,22 @@ namespace BeWo.Service.Plugins
|
||||
if (resultdc != null)
|
||||
result.Add(resultdc);
|
||||
|
||||
}
|
||||
// 9. Mitarbeiterunterschrift aus dem Mobilklienten prüfen
|
||||
// Für alle Customers, falls Gruppenbuchung
|
||||
//var customer = reldc.SupportConcept.Customer;
|
||||
//if(customer != null)
|
||||
//{
|
||||
// var s = newServiceRecord.Start.Value.GetFirstOfMonth();
|
||||
// var e = s.AddMonths(1).AddDays(-1).MergeDatesByDate(new DateTime(2020, 1, 1, 23, 59, 59));
|
||||
|
||||
// var hasEmployeeSignature = DAOFactory.SearchDAO.HasEmployeeSignatureForCustomerInTimeSpan(customer.CustomerOid, new DateTimeSpan(s, e));
|
||||
|
||||
// if(hasEmployeeSignature)
|
||||
// {
|
||||
// result.Add(new ServiceRecordValidationResultDC {ResultType = ServiceRecordValidationResult.HasEmployeeSignature});
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1002,6 +1017,20 @@ namespace BeWo.Service.Plugins
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Prüfe, ob eine Mitarbeiterunterschrift mit diesem Eintrag verknüpft ist
|
||||
//if(serviceRecord.ServiceRecordOid.HasValue)
|
||||
//{
|
||||
// var hasEmployeeSignature = DAOFactory.SearchDAO.HasEmployeeSignaturesForServiceRecord(serviceRecord.ServiceRecordOid.Value);
|
||||
|
||||
// if(hasEmployeeSignature)
|
||||
// {
|
||||
// result.Add(new ServiceRecordValidationResultDC
|
||||
// {
|
||||
// ResultType = ServiceRecordValidationResult.HasEmployeeSignature
|
||||
// });
|
||||
// }
|
||||
//}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +319,22 @@ namespace BeWo.Service.ServiceImplementations
|
||||
if (srListToDelete.Count > 0)
|
||||
{
|
||||
MakeServiceRecordHistoryEntry(srListToDelete, null, StatementType.Delete);
|
||||
|
||||
// ConfirmationReceiptSignatures mit den zu löschenden ServiceRecords suchen und die ServiceRecords aus der Liste entfernen
|
||||
foreach(var item in lOriginals)
|
||||
{
|
||||
if(item.Oid.HasValue)
|
||||
{
|
||||
var confirmationReceiptSignatures = DAOFactory.SearchDAO.GetConfirmationReceiptSignaturesByServiceRecord(item.Oid.Value);
|
||||
|
||||
foreach(var confirmationReceiptSignature in confirmationReceiptSignatures)
|
||||
{
|
||||
confirmationReceiptSignature.ServiceRecords.Remove(item);
|
||||
DAOFactory.GenericDAO.Update(confirmationReceiptSignature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DAOFactory.GenericDAO.Delete(srListToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,7 +518,11 @@ namespace BS.Shared
|
||||
Person_Full_Delete = 171719,
|
||||
Employee_Full_Delete = 171720,
|
||||
Employee_Anonymization = 171721,
|
||||
Termine_IntervalDelete = 171722
|
||||
Termine_IntervalDelete = 171722,
|
||||
|
||||
ServiceRecord_AllowCreateAfterEmployeeSignature = 171723,
|
||||
ServiceRecord_AllowEditAfterEmployeeSignature = 171724,
|
||||
ServiceRecord_AllowDeleteAfterEmployeeSignature = 171725
|
||||
}
|
||||
|
||||
public enum PersonType
|
||||
@@ -789,7 +793,8 @@ namespace BS.Shared
|
||||
Error = 5,
|
||||
SettlementInvoiceAlreadyExisting = 6,
|
||||
FristAbgelaufen = 7,
|
||||
Custom = 8
|
||||
Custom = 8,
|
||||
HasEmployeeSignature = 9
|
||||
}
|
||||
|
||||
public enum ViewDestination
|
||||
|
||||
@@ -631,8 +631,16 @@ namespace BS.Shared.Core
|
||||
,
|
||||
{
|
||||
UserRightType.Termine_IntervalDelete, Translator.Translate("Termine bis zum angegebenen Zeitpunkt löschen")
|
||||
},
|
||||
{
|
||||
UserRightType.ServiceRecord_AllowCreateAfterEmployeeSignature, Translator.Translate("Zeiterfassung anlegen nach Mitarbeiterunterschrift für Quittierungsbeleg")
|
||||
},
|
||||
{
|
||||
UserRightType.ServiceRecord_AllowEditAfterEmployeeSignature, Translator.Translate("Zeiterfassung bearbeiten nach Mitarbeiterunterschrift für Quittierungsbeleg")
|
||||
},
|
||||
{
|
||||
UserRightType.ServiceRecord_AllowDeleteAfterEmployeeSignature, Translator.Translate("Zeiterfassung löschen nach Mitarbeiterunterschrift für Quittierungsbeleg")
|
||||
}
|
||||
|
||||
};
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user