templates/admin/invoice/invoices.html.twig line 1

Open in your IDE?
  1. {% extends 'admin/base.html.twig' %}
  2. {% block title %}Счета на оплату{% endblock %}
  3. {% block content %}
  4.     <h1 class="h3 mb-2 text-gray-800">Счета на оплату</h1>
  5.     <div class="card shadow mb-4 mt-4">
  6.         <div class="card-header py-3">
  7.             <h6 class="m-0 font-weight-bold text-primary">Список счетов на оплату</h6>
  8.         </div>
  9.         <div class="card-body">
  10.             <div id="invoices-table-filters" class="mb-4 d-flex align-items-center" style="gap: 20px; flex-wrap: wrap;">
  11.                 {% include 'components/calendar_events_component.html.twig' %}
  12.                 {% include 'components/table_filter.html.twig' with { options: {
  13.                     labelText: 'Мероприятие',
  14.                     dropdownIdPrefix: 'calendarEvent',
  15.                     allItemsButtonText: 'Все мероприятия',
  16.                 }} %}
  17.                 {% include 'components/table_filter.html.twig' with { options: {
  18.                     labelText: 'Уровень учащегося',
  19.                     dropdownIdPrefix: 'level',
  20.                     allItemsButtonText: 'Все уровни',
  21.                 }} %}
  22.                 {% include 'components/table_filter.html.twig' with { options: {
  23.                     labelText: 'Статус учащегося',
  24.                     dropdownIdPrefix: 'status',
  25.                     allItemsButtonText: 'Все статусы',
  26.                 }} %}
  27.                 {% include 'components/table_filter.html.twig' with { options: {
  28.                     labelText: 'Статус счёта',
  29.                     dropdownIdPrefix: 'invoiceStatus',
  30.                     allItemsButtonText: 'Все статусы счёта',
  31.                 }} %}
  32.                 {% include 'components/table_filter.html.twig' with { options: {
  33.                     labelText: 'Статья финансов',
  34.                     dropdownIdPrefix: 'financeCategory',
  35.                     allItemsButtonText: 'Все статьи финансов',
  36.                 }} %}
  37.             </div>
  38.             <div class="table-responsive">
  39.                 <table class="table table-bordered" id="invoices-data-table">
  40.                     <thead>
  41.                         <tr>
  42.                             <th data-table-type="num">Номер п/п</th>
  43.                             <th data-table-type="date-d-m-Y">Дата создания</th>
  44.                             <th>Имя</th>
  45.                             <th data-table-dropdown-id="levelDropdown"
  46.                                 data-table-badge-id="levelBadge"
  47.                                 data-table-dropdown-text-for-all="Все уровни">Уровень учащегося</th>
  48.                             <th data-export-exclude-col>Статус учащегося</th>
  49.                             <th data-table-hide-col
  50.                                 data-table-dropdown-id="statusDropdown"
  51.                                 data-table-badge-id="statusBadge"
  52.                                 data-table-dropdown-text-for-all="Все статусы">Статус учащегося (текст)</th>
  53.                             <th data-table-dropdown-id="calendarEventDropdown"
  54.                                 data-table-badge-id="calendarEventBadge"
  55.                                 data-table-dropdown-text-for-all="Все мероприятия">Мероприятие</th>
  56.                             <th>Сумма</th>
  57.                             <th data-export-exclude-col
  58.                                 data-table-dropdown-id="invoiceStatusDropdown"
  59.                                 data-table-badge-id="invoiceStatusBadge"
  60.                                 data-table-dropdown-text-for-all="Все статусы счёта">Статус счёта</th>
  61.                             <th data-table-hide-col
  62.                                 data-table-dropdown-id="invoiceStatusDropdown"
  63.                                 data-table-badge-id="invoiceStatusBadge"
  64.                                 data-table-dropdown-text-for-all="Все статусы счёта">Статус счёта (текст)</th>
  65.                             <th data-table-dropdown-id="financeCategoryDropdown"
  66.                                 data-table-badge-id="financeCategoryBadge"
  67.                                 data-table-dropdown-text-for-all="Все статьи">Статья финансов</th>
  68.                         </tr>
  69.                     </thead>
  70.                     <tbody>
  71.                         {% set i = 0 %}
  72.                         {% for item in items %}
  73.                             {% set i = i + 1 %}
  74.                             {% set person = item.person %}
  75.                             {% set student = person ? person.student : null %}
  76.                             {% set calendarEvent = item.candidate ? item.candidate.calendarEvent : null %}
  77.                             <tr>
  78.                                 <td>{{ i }}</td>
  79.                                 <td>{{ item.createdAt|date('d.m.Y') }}</td>
  80.                                 <td>{{ person ? person.name : '–' }}</td>
  81.                                 <td>{{ student ? student.level : '–' }}</td>
  82.                                 <td>
  83.                                     {% if student %}
  84.                                         <span class="btn btn-{{ student.statusCssClass }} btn-icon-split w-max cursor-default">
  85.                                             <span class="icon text-white-50"><i class="fas fa-tag"></i></span>
  86.                                             <span class="text">{{ student.statusText }}</span>
  87.                                         </span>
  88.                                     {% else %}
  89.                                         –
  90.                                     {% endif %}
  91.                                 </td>
  92.                                 <td>{{ student ? student.statusText : '–' }}</td>
  93.                                 <td>{{ calendarEvent ? calendarEvent.getText() : '–' }}</td>
  94.                                 <td>{{ item.amount }}</td>
  95.                                 <td>
  96.                                     {% include 'components/status_button.html.twig' with { options: {
  97.                                         buttonClass: item.statusCssClass,
  98.                                         text: item.statusText,
  99.                                     }} %}
  100.                                 </td>
  101.                                 <td>{{ item.statusText }}</td>
  102.                                 <td>{{ item.financeCategory ? item.financeCategory.name : '–' }}</td>
  103.                         {% endfor %}
  104.                     </tbody>
  105.                 </table>
  106.             </div>
  107.             <div class="mt-4 d-flex">
  108.                 <button id="download-csv-btn" class="btn btn-primary">Скачать таблицу</button>
  109.             </div>
  110.         </div>
  111.     </div>
  112. {% endblock %}
  113. {% block addJs %}
  114.     <script>
  115.         let table = new CustomDataTable('#invoices-data-table', {
  116.             drawRowNumbersForColIndex: 0,
  117.         });
  118.         table.initDataTable();
  119.         $('#download-csv-btn').click(function() {
  120.             table.downloadCsv();
  121.         });
  122.     </script>
  123. {% endblock %}