Zeiterfassungs Update

* Neuer Buchungszeitraum bei den Buchungskategorien ZA Uhrzeit (von/bis)
 * Überprüfungen/Berechungen/Errorhandling ZAs
 * Anpassungen Freigaben nun mit Standartfilter Offen
This commit is contained in:
Spitzer Daniel
2024-03-12 13:30:52 +01:00
parent 6e02b849bd
commit d1a25a23c2
13 changed files with 341 additions and 62 deletions
+28 -2
View File
@@ -190,8 +190,14 @@ $(document).ready(function () {
$(this).prop("required", true);
$(this).prop("min", $('#date').val());
$(this).val($('#date').val());
})
} else if (parseInt($(this).find(':selected').data('hourday')) === 1) {
});
$("#div-calc-overtime").hide();
} else if (parseInt($(this).find(':selected').data('hourday')) === 1 || parseInt($(this).find(':selected').data('hourday')) === 6) {
if (parseInt($(this).find(':selected').data('hourday')) === 6) {
$("#div-calc-overtime").show();
} else {
$("#div-calc-overtime").hide();
}
$("#endtime-div").show();
$("#endtime-div").find('input').each(function () {
$(this).prop("required", true);
@@ -210,6 +216,7 @@ $(document).ready(function () {
$(this).prop("disabled", true);
});
$("#div-calc-overtime").hide();
$("#enddate-div").hide();
$("#enddate-div").find('input').each(function () {
$(this).prop("required", false);
@@ -261,6 +268,25 @@ $(document).ready(function () {
$('#end').prop("min", $('#start').val());
});
$("body").on("change", "#start,#end,#date,#timerecordingCategory_id", function () {
if (parseInt($('#timerecordingCategory_id').find(':selected').data('hourday')) === 6) {
$.post(checkWorkinghoursUrl, {
date: $.trim($('#date').val()),
start: $.trim($('#start').val()),
end: $.trim($('#end').val()),
ajax: 1
}).done(function (data) {
var result = $.parseJSON(data);
if (result.state === "success") {
$('#calc-overtime').html(result.message);
}
if (result.state === "error") {
$('#calc-overtime').html('<div class="text-danger text-bold">' + result.error + '</div>');
}
});
}
});
$("body").on("click", ".edit-button", function () {
$('#submit-button').hide().removeClass('btn-primary').addClass('btn-danger').show();
$('#submit-button').text('Ändern');