Monatsumstellungen Admin Übersucht

Erste Funktionen zur Monatsauswahl
This commit is contained in:
Alexander Malzkuhn 2025-04-22 13:17:25 +02:00
parent a1b15e98ea
commit 348c8e2f7f
5 changed files with 151 additions and 18 deletions

View File

@ -0,0 +1,28 @@
1743965819
1743965909
1743966022
1743966045
1743966047
1743966049
1743967346
1744889948
1744889966
1744989797
1744989827
1744989830
1744989883
1744989909
1744989914
1744989916
1744991169
1744991171
1744991288
1744991291
1744991473
1744991477
1744991770
1744991777
1745181046
1745181050
1745240760
1745240762

View File

@ -0,0 +1,28 @@
1743965819
1743965909
1743966022
1743966045
1743966047
1743966049
1743967346
1744889948
1744889966
1744989797
1744989827
1744989830
1744989883
1744989909
1744989914
1744989916
1744991169
1744991171
1744991288
1744991291
1744991473
1744991477
1744991770
1744991777
1745181046
1745181050
1745240760
1745240762

View File

@ -0,0 +1,28 @@
1743965819
1743965909
1743966022
1743966045
1743966047
1743966049
1743967346
1744889948
1744889966
1744989797
1744989827
1744989830
1744989883
1744989909
1744989914
1744989916
1744991169
1744991171
1744991288
1744991291
1744991473
1744991477
1744991770
1744991777
1745181046
1745181050
1745240760
1745240762

View File

@ -0,0 +1,28 @@
1743965819
1743965909
1743966022
1743966045
1743966047
1743966049
1743967346
1744889948
1744889966
1744989797
1744989827
1744989830
1744989883
1744989909
1744989914
1744989916
1744991169
1744991171
1744991288
1744991291
1744991473
1744991477
1744991770
1744991777
1745181046
1745181050
1745240760
1745240762

View File

@ -110,33 +110,11 @@ def page_admin():
with ui.card(): with ui.card():
with ui.row(): with ui.row():
current_year = datetime.datetime.now().year def update_month_and_year():
current_month = datetime.datetime.now().month
current_user = user(time_user.value)
available_years = current_user.get_years()
available_months = current_user.get_months(current_year)
available_months_dict = { }
for element in available_months:
available_months_dict[element] = calendar.month_name[int(element)]
select_month = ui.select(options=available_months_dict)
try: try:
select_month.value = str(current_month) calendar_card.clear()
except: except:
pass pass
select_year = ui.select(options=available_years)
try:
select_year.value = str(current_year)
except:
pass
ui.markdown(f"###Buchungen für {calendar.month_name[current_month]} {current_year}")
# Tabelle aufbauen
with ui.card() as calendar_card: with ui.card() as calendar_card:
with ui.grid(columns=6): with ui.grid(columns=6):
ui.markdown("Datum") ui.markdown("Datum")
@ -155,6 +133,49 @@ def page_admin():
ui.markdown("+/-") ui.markdown("+/-")
ui.button("Bearbeiten") ui.button("Bearbeiten")
def update_months():
current_user = user(time_user.value)
available_months = current_user.get_months(select_year.value)
available_months_dict = {}
for element in available_months:
available_months_dict[element] = calendar.month_name[int(element)]
select_month.clear()
select_month.set_options(available_months_dict)
select_month.value = list(available_months)[0]
current_year = datetime.datetime.now().year
current_month = datetime.datetime.now().month
current_user = user(time_user.value)
available_years = current_user.get_years()
available_months = current_user.get_months(current_year)
available_months_dict = { }
for element in available_months:
available_months_dict[element] = calendar.month_name[int(element)]
select_month = ui.select(options=available_months_dict)
try:
select_month.value = str(current_month)
except:
pass
select_year = ui.select(options=available_years, on_change=update_months)
try:
select_year.value = str(current_year)
except:
pass
ui.button("Aktualisieren", on_click=update_month_and_year)
ui.markdown(f"###Buchungen für {calendar.month_name[current_month]} {current_year}")
# Tabelle aufbauen
update_month_and_year()