|
|
|
@ -13,6 +13,18 @@ from ..helpers import find_recipients, find_budget_file, get_sheet_of_file
@@ -13,6 +13,18 @@ from ..helpers import find_recipients, find_budget_file, get_sheet_of_file
|
|
|
|
|
from ..overview import create_overview # noqa: F401 |
|
|
|
|
from ..exceptions import BudgetParserError, SuperXParserError # noqa: F401 |
|
|
|
|
|
|
|
|
|
MAIL_MESSAGE_BODY = """Hallo an Alle, |
|
|
|
|
|
|
|
|
|
anbei ist eine aktuelle Übersicht unserer Verbrauchsmittel-Budgets. |
|
|
|
|
|
|
|
|
|
Frohes Bestellen! |
|
|
|
|
|
|
|
|
|
-- |
|
|
|
|
Dies ist eine automatisch generierte Email, |
|
|
|
|
bei Fragen bitte an Holgi wenden |
|
|
|
|
|
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@view_config( |
|
|
|
|
context=dict, |
|
|
|
@ -126,14 +138,14 @@ def send_overview(context, request):
@@ -126,14 +138,14 @@ def send_overview(context, request):
|
|
|
|
|
cell = f"F{row}" |
|
|
|
|
sheet[cell] = value |
|
|
|
|
|
|
|
|
|
budget_year = budget_file.stem.split("-")[-1] |
|
|
|
|
message = Message( |
|
|
|
|
subject=f"Budget Übersicht, Stand {export_date}", |
|
|
|
|
subject=f"Budget Übersicht {budget_year}, Stand {export_date}", |
|
|
|
|
sender="cpiserver@imtek.uni-freiburg.de", |
|
|
|
|
recipients=recipients, |
|
|
|
|
body="hello from ford", |
|
|
|
|
body=MAIL_MESSAGE_BODY, |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
budget_year = budget_file.stem.split("-")[-1] |
|
|
|
|
xls_name = f"{export_date}-Budget-Overview-{budget_year}.xlsx" |
|
|
|
|
with NamedTemporaryFile() as tmp: |
|
|
|
|
sheet._parent.save(tmp.name) |
|
|
|
|