- |
+ |
- {% if abday != False %}
+ {% if abday != False or isfreename != False %}
+ {% if isfreename != False %}
+ {{isfreename}}
+
+ {% for workday in workdays %}
+ {% if workday.start|date:"d-m-y" == da|date:"d-m-y" %}
+
+ {{workday.start|date:"H:i"}} - {{workday.end|date:"H:i"}},
+ {% getsumworkdayexcludebreak workday as sumworkday %}
+ {{ sumworkday }},
+ {% getsumbreak workday as sumbreakofday %}
+ {{sumbreakofday}} min. ({{workday.breaks.all|length}}),
+ {% getsumworkday workday as sumwd %}
+ {{sumwd}},
+ {% gettimeoveralldiff workday user as erg%}
+ {% if erg.1 == 0 %}
+ +{{erg.0}}
+ {% elif erg.1 == 1 %}
+ {{erg.0}}
+ {% else %}
+ -{{erg.0}}
+ {% endif %}
+
+ {% if breakmonthline < da %}
+
+
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+
+ {% else %}
{{abday.reason}}
+ {% endif %}
{% if abday.start == da%}
{% if abday.startday_info == "1" %}
(nur Vormittags)
@@ -110,7 +141,7 @@
- {% elif abday.startday_info == "2" %}
+ {% elif abday.startday_info == "2" %}
(nur Nachmittags)
{% for workday in workdays %}
@@ -207,7 +238,7 @@
{% endif %}
{% endif %}
- {% else %}
+
{% if abday == False %}
{% counterWDreset %}
{% for workday in workdays %}
@@ -231,7 +262,8 @@
{% endif %}
{% endif %}
|
- {% if abday == False %}
+ {% if abday == False and isfreename == False %}
+
{% counterWDreset %}
diff --git a/timemanagement/templates/timemanagement/tm_ab_management.html b/timemanagement/templates/timemanagement/tm_ab_management.html
index b620a0b..11e67f3 100644
--- a/timemanagement/templates/timemanagement/tm_ab_management.html
+++ b/timemanagement/templates/timemanagement/tm_ab_management.html
@@ -639,6 +639,122 @@ function goFastToMonth(month){
location.href = "/tm/abs/" + month +"/" + choosenyear
}
+function recalculateChoosenDays(userid=false){
+ seldates = [];
+
+ //Click on Table
+ if(userid == false){
+
+ for(i = 0; i < selectedElements.length; i++){
+ seldates.push(selectedElements[i].split("_")[3]);
+ userid = selectedElements[i].split("_")[2];
+ }
+ seldates.sort();
+ date_start = new Date(seldates[0])
+ date_end = new Date(seldates[seldates.length-1])
+
+
+ if(+date_start == +date_end){
+ sameday = true;
+ }
+ else{
+ sameday = false;
+ }
+ }
+ //Click on Button
+ else{
+ //Show Modal with all users of agency
+ $("#chooseUserForNewAbsence").modal("toggle");
+
+ //Set initial Date-Infos
+ var today = new Date();
+ var tempdate_user = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
+
+ date_start = new Date(tempdate_user);
+ date_end = new Date(tempdate_user);
+ sameday = true;
+ userid = userid.toString();
+ }
+ $("#div_id_end").show();
+ $("#div_id_end_ishalf").show();
+
+ $("#id_start").data("DateTimePicker").date(date_start);
+ $("#id_end").data("DateTimePicker").date(date_end);
+
+ localStorage.setItem("ab_userid", userid);
+ $("#id_userid").val(userid);
+
+
+ $.ajax({
+ type: "GET",
+ url: "{% url 'tm-ajax' %}",
+ data:{
+ action : "getrestholidays",
+ userid : localStorage.getItem("ab_userid"),
+ startdate : date_start.getFullYear() + "__" + (date_start.getMonth()+1) + "__" + date_start.getDate(),
+ enddate : date_end.getFullYear() + "__" + (date_end.getMonth()+1) + "__" + date_end.getDate(),
+ //start_half : $("#id_start_ishalf").prop("checked"),
+ //end_half : $("#id_end_ishalf").prop("checked"),
+ startday_info : $("#id_startday_info").val(),
+ endday_info : $("#id_endday_info").val(),
+ },
+ success : function(data){
+
+ if(data["other_absences"] != false){
+ $("#otherholidays").show();
+ $("#otherholidays_users").html(data["other_absences"]);
+ }
+ else{
+ $("#otherholidays").hide();
+ }
+
+ if(data["userown_absences"] != false){
+ $("#ownholidays").show();
+ $("#ownholidays_users").html(data["userown_absences"]);
+ }
+ else{
+ $("#ownholidays").hide();
+ }
+
+ $("#startAbsenceProgress").modal("show");
+
+
+ $("#holidayyear").html(date_start.getFullYear());
+ $("#restholidays").html(data["restholiday_thisyear"]);
+ $("#detail_rest").html(data["restholiday_lastyear"]);
+ $("#detail_rest_2").html(data["restholiday_lastyear"]);
+ $("#detail_resthol").html(data["restholiday_lastyear"]);
+ $("#detail_next").html(data["restholiday_nextyear"]);
+ $("#detail_next_rest").html(data["restholiday_nextyear_rest"]);
+ $("#detail_tocontract").html(data["need_days"]);
+ $("#detail_tocontract_overall").html(data["need_days"]);
+
+ $("#detail_sum").html(data["restholiday_thisyear"]+data["restholiday_lastyear"]+data["restholiday_nextyear"]+data["restholiday_nextyear_rest"]);
+
+ if(data["restholiday_thisyear"] < 0 || data["restholiday_lastyear"] < 0 || data["restholiday_nextyear"] < 0){
+ $("#start_absence_contract").prop("disabled", true);
+ }
+ else{
+ $("#start_absence_contract").prop("disabled", false);
+ }
+
+ $("#username_abscence").html(data["choosenuser_name"]);
+
+ /*
+
+ if(seldates.length == 1){
+ $("#div_id_end").hide();
+ $("#div_id_endday_info").hide();
+ }
+ else{
+
+ */
+ $("#div_id_end").show();
+ $("#div_id_endday_info").show();
+ /*}*/
+ }
+ });
+}
|