{% extends app.request.xmlHttpRequest ? 'base_ajax.html.twig' : 'base.html.twig' %}
{% block title %}Nová objednávka{% endblock %}
{% block body %}
{% for flash_error in app.flashes('new_product') %}
<div class="alert alert-danger" role="alert">{{ flash_error }}</div>
{% endfor %}
<!-- Section -->
<section class="vh-lg- 100 mt-5 mt-lg-0 bg-soft d-flex align-items-center" data-controller="app-common">
<div class="container">
<div class="row justify-content-center form-bg-image">
<div class="col-12 d-flex align-items-center justify-content-center">
<div class="signin-inner my-3 my-lg-0 bg-white border-0 rounded p-4 p-lg-5 w-100 row">
<h1 class="h3">Detail objednávky (#{{ order.hash }})</h1>
<div class="row">
<div class="col-12">
<!-- Tab Nav -->
<div class="nav-wrapper position-relative mb-2">
<ul class="nav nav-pills nav-fill d-block row" id="tabs-icons-text" role="tablist">
<li class="nav-item col-lg-3 d-inline-flex">
<a class="nav-link mb-sm-3 mb-md-0 active d-flex align-items-center justify-content-center p-2" id="order-klient-tab" data-bs-toggle="tab" href="#order-klient" role="tab" aria-controls="tabs-icons-text-1" aria-selected="true">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 14v3m4-3v3m4-3v3M3 21h18M3 10h18M3 7l9-4 9 4M4 10h16v11H4V10z"></path></svg>
Základní údaje
</a>
</li>
<li class="nav-item col-lg-3 d-inline-flex">
<a class="nav-link mb-sm-3 mb-md-0 d-flex align-items-center justify-content-center p-2" id="order-documents-tab" data-bs-toggle="tab" href="#order-documents" role="tab" aria-controls="tabs-icons-text-2" aria-selected="false">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg>
Dokumenty
</a>
</li>
</ul>
</div>
<!-- End of Tab Nav -->
</div>
<div class="card border-0">
<div class="card-body p-0">
<div class="tab-content" id="tabcontent">
<div class="tab-pane fade show active" id="order-klient" role="tabpanel" aria-labelledby="order-klient">
<div class="row">
<div class="col-6 text-start ps-3">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg>
<strong class="me-auto fw-bold">Klient</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>Typ:</td><td class="dt-labl">{{ order.personType }}</td></tr>
<tr><td>Jméno:</td><td class="dt-labl">{{ order.name }} {{ order.surname }}</td></tr>
{# Spolecnost #}
{% if order.personType == 'PO' %}
<tr><td>Zapsaná v:</td><td class="dt-labl">{{ order.companyRegistrationPlace }}</td></tr>
<tr><td>Zastoupena:</td><td class="dt-labl">{{ order.companyRepresentantive }}</td></tr>
<tr><td>Číslo zápisu:</td><td class="dt-labl">{{ order.companyRegistrationNumber }}</td></tr>
<tr><td>Oddíl:</td><td class="dt-labl">{{ order.companyRegistrationPartition }}</td></tr>
<tr><td>Vložka:</td><td class="dt-labl">{{ order.companyRegistrationInsertion }}</td></tr>
{% endif %}
{# FO - podnikatel #}
{% if order.personType == 'FP' %}
<tr><td>Zapsaný u:</td><td class="dt-labl">{{ order.businessmanRegistrationPlace }}</td></tr>
<tr><td>Číslo zápisu:</td><td class="dt-labl">{{ order.businessmanRegistrationNumber }}</td></tr>
{% endif %}
{% if order.personType == 'FO' %}
<tr><td>PEP:</td>
<td class="dt-labl">
{% if order.politicallyExposedPerson == true %}Ano{% else %}Ne{% endif %}
</td></tr>
{% endif %}
{% if order.personType == 'PO' or order.personType == 'FP' %}
<tr><td>Daňová residence:</td><td class="dt-labl">{{ order.taxResidency }}</td></tr>
<tr><td>Původ finančních prostředků:</td>
<td class="dt-labl">
{{ order.originOfFunds }}{% if order.originOfFundsCustom != null %}: {{ order.originOfFundsCustom }}{% endif %}
</td></tr>
{% if order.personType == 'FP' %}
<tr><td>PEP:</td>
<td class="dt-labl">
{% if order.politicallyExposedPerson == true %}Ano{% else %}Ne{% endif %}
</td></tr>
{% endif %}
<tr><td>IČO:</td><td class="dt-labl">{{ order.ic }}</td></tr>
<tr><td>DIČ:</td><td class="dt-labl">{{ order.dic }}</td></tr>
{% endif %}
{# FO #}
{% if order.birthdate is defined %}
<tr><td>Datum narození:</td><td class="dt-labl">{{ order.birthdate|date("d.m.Y") }}</td></tr>
{% endif %}
{% if order.birthnumber is defined %}
<tr><td>Rodné číslo:</td><td class="dt-labl">{{ order.birthnumber }}</td></tr>
{% endif %}
<tr><td>Email:</td><td class="dt-labl">{{ order.email }}</td></tr>
<tr><td>Telefon:</td><td class="dt-labl">{{ order.phone }}</td></tr>
</tbody>
</table>
</div>
</div>
<div class="toast show w-100 mt-2 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg>
<strong class="me-auto fw-bold">Adresa</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr>
<td>{% if order.personType == 'FO' %}Trvalé bydliště{% else %}Sídlo společnosti{% endif %}</td>
<td class="dt-labl">{{ order.street }}<br />{{ order.town }}<br />{{ order.postal }}</td></tr>
<tr>
<td>{% if order.personType == 'FO' %}Korespondenční adresa{% else %}Adresa místa podnikání{% endif %}</td>
<td class="dt-labl">{{ order.street2 }}<br />{{ order.town2 }}<br />{{ order.postal2 }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-6 text-start ps-3">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"></path></svg>
<strong class="me-auto fw-bold">Osobní doklad</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>Typ:</td><td class="dt-labl">{{ order.idType }}</td></tr>
<tr><td>Číslo:</td><td class="dt-labl">{{ order.idNumber }}</td></tr>
<tr><td>Vydal:</td><td class="dt-labl">{{ order.idAuthor }}</td></tr>
<tr><td>Platný do:</td><td class="dt-labl">{{ order.idValidity|date("d.m.Y") }}</td></tr>
</tbody>
</table>
</div>
</div>
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"></path></svg>
<strong class="me-auto fw-bold">Bankovní spojení</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>Banka:</td><td class="dt-labl">{{ order.bankName }}</td></tr>
<tr><td>Číslo účtu:</td><td class="dt-labl">{{ order.bankAccount }}/{{ order.bankCode }}</td></tr>
<tr><td>SWIFT:</td><td class="dt-labl">{{ order.swift }}</td></tr>
<tr><td>IBAN:</td><td class="dt-labl">{{ order.iban }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-12 text-start ps-3">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<strong class="me-auto fw-bold">Produkt</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
{% if order.company is not null %}
<tr><td>Společnost:</td><td class="dt-labl text-wrap">{{ order.company.name }}</td></tr>
<tr><td>Název:</td><td class="dt-labl text-wrap">{{ order.product.name }}</td></tr>
{% endif %}
<tr><td>Cena/ks:</td><td class="dt-labl text-wrap">{{ order.productPrice|number_format(0, ',', ' ') }} {{ order.product|p_currency }}</td></tr>
<tr><td>Počet:</td><td class="dt-labl text-wrap">{{ order.productCount }}</td></tr>
<tr><td>Celkem:</td><td class="dt-labl text-wrap">{{ order.productPriceTotal|number_format(0, ',', ' ') }} {{ order.product|p_currency }}</td></tr>
<tr><td>Výnos:</td><td class="dt-labl text-wrap">{{ order.productInterest }}%</td></tr>
<tr><td>Daň:</td><td class="dt-labl text-wrap">{{ order.productTax }}%</td></tr>
</tbody>
</table>
</div>
</div>
</div>
{% if order.merchant is defined and order.merchant is not null and is_granted(constant('App\\Security\\Voter\\OrderVoter::VIEW_MERCHANT'), order) %}
<div class="col-12 text-start ps-3">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<strong class="me-auto fw-bold">Zástupce</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td style="width: 125px;">Jméno:</td><td class="dt-labl">{{ order.merchant.name }} {{ order.merchant.surname }}</td></tr>
<tr><td style="width: 125px;">Email:</td><td class="dt-labl">{{ order.merchant.email }}</td></tr>
<tr><td>Affiliate kód:</td><td class="dt-labl">{{ order.merchantCode }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
<div class="col-12 text-start ps-3">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
<strong class="me-auto fw-bold">Poznámka</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>{{ order.message }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-12 text-start ps-3">
<div class="row">
<div class="col-6">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"></path></svg>
<strong class="me-auto fw-bold">Podpis klient</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>Datum:</td><td class="dt-labl">{{ order.signDateUser|date("d.m.Y") }}</td></tr>
<tr><td>Místo:</td><td class="dt-labl">{{ order.signPlaceUser }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-6">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"></path></svg>
<strong class="me-auto fw-bold">Podpis Emitent</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush">
<tbody>
<tr><td>Datum:</td><td class="dt-labl">{{ order.signDateCompany|date("d.m.Y") }}</td></tr>
<tr><td>Místo:</td><td class="dt-labl">{{ order.signPlaceCompany }}</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="order-documents" role="tabpanel" aria-labelledby="order-documents">
{% if is_granted("ROLE_ADMIN") or is_granted("ROLE_COMPANY_ADMIN") %}
<div class="col-12">
<div class="align-content-end text-end mb-2">
<div class="uploader" data-app-common-target="orderFileUploader" data-complete-callback="{{ path('app_order_detail', {'order': order.id}) }}" data-reload-element="uploadedFilesTable" data-action="{{ path('app_order_uploadefile', {'id': order.id}) }}" data-action-chunk="{{ path('app_order_uploadefilechunk', {'id': order.id}) }}" data-order="{{ order.id }}">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
<!-- or put a simple form for upload here -->
</noscript>
</div>
</div>
</div>
<div class="col-12">
<div class="toast show w-100">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
<strong class="me-auto fw-bold">Nahrané smlouvy</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush" id="uploadedFilesTable">
<thead class="thead-light">
<tr>
<th>Akce</th>
<th>Název</th>
<th>Vytvořeno</th>
<th>Velikost</th>
</tr>
</thead>
<tbody>
{% for file in order.files|onlySimpleFile %}
<tr>
<td>
{% if file.exists %}
<a href="{{ path('app_order_file_download', { 'file': file.id }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
{% endif %}
<a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="uploadedFilesTable" data-confirm="Opravdu chcete smazat soubor?">
<svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</a>
</td>
<td>{{ file.name }}</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
</tr>
{% else %}
<tr>
<td class="text-center">Nejsou k dispozici žádné nahrané smlouvy v PDF</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
<div class="col-12 my-5">
{% if is_granted("ROLE_ADMIN") or is_granted("ROLE_COMPANY_ADMIN") %}
<div class="align-content-end text-end mb-2">
{% if
(order.product.templateValuablePaper != null and order.product.templateValuablePaperProtocol != null)
or
(order.product.templateValuablePaperMulti != null and order.product.templateValuablePaperProtocol != null)
%}
<div>
<a href="#" class="btn btn-primary waves-effect waves-light" data-order-sequence-number="{{ order.sequenceNumber }}" data-target-generate-url="{{ path('app_order_valuable_paper_generate', {'order': order.id}) }}" data-target-url="{{ path('app_order_save_sequence_number', {'order': order.id}) }}" data-action="click->app-common#generateValuableProtocol">
Generovat cenný papír a předávací protokol
</a>
</div>
{% else %}
<div class="alert alert-danger d-inline-block">Nelze generovat cenné papíry, produkt nemá nastavené šablony.</div>
{% endif %}
</div>
{% endif %}
<div class="toast show w-100" id="handoversFilesTable">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
<strong class="me-auto fw-bold">Cenné papíry a předávací protokoly</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush" id="valuablePapersTable">
<thead class="thead-light">
<tr>
<th>Akce</th>
<th>Název</th>
<th>Vytvořeno</th>
<th>Velikost</th>
</tr>
</thead>
<tbody>
{% for file in order.files|onlyValuableAndProtocolFile %}
<tr>
<td>
{% if file.exists %}
<a href="{{ path('app_order_file_download', { 'file': file.id }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
{% endif %}
{% if is_granted("ROLE_ADMIN") or is_granted("ROLE_COMPANY_ADMIN") %}
{% if file.envelopeId is null %}
<a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="handoversFilesTable" data-confirm="Opravdu chcete smazat soubor?">
<svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</a>
{% endif %}
{% endif %}
</td>
<td>{{ file.name }}</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
</tr>
{% else %}
<tr>
<td class="text-center">Nejsou k dispozici žádné Cenné papíry a předávací protokoly</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% if order.files|onlyContract.count > 0 %}
<div class="col-12">
<div class="toast show w-100 mt-2">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
<strong class="me-auto fw-bold">Smlouvy PDF</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush" id="pdfTable">
<thead class="thead-light">
<tr>
<th>Akce</th>
<th>Název</th>
<th>Typ dokumentu</th>
<th>Vytvořeno</th>
<th>Změněno</th>
<th>Velikost</th>
<th>Verze</th>
</tr>
</thead>
<tbody>
{% for file in order.files|onlyContract %}
<tr>
<td>
{% if is_granted('ROLE_COMPANY_ADMIN') %}
{% if file.exists %}
<a href="{{ path('app_order_file_download_file', { 'file': file.id }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
{% endif %}
<a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="pdfTable" data-confirm="Opravdu chcete smazat soubor?">
<svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</a>
{% endif %}
</td>
<td>{{ file.name }}</td>
<td class="text-center">Pdf</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.changed|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
<td class="text-center">{{ file.version }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if order.files|onlySigni.count > 0 %}
<div class="col-12">
<div class="toast show w-100 mt-5">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
<strong class="me-auto fw-bold">Smlouvy podepsané Signi.com</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush" id="onlySigniTable">
<thead class="thead-light">
<tr>
<th>Akce</th>
<th>Název</th>
<th>Vytvořeno</th>
<th>Změněno</th>
<th>Velikost</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for file in order.files|onlySigni %}
<tr>
<td>
{% if is_granted('ROLE_COMPANY_ADMIN') %}
{% if file.signiState == 'completed' %}
<a href="{{ path('app_order_file_download_signi', { 'signi': file.id }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
<a href="{{ path('app_order_file_download_signi_cl', { 'signi': file.id }) }}" target="_blank" title="Otevřít Kontrolní list">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path></svg>
</a>
{% endif %}
{% endif %}
{% if file.signiState != 'completed' %}
{# pending #}
<a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="onlySigniTable" data-confirm="Opravdu chcete smazat soubor?">
<svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
</a>
{% endif %}
</td>
<td>{{ file.name }}</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.changed|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
<td class="text-center">{{ file.signiState }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if order.files|onlyDigiSign.count > 0 %}
<div class="col-12">
<div class="toast show w-100 mt-5">
<div class="toast-header">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
<strong class="me-auto fw-bold">Dokumenty podepsané v DigiSign.org</strong>
</div>
<div class="toast-body p-0">
<table class="table table-flush" id="onlySigniTable">
<thead class="thead-light">
<tr>
<th>Akce</th>
<th>Název</th>
<th>Vytvořeno</th>
<th>Změněno</th>
<th>Velikost</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for file in order.files|onlyDigiSign %}
<tr>
<td>
{% if is_granted('ROLE_COMPANY_ADMIN') %}
{% if file.signiState == 'completed' %}
<a href="{{ path('app_order_file_download_digisign', { 'digiSign': file.id, 'output': 'combined' }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
<a href="{{ path('app_order_file_download_digisign', { 'digiSign': file.id, 'output': 'only_log' }) }}" target="_blank" title="Otevřít Kontrolní list">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path></svg>
</a>
{% endif %}
{% endif %}
{# {% if file.signiState != 'completed' %}#}
{# #}{# pending #}
{# <a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="onlySigniTable" data-confirm="Opravdu chcete smazat soubor?">#}
{# <svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>#}
{# </a>#}
{# {% endif %}#}
</td>
<td>{{ file.name }}</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.changed|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
<td class="text-center">{{ file.signiState }}</td>
</tr>
{% endfor %}
{% for file in order.files|onlyValuablePaperProtocolDigisign %}
<tr>
<td>
{% if is_granted('ROLE_COMPANY_ADMIN') %}
{% if file.signiState == 'completed' %}
<a href="{{ path('app_order_file_download_digisign', { 'digiSign': file.id, 'output': 'combined' }) }}" target="_blank" title="Otevřít soubor">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 21h7a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v11m0 5l4.879-4.879m0 0a3 3 0 104.243-4.242 3 3 0 00-4.243 4.242z"></path></svg>
</a>
<a href="{{ path('app_order_file_download_digisign', { 'digiSign': file.id, 'output': 'only_log' }) }}" target="_blank" title="Otevřít Kontrolní list">
<svg class="icon icon-xs text-gray-400 me-2" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path></svg>
</a>
{% endif %}
{% endif %}
{# {% if file.signiState != 'completed' %}#}
{# #}{# pending #}
{# <a href="{{ path('app_order_file_delete', {'file': file.id, 'order': order.id}) }}" data-action="click->app-common#delete" data-reload-element="onlySigniTable" data-confirm="Opravdu chcete smazat soubor?">#}
{# <svg class="icon icon-xs text-gray-400 me-2 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>#}
{# </a>#}
{# {% endif %}#}
</td>
<td>{{ file.name }}</td>
<td class="text-center">{{ file.created|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.changed|date('d.m.Y H:i:s') }}</td>
<td class="text-center">{{ file.size|format_bytes }}</td>
<td class="text-center">{{ file.signiState }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- End of Tab Content -->
</div>
</div>
</div>
</div>
</section>
{% endblock %}