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,6 +110,41 @@ def page_admin():
with ui.card(): with ui.card():
with ui.row(): with ui.row():
def update_month_and_year():
try:
calendar_card.clear()
except:
pass
with ui.card() as calendar_card:
with ui.grid(columns=6):
ui.markdown("Datum")
ui.markdown("Buchungen")
ui.markdown("Soll")
ui.markdown("Ist")
ui.markdown("+/-")
ui.space()
for day in range(1, monthrange(int(select_year.value), int(select_month.value))[1] + 1):
ui.markdown(f"{day}. {calendar.month_name[int(select_month.value)]}")
# ---> Hier die Schleife für die Buchungen
ui.markdown('BUCHUNGEN')
ui.markdown("Soll")
ui.markdown("Ist")
ui.markdown("+/-")
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_year = datetime.datetime.now().year
current_month = datetime.datetime.now().month current_month = datetime.datetime.now().month
@ -122,38 +157,24 @@ def page_admin():
available_months_dict[element] = calendar.month_name[int(element)] available_months_dict[element] = calendar.month_name[int(element)]
select_month = ui.select(options=available_months_dict) select_month = ui.select(options=available_months_dict)
try: try:
select_month.value = str(current_month) select_month.value = str(current_month)
except: except:
pass pass
select_year = ui.select(options=available_years) select_year = ui.select(options=available_years, on_change=update_months)
try: try:
select_year.value = str(current_year) select_year.value = str(current_year)
except: except:
pass pass
ui.button("Aktualisieren", on_click=update_month_and_year)
ui.markdown(f"###Buchungen für {calendar.month_name[current_month]} {current_year}") ui.markdown(f"###Buchungen für {calendar.month_name[current_month]} {current_year}")
# Tabelle aufbauen # Tabelle aufbauen
with ui.card() as calendar_card: update_month_and_year()
with ui.grid(columns=6):
ui.markdown("Datum")
ui.markdown("Buchungen")
ui.markdown("Soll")
ui.markdown("Ist")
ui.markdown("+/-")
ui.space()
for day in range(1, monthrange(int(select_year.value), int(select_month.value))[1] + 1):
ui.markdown(f"{day}. {calendar.month_name[int(select_month.value)]}")
# ---> Hier die Schleife für die Buchungen
ui.markdown('BUCHUNGEN')
ui.markdown("Soll")
ui.markdown("Ist")
ui.markdown("+/-")
ui.button("Bearbeiten")