aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--forms.py4
-rw-r--r--main.py6
-rw-r--r--models.py18
-rw-r--r--templates/results_entities.html121
-rw-r--r--templates/results_persons.html7
-rw-r--r--templates/search_form_entity.html15
6 files changed, 156 insertions, 15 deletions
diff --git a/forms.py b/forms.py
index 66ed90c..9880b9d 100644
--- a/forms.py
+++ b/forms.py
@@ -118,11 +118,11 @@ class EntitySearchForm(Form):
entity_number_search = StringField(u'Identifikační číslo:')
entity_number_search_selection = SelectField('', choices=search_options)
- entity_number_search_actual = SelectField('', choices=actual_options)
foreign_entity_number_search = StringField(u'Zahraniční registrační číslo:')
foreign_entity_number_search_selection = SelectField('', choices=search_options)
- foreign_entity_number_search_actual = SelectField('', choices=actual_options)
+
+ entity_actual_selection = SelectField('', choices=actual_options)
class CompanyForm(Form):
oddil = [('A', 'A'),
diff --git a/main.py b/main.py
index 27f7d98..f1c38f0 100644
--- a/main.py
+++ b/main.py
@@ -99,6 +99,8 @@ def search_results_entity(search):
entity_number_search_method = search.entity_number_search_selection.data
entity_number_actual_or_full = search.entity_name_search_actual.data
+ actual_selection = search.entity_actual_selection.data
+
qry = Pravnicka_Osoba.query
if entity_number:
@@ -122,12 +124,12 @@ def search_results_entity(search):
if not results:
flash('No results found!')
- return redirect('/osoby')
+ return redirect('/entity')
else:
table = Results(results)
table.border = True
- return render_template("results_entities.html", results=results, form=search, show_form = True)
+ return render_template("results_entities.html", results=results, form=search, show_form = True, selection_method = actual_selection)
@app.route('/results')
diff --git a/models.py b/models.py
index 2887d10..ae45f0c 100644
--- a/models.py
+++ b/models.py
@@ -218,6 +218,17 @@ class Statutarni_Organ_Clen_Association(db.Model):
jmeno_po = db.relationship("Pravnicka_Osoba")
statutarni_organ = db.relationship("Statutarni_Organ_Association")
+class Pravnicka_Osoba(db.Model):
+ __tablename__ = "pravnicke_osoby"
+ id = db.Column(db.Integer, primary_key=True)
+ ico = db.Column(db.String)
+ reg_cislo = db.Column(db.String)
+ nazev = db.Column(db.String)
+ spolecnik_association = db.relationship("Spolecnici_Association")
+ sole_shareholder_association = db.relationship("Jediny_Akcionar_Association")
+ statut_org_association = db.relationship("Statutarni_Organ_Clen_Association")
+ # supervisory_board_member_association = db.relationship("Dozorci_Rada_Clen_Association")
+
class Fyzicka_Osoba(db.Model):
__tablename__ = "fyzicke_osoby"
id = db.Column(db.Integer, primary_key=True)
@@ -613,10 +624,3 @@ class Druhy_Podilu(db.Model):
id = db.Column(db.Integer, primary_key=True)
druh_podilu = db.Column(db.String)
-
-class Pravnicka_Osoba(db.Model):
- __tablename__ = "pravnicke_osoby"
- id = db.Column(db.Integer, primary_key=True)
- ico = db.Column(db.String)
- reg_cislo = db.Column(db.String)
- nazev = db.Column(db.String) \ No newline at end of file
diff --git a/templates/results_entities.html b/templates/results_entities.html
index d81086e..3b87fc5 100644
--- a/templates/results_entities.html
+++ b/templates/results_entities.html
@@ -4,7 +4,126 @@
{% include 'header.html' %}
{% endif %}
-{{ results }}
+{% set count = namespace(value=0) %}
+ {% for row in results %}
+ {% set test_list = [] %}
+ {% for elem in row.spolecnik_association %}
+ {% if selection_method == "actual_results" and elem.vymaz_datum != 0 %}
+ {% set xxx = [] %}
+ {% else %}
+ {% set my_dict = {} %}
+ {% set x = my_dict.__setitem__("adresa", elem.adresa) %}
+ {% set x = my_dict.__setitem__("funkce", "společník") %}
+ {% set x = my_dict.__setitem__("nazev", elem.company.nazev) %}
+ {% set x = my_dict.__setitem__("ico", elem.company.ico) %}
+ {% set x = my_dict.__setitem__("oddil", elem.company.oddil) %}
+ {% set x = my_dict.__setitem__("vlozka", elem.company.vlozka) %}
+ {% set x = my_dict.__setitem__("soud", elem.company.soud) %}
+ {% set x = my_dict.__setitem__("zapis", elem.company.zapis) %}
+ {% set test_list = test_list.append(my_dict) %}
+ {% endif %}
+ {% endfor %}
+
+ {% for elem in row.sole_shareholder_association %}
+ {% if selection_method == "actual_results" and elem.vymaz_datum != 0 %}
+ {% set xxx = [] %}
+ {% else %}
+ {% set my_dict = {} %}
+ {% set x = my_dict.__setitem__("adresa", elem.adresa) %}
+ {% set x = my_dict.__setitem__("funkce", "jediný akcionář") %}
+ {% set x = my_dict.__setitem__("nazev", elem.company.nazev) %}
+ {% set x = my_dict.__setitem__("ico", elem.company.ico) %}
+ {% set x = my_dict.__setitem__("oddil", elem.company.oddil) %}
+ {% set x = my_dict.__setitem__("vlozka", elem.company.vlozka) %}
+ {% set x = my_dict.__setitem__("soud", elem.company.soud) %}
+ {% set x = my_dict.__setitem__("zapis", elem.company.zapis) %}
+ {% set test_list = test_list.append(my_dict) %}
+ {% endif %}
+ {% endfor %}
+
+ {% for elem in row.statut_org_association %}
+ {% if selection_method == "actual_results" and elem.vymaz_datum != 0 %}
+ {% set xxx = [] %}
+ {% else %}
+ {% set my_dict = {} %}
+ {% set x = my_dict.__setitem__("adresa", elem.adresa) %}
+ {% set x = my_dict.__setitem__("funkce", elem.funkce) %}
+ {% set x = my_dict.__setitem__("nazev", elem.statutarni_organ.company.nazev) %}
+ {% set x = my_dict.__setitem__("ico", elem.statutarni_organ.company.ico) %}
+ {% set x = my_dict.__setitem__("oddil", elem.statutarni_organ.company.oddil) %}
+ {% set x = my_dict.__setitem__("vlozka", elem.statutarni_organ.company.vlozka) %}
+ {% set x = my_dict.__setitem__("soud", elem.statutarni_organ.company.soud) %}
+ {% set x = my_dict.__setitem__("zapis", elem.statutarni_organ.company.zapis) %}
+ {% set test_list = test_list.append(my_dict) %}
+ {% endif %}
+ {% endfor %}
+
+ <!-- Insert once data on supervisory board members (natural persons) are available -->
+ <!-- {% for elem in row.supervisory_board_member_association %}
+ {% if selection_method == "actual_results" and elem.vymaz_datum != 0 %}
+ {% set xxx = [] %}
+ {% else %}
+ {% set my_dict = {} %}
+ {% set x = my_dict.__setitem__("adresa", elem.adresa) %}
+ {% set x = my_dict.__setitem__("funkce", elem.funkce) %}
+ {% set x = my_dict.__setitem__("nazev", elem.dozorci_rada.company.nazev) %}
+ {% set x = my_dict.__setitem__("ico", elem.dozorci_rada.company.ico) %}
+ {% set x = my_dict.__setitem__("oddil", elem.dozorci_rada.company.oddil) %}
+ {% set x = my_dict.__setitem__("vlozka", elem.dozorci_rada.company.vlozka) %}
+ {% set x = my_dict.__setitem__("soud", elem.dozorci_rada.company.soud) %}
+ {% set x = my_dict.__setitem__("zapis", elem.dozorci_rada.company.zapis) %}
+ {% set test_list = test_list.append(my_dict) %}
+ {% endif %}
+ {% endfor %} -->
+
+ {% for elem in test_list %}
+ {% if count.value % 2 == 0 %}
+ {% set table_style = "table table-light" %}
+ {% else %}
+ {% set table_style = "table table-secondary" %}
+ {% endif %}
+
+ <table class= "{{table_style}}" style="width: 100%">
+ <p></p>
+ <tr>
+ <td style="width:20%">Název:</td>
+ <td style="width:40%"><b>{{ row.nazev }}</b></td>
+ <td style="width:15%">IČO:</td>
+ <td style="width:25%"><b>{{ row.ico }}</b></td>
+ </tr>
+
+ <tr>
+ <td>Adresa:</td>
+ <td>{{ elem.adresa }}</td>
+ <td>Angažmá:</td>
+ <td>{{ elem.funkce }}</td>
+ </tr>
+
+ <tr>
+ <td><i>ve společnosti:</i></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>Název subjektu:</td>
+ <td><b>{{ elem.nazev }}</b></td>
+ <td>IČO:</td>
+ <td><a href="/{{ elem.ico }}"><b>{{ elem.ico }}</b></a></td>
+ </tr>
+
+ <tr>
+ <td>Spisová značka:</td>
+ <td>{{elem.oddil}} {{elem.vlozka}} vedená u {{elem.soud}}</td>
+ <td>Den zápisu:</td>
+ <td>{{elem.zapis}}</td>
+ </tr>
+
+ </table>
+ {% set count.value = count.value + 1 %}
+ {% endfor %}
+{% endfor %}
{% include 'footer.html' %} \ No newline at end of file
diff --git a/templates/results_persons.html b/templates/results_persons.html
index f26988c..abb4387 100644
--- a/templates/results_persons.html
+++ b/templates/results_persons.html
@@ -116,6 +116,13 @@
</tr>
<tr>
+ <td><i>ve společnosti:</i></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+
+ <tr>
<td>Název subjektu:</td>
<td><b>{{ elem.nazev }}</b></td>
<td>IČO:</td>
diff --git a/templates/search_form_entity.html b/templates/search_form_entity.html
index f3ae970..70f0b5c 100644
--- a/templates/search_form_entity.html
+++ b/templates/search_form_entity.html
@@ -25,7 +25,7 @@
{{ form.entity_name_search.label }}
</div>
<div class="col-sm">
- {{ form.entity_name_search()|safe }} {{ form.entity_name_search_selection }} {{ form.entity_name_search_actual }}
+ {{ form.entity_name_search()|safe }} {{ form.entity_name_search_selection }}
</div>
</div>
@@ -35,7 +35,7 @@
{{ form.entity_number_search.label }}
</div>
<div class="col-sm">
- {{ form.entity_number_search()|safe }} {{ form.entity_number_search_selection }} {{ form.entity_number_search_actual }}
+ {{ form.entity_number_search()|safe }} {{ form.entity_number_search_selection }}
</div>
</div>
@@ -45,10 +45,19 @@
{{ form.foreign_entity_number_search.label }}
</div>
<div class="col-sm">
- {{ form.foreign_entity_number_search()|safe }} {{ form.foreign_entity_number_search_selection }} {{ form.foreign_entity_number_search_actual }}
+ {{ form.foreign_entity_number_search()|safe }} {{ form.foreign_entity_number_search_selection }}
</div>
</div>
+<!-- Search -->
+ <div class="row g-2">
+ <div class="col-sm-3">
+ Vyhledávat údaje:
+ </div>
+ <div class="col-sm">
+ {{ form.entity_actual_selection }}
+ </div>
+ </div>
</p>
<p><input type="submit" value="Search">
</p>