diff --git a/adm/templates/adm/adm_user_single.html b/adm/templates/adm/adm_user_single.html index 692dcb9..59f2ab9 100644 --- a/adm/templates/adm/adm_user_single.html +++ b/adm/templates/adm/adm_user_single.html @@ -129,8 +129,8 @@ Beginn der Zeiterfassung: {{usertimedata.startdate|date:"d.m.Y"}} Art Start Ende - Halbstart - Halbende + Ganz/Vor/Na + Ganz/Vor/Na Erstellt am Status Urlaub N @@ -146,8 +146,8 @@ Beginn der Zeiterfassung: {{usertimedata.startdate|date:"d.m.Y"}} {{ab.reason.name}} {{ab.start|date:"d.m.Y"}} {{ab.end|date:"d.m.Y"}} - {{ab.start_ishalf}} - {{ab.end_ishalf}} + {% if ab.startday_info == "1" %} Vormittags {% elif ab.startday_info == "2" %} Nachmittags {% else %} Ganzer Tag {% endif %} + {% if ab.endday_info == "1" %} Vormittags {% elif ab.endday_info == "2" %} Nachmittags {% else %} Ganzer Tag {% endif %} {{ab.created_date|date:"d.m.Y"}} {% if ab.confirm_status == 0 %} OK {% elif ab.confirm_status == 1 %} Beantragt {% else %} Abgelehnt {% endif %} {{ab.holidays_normal}} diff --git a/adm/views.py b/adm/views.py index e459bae..507dfe8 100644 --- a/adm/views.py +++ b/adm/views.py @@ -250,8 +250,18 @@ class AdmAddBill(CreateView): r = requests.get("https://api.lexoffice.io/v1/invoices/" + response_text["id"], data=json_data, headers=headers) response_text = json.loads(r.text) - newbill = AgencyBills(agency=agency, lexid=newbill_id, billtype="invoice", billnumber=response_text["voucherNumber"], billstatus=response_text["voucherStatus"], start=start_date, end=end_date, plan=plan, usercount=usercount) - newbill.save() + form.instance.agency = agency + form.instance.lexid = newbill_id + form.instance.agency = agency + form.instance.billtype="invoice" + form.instance.billnumber = response_text["voucherNumber"] + form.instance.billstatus = response_text["voucherStatus"] + form.instance.start = start_date + form.instance.end = end_date + form.instance.plan = plan + form.instance.usercount = usercount + #newbill = AgencyBills(agency=agency, lexid=newbill_id, billtype="invoice", billnumber=response_text["voucherNumber"], billstatus=response_text["voucherStatus"], start=start_date, end=end_date, plan=plan, usercount=usercount) + form.save() mail_to_send = "" if(agency.payment_address == None): @@ -260,7 +270,7 @@ class AdmAddBill(CreateView): mail_to_send = agency.payment_address - + # BCC Mail with Object - NICHT DEN IMPORT VERGESSEN!!! email = EmailMultiAlternatives( 'Digitale Agentur | Rechnung ' + str(response_text["voucherNumber"]), diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 4d628a8..b5388f2 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/dump.rdb b/dump.rdb index 7800ded..620c662 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index bce2a8b..fc5ad04 100644 Binary files a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc and b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc differ diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index 290a1ce..7882219 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -745,10 +745,23 @@ Gibt das verfügbare Urlaubskontingent eines Mitarbeiters zurück @register.simple_tag def kontingent(user): kon = 0.0 + restdays = 0.0 try: yearinfo = list(UserYearAbsenceInfo.objects.filter(year=date.today().year, user=user))[0] inuse = yearinfo.days_inuse - kon = yearinfo.days - inuse + + usertime = UserTime.objects.get(user=user) + loosedate = usertime.loose_holidedate.split(".") + today = date.today() + today_month = today.month + today_day = today.day + + loosedata_date = datetime.date(today.year, int(loosedate[1]), int(loosedate[0])) + + if today < loosedata_date: + restdays = yearinfo.restdays + + kon = yearinfo.days - inuse + restdays except: pass diff --git a/timemanagement/templates/timemanagement/rendered_table.html b/timemanagement/templates/timemanagement/rendered_table.html index 7a8b87c..337bd8e 100644 --- a/timemanagement/templates/timemanagement/rendered_table.html +++ b/timemanagement/templates/timemanagement/rendered_table.html @@ -472,7 +472,8 @@ function recalculateChoosenDays(userid=false){ $("#holidayyear").html(date_start.getFullYear()); $("#restholidays").html(data["restholiday_thisyear"]); - $("#detail_rest").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"]); @@ -554,7 +555,8 @@ function recalculateChoosenDaysAfterInit(){ } $("#restholidays").html(data["restholiday_thisyear"]); - $("#detail_rest").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"]); $("#holidayyear").html(new_start[2]); diff --git a/timemanagement/templates/timemanagement/tm_ab_management.html b/timemanagement/templates/timemanagement/tm_ab_management.html index d9f5526..79d2c34 100644 --- a/timemanagement/templates/timemanagement/tm_ab_management.html +++ b/timemanagement/templates/timemanagement/tm_ab_management.html @@ -92,7 +92,7 @@
-  Tage /  verbleibend im Jahr  +  Tage /  verbleibend im Jahr  (0 Rest)
diff --git a/timemanagement/views.py b/timemanagement/views.py index 276d602..47c52c2 100644 --- a/timemanagement/views.py +++ b/timemanagement/views.py @@ -1041,6 +1041,7 @@ def TimeAjax(request): "userown_absences" : userown_absences_string, "choosenuser_name" : user.first_name + " " + user.last_name } + print(data) # REQUEST USER NO RIGHTS else: data = {