<commit_before>{% extends ":Admin:layout.html.twig" %}

{% form_theme form _self %}

{% block checkbox_radio_label %}
    {{- widget | raw }}
{% endblock checkbox_radio_label %}

{% block sonata_admin_content %}
    <div class="sonata-ba-show">
        <div class="sonata-ba-view row">
            <div class="col-md-2">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h4 class="box-title">{{ 'backend.admin.receipt.generate_only' | trans }}</h4>
                    </div>
                    <div class="box-body">
                        {{ form(year_month_form) }}
                    </div>
                </div>
            </div>
            {% if form.items | length > 0 %}
                {% set carriedTotalAmount = 0 %}
                {{ form_start(form) }}
                    <div class="col-md-10">
                        <div class="box box-primary">
                            <div class="box-header with-border">
                                <h4 class="box-title">{{ 'backend.admin.receipt.list' | trans }}</h4>
                            </div>
                            <div class="box-body">
                                {# group lessons #}
                                <table class="table table-bordered table-condensed" style="margin-bottom:20px">
                                    <thead>
                                        <tr class="info">
                                            <th colspan="7" class="text-center">
                                                {{ 'backend.admin.receipt.group_lessons_list' | trans }}<br>
                                                <span style="font-weight:normal">{{ 'backend.admin.receipt.group_lessons_list_help' | trans }}</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th>
                                                <input id="mark-all-group-helper" type="checkbox" name="mark-all-group-helper">
                                            </th>
                                            <th>{{ 'backend.admin.receiptLine.isPreviouslyGenerated' | trans }}</th>
                                            <th>{{ 'backend.admin.student.student' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.units' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.priceUnit' | trans }}</th>
                                            <th>{{ 'backend.admin.student.discountApplied' | trans }}</th>
                                            <th class="text-right">{{ 'backend.admin.student.total' | trans }}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% set total = 0 %}
                                    {% set bothLessonsTypeLoop = 0 %}
                                    {% set groupLessonsTypeLoop = 0 %}
                                    {% for item in form.items %}
                                        {% if not item.vars.value.isPrivateLessonType %}
                                            <tr class="{% if item.vars.value.isReadyToGenerate %}success{% else %}warning{% endif %}">
                                                <td class="td-mark-group-helper">
                                                    {{ form_widget(item.isReadyToGenerate) }}
                                                    {{ form_errors(item.isReadyToGenerate) }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {% if not item.vars.value.isPreviouslyGenerated %}
                                                        <span class="label label-success">{{ 'backend.admin.yes' | trans }}</span>
                                                    {% else %}
                                                        <span class="label label-danger">{{ 'backend.admin.no' | trans }}</span>
                                                    {% endif %}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ item.vars.value.studentName }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ form_widget(item.units) }}
                                                    {{ form_errors(item.units) }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ form_widget(item.unitPrice) }}
                                                    {{ form_errors(item.unitPrice) }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ form_widget(item.discount) }}
                                                    {{ form_errors(item.discount) }}
                                                </td>
                                                <td class="text-right" style="vertical-align:middle">
                                                    <strong>{{ item.vars.value.total | draw_money | raw }}</strong>
                                                </td>
                                                {% set total = total + item.vars.value.total %}
                                                {% set groupLessonsTypeLoop = groupLessonsTypeLoop + 1 %}
                                            </tr>
                                        {% endif %}
                                        {% set bothLessonsTypeLoop = bothLessonsTypeLoop + 1 %}
                                    {% endfor %}
                                    </tbody>
                                    <tfoot>
                                    <tr class="active">
                                        <td>
                                            {{ groupLessonsTypeLoop }} {{ 'backend.admin.receipt.generator.ready' | transchoice(groupLessonsTypeLoop) }}
                                        </td>
                                        <th colspan="5" class="text-right">
                                            {{ 'backend.admin.student.total' | trans | upper }}
                                        </th>
                                        <th class="text-right">
                                            <strong>{{ total | draw_money | raw }}</strong>
                                        </th>
                                    </tr>
                                    </tfoot>
                                </table>
                                {# private lessons #}
                                <table class="table table-bordered table-condensed" style="margin-bottom:20px">
                                    <thead>
                                        <tr class="info">
                                            <th colspan="6" class="text-center">
                                                {{ 'backend.admin.receipt.private_lessons_list' | trans }}<br>
                                                <span style="font-weight:normal">{{ 'backend.admin.receipt.private_lessons_list_help' | trans }}</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th>
                                                <input id="mark-all-private-helper" type="checkbox" name="mark-all-private-helper">
                                            </th>
                                            <th>{{ 'backend.admin.receiptLine.isPreviouslyGenerated' | trans }}</th>
                                            <th>{{ 'backend.admin.student.student' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.units' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.priceUnit' | trans }}</th>
                                            <th class="text-right">{{ 'backend.admin.student.total' | trans }}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% set total = 0 %}
                                    {% set bothLessonsTypeLoop = 0 %}
                                    {% set privateLessonsTypeLoop = 0 %}
                                    {% for item in form.items %}
                                        {% if item.vars.value.isPrivateLessonType %}
                                            <tr class="{% if item.vars.value.isReadyToGenerate %}success{% else %}warning{% endif %}">
                                                <td class="td-mark-private-helper">
                                                    {{ form_widget(item.isReadyToGenerate) }}
                                                    {{ form_errors(item.isReadyToGenerate) }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {% if not item.vars.value.isPreviouslyGenerated %}
                                                        <span class="label label-success">{{ 'backend.admin.yes' | trans }}</span>
                                                    {% else %}
                                                        <span class="label label-danger">{{ 'backend.admin.no' | trans }}</span>
                                                    {% endif %}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ item.vars.value.studentName }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ form_widget(item.units) }}
                                                    {{ form_errors(item.units) }}
                                                </td>
                                                <td style="vertical-align:middle">
                                                    {{ form_widget(item.unitPrice) }}
                                                    {{ form_errors(item.unitPrice) }}
                                                </td>
                                                <td class="hidden" style="vertical-align:middle">
                                                    {{ form_widget(item.discount) }}
                                                    {{ form_errors(item.discount) }}
                                                </td>
                                                <td class="text-right" style="vertical-align:middle">
                                                    <strong>{{ item.vars.value.total | draw_money | raw }}</strong>
                                                </td>
                                                {% set total = total + item.vars.value.total %}
                                                {% set privateLessonsTypeLoop = privateLessonsTypeLoop + 1 %}
                                            </tr>
                                        {% endif %}
                                        {% set bothLessonsTypeLoop = bothLessonsTypeLoop + 1 %}
                                    {% endfor %}
                                    </tbody>
                                    <tfoot>
                                    <tr class="active">
                                        <td>
                                            {{ privateLessonsTypeLoop }} {{ 'backend.admin.receipt.generator.ready' | transchoice(privateLessonsTypeLoop) }}
                                        </td>
                                        <th colspan="4" class="text-right">
                                            {{ 'backend.admin.student.total' | trans | upper }}
                                        </th>
                                        <th class="text-right">
                                            <strong>{{ total | draw_money | raw }}</strong>
                                        </th>
                                    </tr><commit_msg>remove more unnecessary objects from generate_receipt_form.html.twig view<commit_after>{% extends ":Admin:layout.html.twig" %}

{% form_theme form _self %}

{% block checkbox_radio_label %}
    {{- widget | raw }}
{% endblock checkbox_radio_label %}

{% block sonata_admin_content %}
    <div class="sonata-ba-show">
        <div class="sonata-ba-view row">
            <div class="col-md-2">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h4 class="box-title">{{ 'backend.admin.receipt.generate_only' | trans }}</h4>
                    </div>
                    <div class="box-body">
                        {{ form(year_month_form) }}
                    </div>
                </div>
            </div>
            {% if form.items | length > 0 %}
                {{ form_start(form) }}
                    <div class="col-md-10">
                        <div class="box box-primary">
                            <div class="box-header with-border">
                                <h4 class="box-title">{{ 'backend.admin.receipt.list' | trans }}</h4>
                            </div>
                            <div class="box-body">
                                {# group lessons #}
                                <table class="table table-bordered table-condensed" style="margin-bottom:20px">
                                    <thead>
                                        <tr class="info">
                                            <th colspan="7" class="text-center">
                                                {{ 'backend.admin.receipt.group_lessons_list' | trans }}<br>
                                                <span style="font-weight:normal">{{ 'backend.admin.receipt.group_lessons_list_help' | trans }}</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th>
                                                <input id="mark-all-group-helper" type="checkbox" name="mark-all-group-helper">
                                            </th>
                                            <th>{{ 'backend.admin.receiptLine.isPreviouslyGenerated' | trans }}</th>
                                            <th>{{ 'backend.admin.student.student' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.units' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.priceUnit' | trans }}</th>
                                            <th>{{ 'backend.admin.student.discountApplied' | trans }}</th>
                                            <th class="text-right">{{ 'backend.admin.student.total' | trans }}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% set total = 0 %}
                                    {% set groupLessonsTypeLoop = 0 %}
                                    {% for item in form.items if not item.vars.value.isPrivateLessonType %}
                                        <tr class="{% if item.vars.value.isReadyToGenerate %}success{% else %}warning{% endif %}">
                                            <td class="td-mark-group-helper">
                                                {{ form_widget(item.isReadyToGenerate) }}
                                                {{ form_errors(item.isReadyToGenerate) }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {% if not item.vars.value.isPreviouslyGenerated %}
                                                    <span class="label label-success">{{ 'backend.admin.yes' | trans }}</span>
                                                {% else %}
                                                    <span class="label label-danger">{{ 'backend.admin.no' | trans }}</span>
                                                {% endif %}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ item.vars.value.studentName }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ form_widget(item.units) }}
                                                {{ form_errors(item.units) }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ form_widget(item.unitPrice) }}
                                                {{ form_errors(item.unitPrice) }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ form_widget(item.discount) }}
                                                {{ form_errors(item.discount) }}
                                            </td>
                                            <td class="text-right" style="vertical-align:middle">
                                                <strong>{{ item.vars.value.total | draw_money | raw }}</strong>
                                            </td>
                                            {% set total = total + item.vars.value.total %}
                                            {% set groupLessonsTypeLoop = groupLessonsTypeLoop + 1 %}
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                    <tfoot>
                                    <tr class="active">
                                        <td>
                                            {{ groupLessonsTypeLoop }} {{ 'backend.admin.receipt.generator.ready' | transchoice(groupLessonsTypeLoop) }}
                                        </td>
                                        <th colspan="5" class="text-right">
                                            {{ 'backend.admin.student.total' | trans | upper }}
                                        </th>
                                        <th class="text-right">
                                            <strong>{{ total | draw_money | raw }}</strong>
                                        </th>
                                    </tr>
                                    </tfoot>
                                </table>
                                {# private lessons #}
                                <table class="table table-bordered table-condensed" style="margin-bottom:20px">
                                    <thead>
                                        <tr class="info">
                                            <th colspan="6" class="text-center">
                                                {{ 'backend.admin.receipt.private_lessons_list' | trans }}<br>
                                                <span style="font-weight:normal">{{ 'backend.admin.receipt.private_lessons_list_help' | trans }}</span>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th>
                                                <input id="mark-all-private-helper" type="checkbox" name="mark-all-private-helper">
                                            </th>
                                            <th>{{ 'backend.admin.receiptLine.isPreviouslyGenerated' | trans }}</th>
                                            <th>{{ 'backend.admin.student.student' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.units' | trans }}</th>
                                            <th>{{ 'backend.admin.invoiceLine.priceUnit' | trans }}</th>
                                            <th class="text-right">{{ 'backend.admin.student.total' | trans }}</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% set total = 0 %}
                                    {% set privateLessonsTypeLoop = 0 %}
                                    {% for item in form.items if item.vars.value.isPrivateLessonType %}
                                        <tr class="{% if item.vars.value.isReadyToGenerate %}success{% else %}warning{% endif %}">
                                            <td class="td-mark-private-helper">
                                                {{ form_widget(item.isReadyToGenerate) }}
                                                {{ form_errors(item.isReadyToGenerate) }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {% if not item.vars.value.isPreviouslyGenerated %}
                                                    <span class="label label-success">{{ 'backend.admin.yes' | trans }}</span>
                                                {% else %}
                                                    <span class="label label-danger">{{ 'backend.admin.no' | trans }}</span>
                                                {% endif %}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ item.vars.value.studentName }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ form_widget(item.units) }}
                                                {{ form_errors(item.units) }}
                                            </td>
                                            <td style="vertical-align:middle">
                                                {{ form_widget(item.unitPrice) }}
                                                {{ form_errors(item.unitPrice) }}
                                            </td>
                                            <td class="hidden" style="vertical-align:middle">
                                                {{ form_widget(item.discount) }}
                                                {{ form_errors(item.discount) }}
                                            </td>
                                            <td class="text-right" style="vertical-align:middle">
                                                <strong>{{ item.vars.value.total | draw_money | raw }}</strong>
                                            </td>
                                            {% set total = total + item.vars.value.total %}
                                            {% set privateLessonsTypeLoop = privateLessonsTypeLoop + 1 %}
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                    <tfoot>
                                    <tr class="active">
                                        <td>
                                            {{ privateLessonsTypeLoop }} {{ 'backend.admin.receipt.generator.ready' | transchoice(privateLessonsTypeLoop) }}
                                        </td>
                                        <th colspan="4" class="text-right">
                                            {{ 'backend.admin.student.total' | trans | upper }}
                                        </th>
                                        <th class="text-right">
                                            <strong>{{ total | draw_money | raw }}</strong>
                                        </th>
                                    </tr>
{'fraction_non_alphanumeric': 0.09995648906293264, 'fraction_numerical': 0.0019382144693643449, 'mean_word_length': 0.6352111765086347, 'pattern_counts': {'":': 2, '<': 289, '<?xml version=': 0, '>': 291, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 504, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1115383', 'n_tokens_mistral': 4541, 'n_tokens_neox': 4197, 'n_words': 808}