]> wagnertech.de Git - SVBaL.git/blobdiff - python/eh_util/eh_app/AWK/routines.py
pydev-s6 ts
[SVBaL.git] / python / eh_util / eh_app / AWK / routines.py
index 52509b70106b2b726c41078058e54a93801af969..b621b377e56381594a68fa6f0eb784f6f1d01e41 100644 (file)
@@ -8,15 +8,16 @@ def handle_uploaded_file(csv_file):
         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.setConfig("briefpapier", uploaded_file.name)
+        config.setConfig("briefpapier", uploaded_file)
     
     if data["basisbeitrag"]:
         config.setConfig("beitrag_basis", data["basisbeitrag"])
@@ -41,6 +42,8 @@ def erstelle_ehmeldung(data):
     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"])
@@ -54,11 +57,11 @@ def erstelle_ehmeldung(data):
     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.")