operations.html.twig 5.51 KB
Newer Older
Julien Jorry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
{% extends '@kohinos/common/layout.html.twig' %}

{% block content %}
<div class='container operations mt-5 mb-5'>
    {% include '@kohinos/block/breadcrumb.html.twig' with {'label' : 'Opérations du compte'|trans } %}
    <div class='card'>
        <div class="card-header"><h3>{{ 'Opérations du compte'|trans }} <b>{{ getCurrencyName(currency) }}</b></h3></div>
        <div class="card-body">
            <div class="card-text">
                {{ form_start(searchForm) }}
                {{ form_row(searchForm._token) }}
                <div class='container row'>
                    <div class='col-4'>{{ form_row(searchForm.moyen) }}</div>
                    <div class='col-4'>{{ form_row(searchForm.datemin) }}</div>
                    <div class='col-4'>{{ form_row(searchForm.datemax) }}</div>
16 17 18 19 20 21
                    {% if searchForm.showMonAPurchaseOnly is defined and ssa_friendly_flux_type_names %}
                        <div class='col-4'>{{ form_row(searchForm.showMonAPurchaseOnly) }}</div>
                        <div class='col-8 text-right'>{{ form_row(searchForm.submit) }}</div>
                    {% else %}
                        <div class='col-12 text-right'>{{ form_row(searchForm.submit) }}</div>
                    {% endif %}
Julien Jorry committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
                </div>
                <div class="table-responsive">
                    <table class="table">
                        <thead>
                          <tr>
                            <th scope="col">{{ 'Date'|trans }}</th>
                            <th scope="col">{{ 'Montant'|trans }}</th>
                            <th scope="col">{{ 'Type'|trans }}</th>
                            <th scope="col">{{ 'Moyen'|trans }}</th>
                            <th scope="col">{{ 'Operation'|trans }}</th>
                            <th scope="col">{{ 'Référence'|trans }}</th>
                          </tr>
                        </thead>
                        <tbody>
                        {% for operation in operations %}
                            <tr>
                                <td><span data-toggle="tooltip" data-placement="bottom" title="{{ operation.createdAt|date('d/m/Y H:i') }}">{{ operation.createdAt|date('d/m/Y') }}</span></td>
                                <td class='text-right'><span class='font-weight-bold {{ (operation.montant < 0)? '':'text-primary' }}'>{{ (operation.montant < 0)? '- ':'+ ' }} {{ operation.montant|abs|number_format(2) }}</span></td>
                                <td>{{ ((isCurrentAccountable(app.user, operation.flux.expediteur) ? 'exp' : 'des')~'_'~operation.flux.parenttype)|trans({}, 'flux') }}</td>
                                <td>{{ operation.flux.moyen|trans }}</td>
                                <td>
                                    <span>
                                        {% if not isCurrentAccountable(app.user, operation.flux.expediteur)  %}
                                            {{ operation.flux.expediteur }}
                                        {% elseif not isCurrentAccountable(app.user, operation.flux.destinataire)  %}
                                            {{ operation.flux.destinataire }}
                                        {% endif %}
                                    </span>
                                </td>
                                <td>{{ operation.flux.reference }}</td>
                            </tr>
                        {% endfor %}
                      </tbody>
                    </table>
                </div>
                {% if operations|length > 0 %}
                    <div class="kohpagination">
                        {{ knp_pagination_render(operations) }}
                    </div>
                    <div class="btn-group d-block text-center">
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="dropdownMenuLink">
                            <i class="fa fa-share-square-o" aria-hidden="true"></i>
                            {{ 'Exporter les opérations'|trans }}
                            <span class="caret"></span>
                        </button>
                        <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                            <button type="submit" id="formListOperations_json" name="formListOperations[json]" class="dropdown-item">
                                <i class="fa fa-arrow-circle-o-down" aria-hidden="true"></i>
                                JSON
                            </button>
                            <button type="submit" id="formListOperations_xml" name="formListOperations[xml]" class="dropdown-item">
                                <i class="fa fa-arrow-circle-o-down" aria-hidden="true"></i>
                                XML
                            </button>
                            <button type="submit" id="formListOperations_csv" name="formListOperations[csv]" class="dropdown-item">
                                <i class="fa fa-arrow-circle-o-down" aria-hidden="true"></i>
                                CSV
                            </button>
                            <button type="submit" id="formListOperations_xls" name="formListOperations[xls]" class="dropdown-item">
                                <i class="fa fa-arrow-circle-o-down" aria-hidden="true"></i>
                                XLS
                            </button>
                        </div>
                    </div>
                {% endif %}
                </form>
            </div>
        </div>
    </div>
</div>
</div>
{% endblock %}