<commit_before>{% extends '::base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" type="text/css" href="{{ asset('/bundles/app/select2/css/select2.min.css') }}"/>
{% endblock %}

{% block body %}
    {{ parent() }}

    <div class="container content">
        <br />
        <form method="POST" action="{{ path('add_company') }}">
            <div class="row">
                <div class="col-md-3">
                    <input class="form-control" type="text" name="company_name" class="form-control"/>
                </div>
                <div class="col-md-2">
                    <input type="submit" class="btn btn-primary" />
                </div>
            </div>
        </form>

        <p class="text-right">{{ form.vars.value.performDate|date('Y-m-d H:i:s') }}</p>
        <form method="POST" action="#">

            <div class="row">
                <div class="col-md-10">
                    <select id="{{ form.company.vars.id }}" name="{{ form.company.vars.full_name }}" class="form-control select2" required>
                        <option></option>
                        {% for company in companies %}
                            <option value="{{ company.id }}" {% if company.id == form.company.vars.value %}selected="selected"{% endif %}>{{ company }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-md-2">
                    {{ form_widget(form.billingType, {'attr': {'class': 'form-control'} }) }}
                </div>
            </div>


            <br /><br />
            <table class="table table-striped table-bordered">
                <tr>
                    <th>Ապրանքի անվանում</th>
                    <th>Միավորի գին</th>
                    <th>Զեղչ</th>
                    <th>Քանակը</th>
                    <th>Գումարը</th>
                </tr>

                {% set i = 1 %}
                {% set totalPrice = 0 %}
                {% for priceListProduct in form.priceListProducts %}
                    <tr>
                        <td>
                            {{ priceListProduct.vars.value.product.name }}
                            <input type="hidden" id="{{ priceListProduct.vars.id }}_product" name="{{ priceListProduct.vars.full_name }}[product]" value="{{ priceListProduct.vars.value.product.id }}" />
                        </td>

                        <td class="single_price_{{ i }}">{{ priceListProduct.vars.value.product.price }}</td>
                        <td>
                            <input onkeyup="calculatePrice({{ i }})" type="number" id="{{ priceListProduct.vars.id }}_discount" name="{{ priceListProduct.vars.full_name }}[discount]" min="0" value="{{ priceListProduct.vars.value.discount }}" class="form-control discount_{{ i }}"/>
                        </td>
                        <td>
                            <input onkeyup="calculatePrice({{ i }})" type="number" id="{{ priceListProduct.vars.id }}_quantity" name="{{ priceListProduct.vars.full_name }}[quantity]" min="0" value="{{ priceListProduct.vars.value.quantity }}" class="form-control quantity_{{ i }}"/>
                        </td>

                        {% set price = priceListProduct.vars.value.quantity * priceListProduct.vars.value.product.price %}
                        {% set totalPrice = totalPrice + price %}
                        <td class="price price_{{ i }}">{{ price }}</td>
                    </tr>

                    {% set i = i + 1 %}
                {% endfor %}

                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>Ընդհանուր գումարը</td>
                    <td class="total_price">{{ totalPrice }}</td>
                </tr>

            </table>

            {% for i in 0..2 %}
                <div class="row">
                    <div class="col-md-5">
                        <select name="zero_products[{{ i }}]" class="form-control select2">
                            <option></option>

                            {% for priceListProduct in form.priceListProducts %}
                                <option value="{{ priceListProduct.vars.value.product.id }}">{{ priceListProduct.vars.value.product.name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <div class="col-md-2">
                        <input type="number" min="0" name="zero_products_count[{{ i }}]" class="form-control" />
                    </div>
                </div>
            {% endfor %}

            <br/>

            {{ form_widget(form.comment, {'attr': {'class': 'form-control'} }) }}

            <br />

            {{ form_widget(form._token) }}
            <input type="submit" class="btn btn-primary" />
        </form>
    </div>
{% endblock %}


{% block javascripts %}
    {{ parent() }}
    <script src="{{ asset('/bundles/app/js/calculatePrice.js') }}"></script>
    <script src="{{ asset('/bundles/app/select2/js/select2.min.js') }}"></script>
    <script type="text/javascript">
        $('.select2').select2();
    </script>
{% endblock %}<commit_msg>to armenian<commit_after>{% extends '::base.html.twig' %}

{% block stylesheets %}
    {{ parent() }}
    <link rel="stylesheet" type="text/css" href="{{ asset('/bundles/app/select2/css/select2.min.css') }}"/>
{% endblock %}

{% block body %}
    {{ parent() }}

    <div class="container content">
        <br />
        <form method="POST" action="{{ path('add_company') }}">
            <div class="row">
                <div class="col-md-3">
                    <input class="form-control" type="text" name="company_name" class="form-control"/>
                </div>
                <div class="col-md-2">
                    <input type="submit" class="btn btn-primary" />
                </div>
            </div>
        </form>

        <p class="text-right">{{ form.vars.value.performDate|date('Y-m-d H:i:s') }}</p>
        <form method="POST" action="#">

            <div class="row">
                <div class="col-md-10">
                    <select id="{{ form.company.vars.id }}" name="{{ form.company.vars.full_name }}" class="form-control select2" required>
                        <option></option>
                        {% for company in companies %}
                            <option value="{{ company.id }}" {% if company.id == form.company.vars.value %}selected="selected"{% endif %}>{{ company }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="col-md-2">
                    {{ form_widget(form.billingType, {'attr': {'class': 'form-control'} }) }}
                </div>
            </div>


            <br /><br />
            <table class="table table-striped table-bordered">
                <tr>
                    <th>Ապրանքի անվանում</th>
                    <th>Միավորի գին</th>
                    <th>Զեղչ</th>
                    <th>Քանակը</th>
                    <th>Գումարը</th>
                </tr>

                {% set i = 1 %}
                {% set totalPrice = 0 %}
                {% for priceListProduct in form.priceListProducts %}
                    <tr>
                        <td>
                            {{ priceListProduct.vars.value.product.name }}
                            <input type="hidden" id="{{ priceListProduct.vars.id }}_product" name="{{ priceListProduct.vars.full_name }}[product]" value="{{ priceListProduct.vars.value.product.id }}" />
                        </td>

                        <td class="single_price_{{ i }}">{{ priceListProduct.vars.value.product.price }}</td>
                        <td>
                            <input onkeyup="calculatePrice({{ i }})" type="number" id="{{ priceListProduct.vars.id }}_discount" name="{{ priceListProduct.vars.full_name }}[discount]" min="0" value="{{ priceListProduct.vars.value.discount }}" class="form-control discount_{{ i }}"/>
                        </td>
                        <td>
                            <input onkeyup="calculatePrice({{ i }})" type="number" id="{{ priceListProduct.vars.id }}_quantity" name="{{ priceListProduct.vars.full_name }}[quantity]" min="0" value="{{ priceListProduct.vars.value.quantity }}" class="form-control quantity_{{ i }}"/>
                        </td>

                        {% set price = priceListProduct.vars.value.quantity * priceListProduct.vars.value.product.price %}
                        {% set totalPrice = totalPrice + price %}
                        <td class="price price_{{ i }}">{{ price }}</td>
                    </tr>

                    {% set i = i + 1 %}
                {% endfor %}

                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>Ընդհանուր գումարը</td>
                    <td class="total_price">{{ totalPrice }}</td>
                </tr>

            </table>

            <strong>Զրոյական ապրանքներ</strong>
            {% for i in 0..2 %}
                <div class="row">
                    <div class="col-md-5">
                        <select name="zero_products[{{ i }}]" class="form-control select2">
                            <option></option>

                            {% for priceListProduct in form.priceListProducts %}
                                <option value="{{ priceListProduct.vars.value.product.id }}">{{ priceListProduct.vars.value.product.name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <div class="col-md-2">
                        <input type="number" min="0" name="zero_products_count[{{ i }}]" class="form-control" />
                    </div>
                </div>
            {% endfor %}

            <br/>

            {{ form_widget(form.comment, {'attr': {'class': 'form-control'} }) }}

            <br />

            {{ form_widget(form._token) }}
            <input type="submit" class="btn btn-primary" />
        </form>
    </div>
{% endblock %}


{% block javascripts %}
    {{ parent() }}
    <script src="{{ asset('/bundles/app/js/calculatePrice.js') }}"></script>
    <script src="{{ asset('/bundles/app/select2/js/select2.min.js') }}"></script>
    <script type="text/javascript">
        $('.select2').select2();
    </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.1702471482889734, 'fraction_numerical': 0.004372623574144487, 'mean_word_length': 1.401506505364072, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '130368', 'n_tokens_mistral': 3119, 'n_tokens_neox': 2873, 'n_words': 537}