for chunk in csv_file.chunks():
destination.write(chunk)
'''
-def aktualisiere_config(config, data):
- if data["briefpapier"]:
- uploaded_file = data["briefpapier"]
+def aktualisiere_config(config, data, file):
+
+ if file:
+ uploaded_file = file.name
data_path = config.requireConfig("data_path")
# copy briefpapier into data_path
- with open(os.path.join(data_path, uploaded_file.name), 'wb+') as destination:
- for chunk in uploaded_file.chunks():
+ with open(os.path.join(data_path, uploaded_file), 'wb+') as destination:
+ for chunk in file.chunks():
destination.write(chunk)
- config.set_config("briefpapier", uploaded_file.name)
+ config.setConfig("briefpapier", uploaded_file)
if data["basisbeitrag"]:
- config.set_config("beitrag_basis", data["basisbeitrag"])
+ config.setConfig("beitrag_basis", data["basisbeitrag"])
if data["zusatzbeitrag"]:
- config.set_config("beitrag_zusatz", data["zusatzbeitrag"])
+ config.setConfig("beitrag_zusatz", data["zusatzbeitrag"])
def erstellepdf(text):
with open(r'G:\SVBaL\python\eh_util\eh_app\test.tex', 'w') as f: # öffnet ein neues Dokument mit dem Namen test.tex
can = canvas.Canvas(packet, pagesize=letter)
# Adressfeld
+ can.setFont("Helvetica", 14)
+ can.drawString(80, 770, "Siedlervereinigung Berg am Laim")
can.setFont("Helvetica", 12)
can.drawString(205, 618, data["VorZuname"])
can.drawString(205, 600, data["VorZunamePartner"])
can.drawString(205, 500, versichertes_object)
can.drawString(193, 466, str(data["AnzahlWohnungen"]))
if data["Selbstgenutzt"]:
- can.drawString(350, 466, "X")
+ can.drawString(360, 466, "X")
if data["Eigentumswohnung"]:
- can.drawString(188, 449, "X")
+ can.drawString(192, 449, "X")
if data["Gewerblich"]:
- can.drawString(350, 449, "X")
+ can.drawString(360, 449, "X")
can.drawString(140, 376, date.today().strftime('%d.%m.%Y'))
can.drawString(350, 376, "Maschinell erstellt.")