aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSveterCZE <petr.smerkl@live.com>2021-02-07 23:22:48 +0100
committerSveterCZE <petr.smerkl@live.com>2021-02-07 23:22:48 +0100
commitb2279e543d9f26eebdd625b01a248cc5de6e6eb4 (patch)
treecdaa88695b0051c2ec1e74a6cc3a1936e4174d89
parent0fd9e0b55ceb1582549cb49b96d03c671cc4407c (diff)
downloadjustice-b2279e543d9f26eebdd625b01a248cc5de6e6eb4.tar.gz
introducing individual extracts
-rw-r--r--main.py9
-rw-r--r--templates/extract.html108
-rw-r--r--templates/results2.html2
3 files changed, 118 insertions, 1 deletions
diff --git a/main.py b/main.py
index c06ac63..c743eb6 100644
--- a/main.py
+++ b/main.py
@@ -150,6 +150,15 @@ def search_results_BACKUP(search):
return render_template('results.html', table=table)
+@app.route("/<int:ico>", methods=['GET', 'POST'])
+def extract(ico):
+ qry = Company.query.join(Obce, Company.obec).join(Ulice, Company.ulice).join(Pravni_Forma, Company.pravni_forma).join(Insolvency_Events, isouter=True)
+ qry = qry.filter(Company.ico == ico)
+ # qry = qry.filter(Company.nazev.contains("prigo"))
+ # qry = Obce.query
+ results = qry.all()
+ return render_template("extract.html", ico = ico, results = results)
+
@app.route('/new_company', methods=['GET', 'POST'])
def new_company():
"""
diff --git a/templates/extract.html b/templates/extract.html
new file mode 100644
index 0000000..955a689
--- /dev/null
+++ b/templates/extract.html
@@ -0,0 +1,108 @@
+{% include 'header.html' %}
+
+
+{% for row in results %}
+
+{% set insolvency_notes = [] %}
+{% for elem in row.insolvence %}
+ {% set insolvency_notes = insolvency_notes.append(elem.insolvency_event) %}
+{% endfor %}
+
+{% set zapis_split = row.zapis.split("-") %}
+{% if zapis_split[1] == "01" %}
+ {% set mesic = "ledna" %}
+{% elif zapis_split[1] == "02" %}
+ {% set mesic = "února" %}
+{% elif zapis_split[1] == "03" %}
+ {% set mesic = "března" %}
+{% elif zapis_split[1] == "04" %}
+ {% set mesic = "dubna" %}
+{% elif zapis_split[1] == "05" %}
+ {% set mesic = "května" %}
+{% elif zapis_split[1] == "06" %}
+ {% set mesic = "června" %}
+{% elif zapis_split[1] == "07" %}
+ {% set mesic = "července" %}
+{% elif zapis_split[1] == "08" %}
+ {% set mesic = "srpna" %}
+{% elif zapis_split[1] == "09" %}
+ {% set mesic = "září" %}
+{% elif zapis_split[1] == "10" %}
+ {% set mesic = "října" %}
+{% elif zapis_split[1] == "11" %}
+ {% set mesic = "listopadu" %}
+{% elif zapis_split[1] == "12" %}
+ {% set mesic = "prosince" %}
+{% endif %}
+
+{% if zapis_split[2][0] == "0" %}
+ {% set den = zapis_split[2][1] %}
+{% else %}
+ {% set den = zapis_split[2] %}
+{% endif %}
+
+{% if row.soud == "MSPH" %}
+ {% set soud = "Městského soudu v Praze" %}
+{% elif row.soud == "KSCB" %}
+ {% set soud = "Krajského soudu v Českých Budějovicích" %}
+{% elif row.soud == "KSOS" %}
+ {% set soud = "Krajského soudu v Ostravě" %}
+{% elif row.soud == "KSPL" %}
+ {% set soud = "Krajského soudu v Plzni" %}
+{% elif row.soud == "KSBR" %}
+ {% set soud = "Krajského soudu v Brně" %}
+{% elif row.soud == "KSHK" %}
+ {% set soud = "Krajského soudu v Hradci Králové" %}
+{% elif row.soud == "KSUL" %}
+ {% set soud = "Krajského soudu v Ústí nad Labem" %}
+{% endif %}
+
+{% if insolvency_notes|length > 0 %}
+ {% set table_style = "table table-danger" %}
+{% elif loop.index % 2 == 0 %}
+ {% set table_style = "table table-light" %}
+{% else %}
+ {% set table_style = "table table-secondary" %}
+{% endif %}
+
+{% if row.ico|length != 8 %}
+ {% set ico_buffer = [] %}
+ {% for i in range (8 - row.ico|length) %}
+ {% set ico_buffer = ico_buffer.append("0") %}
+ {% endfor %}
+
+{% else %}
+ {% set ico_buffer = "" %}
+{% endif %}
+
+
+
+
+<table class= "{{table_style}}" style="width: 100%">
+ <tr>
+ <td style="width:25%">Datum vzniku a zápisu:</td>
+ <td style="width:75%"><b>{{den}}. {{mesic}} {{zapis_split[0]}}</b></td>
+ </tr>
+ <tr>
+ <td>Spisová značka:</td>
+ <td>{{ row.oddil }} {{ row.vlozka }} vedená u {{ soud }}</td>
+ </tr>
+ <tr>
+ <td>Obchodní firma:</td>
+ <td>{{ row.nazev }}</td>
+ </tr>
+ <tr>
+ <td>Sídlo:</td>
+ <td>{{ row.sidlo }}</td>
+ </tr>
+ <tr>
+ <td>Identifikační číslo:</td>
+ <td>{{ ico_buffer|join("") }}{{ row.ico }}</td>
+ </tr>
+</table>
+{% endfor %}
+
+<p><a href="/">Zpět na vyhledání.</a></p>
+
+
+{% include 'footer.html' %} \ No newline at end of file
diff --git a/templates/results2.html b/templates/results2.html
index b7de3fc..e0c62b6 100644
--- a/templates/results2.html
+++ b/templates/results2.html
@@ -97,7 +97,7 @@
<tr>
<td>Sídlo:</td>
<td>{{ row.sidlo }}</td>
- <td></td>
+ <td><a href="/{{ row.ico }}">Úplný výpis</a></td>
<td></td>
</tr>
{% if insolvency_notes|length > 0 %}