<commit_before>{% form_theme form with ['bootstrap_3_horizontal_layout.html.twig', _self] %}
<div class="hidden">
{% block form_label_class -%}
    col-sm-4
{%- endblock form_label_class %}
{% block form_group_class -%}
    col-sm-8
{%- endblock form_group_class %}
</div>
<div class="row">
    <h1>UNIT PROFIT REPORT</h1>


    <div class="col-md-7">
        {{ form_row(form.Vendor) }}
        {{ form_row(form.sales_person) }}
    </div>
    <div class="col-md-5">
        {{ form_row(form.stock_nr) }}
        {{ form_row(form.vin) }}
    </div>
    <div class="col-md-4">
        {{ form_row(form.invoice_nr) }}
        {{ form_row(form.invoice_date) }}
        {{ form_row(form.invoica_amt, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.related_taxes_1, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.related_taxes_2, {'attr': {'class': 'sum1'}}) }}
    </div>
    <div class="clearfix"></div>
    <div class="col-md-4">
        <h2>UNIT COST RECAP</h2>

        {{ form_row(form.delivery, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.clear_up, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.glass, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.mechanical_1, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.mechanical_2, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.other_exp_1, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.other_exp_2, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.other_exp_3, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.other_exp_4, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.other_exp_5, {'attr': {'class': 'sum1'}}) }}
        {{ form_row(form.total_unit_cost, {'attr': {'style': 'background-color: lightgray'}}) }}
        {{ form_row(form.net_grain, {'attr': {'style': 'background-color: lightgray'}}) }}

        <h2>SALES COST RECAP</h2>

        {{ form_row(form.protect_pkg, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.warranty, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.doc_fees, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.admin_fees, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.insurance, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.life_ins, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.disability_ins, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.feverse, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.misc_1, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.misc_2, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.misc_3, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.sales_comms, {'attr': {'class': 'sum2'}}) }}
        {{ form_row(form.total_sale_cost, {'attr': {'style': 'background-color: lightgray'}}) }}
    </div>
    <div class="col-md-4">
        <div style="margin-top: 160px"></div>
        {{ form_row(form.discrip1) }}
        {{ form_row(form.discrip2) }}
        {{ form_row(form.discrip3) }}
        {{ form_row(form.discrip4) }}
        {{ form_row(form.discrip5) }}
        {{ form_row(form.discrip6) }}
        {{ form_row(form.discrip7) }}

        <h2>TAXES</h2>

        {{ form_row(form.tax_1_out) }}
        {{ form_row(form.tax_2_out) }}
        {{ form_row(form.trade_in_tax) }}
        {{ form_row(form.tax_1_in) }}
        {{ form_row(form.tax_2_in) }}
        {{ form_row(form.net_tax, {'attr': {'style': 'background-color: lightgray'}}) }}
    </div>
    <div class="col-md-4">
        <h2>UNIT REVENUE</h2>

        {{ form_row(form.selling_price, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.trade_in, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.warranty1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.life_insur, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.disability_ins1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.admin_fees1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.doc_fees1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.protect_pkg1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.insurance1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.bank_commis, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.other_1, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.other_2, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.other_3, {'attr': {'class': 'sum4'}}) }}
        {{ form_row(form.total_revenue) }}
        {{ form_row(form.revenue_this_unit, {'attr': {'style': 'background-color: lightgray'}}) }}
        {#{{ form_row(form.item_id) }}#}
    </div>
</div>
    <div class="clearfix"></div>

    <script>
        $('.sum1').keyup(function () {
            var sum = 0;
            $('.sum1').each(function() {
                sum += Number($(this).val());
            });

            $('#numa_doaadminbundle_item_sale_total_unit_cost').val(sum);
        });

        $('.sum2').keyup(function () {
            var sum2 = 0;
            $('.sum2').each(function() {
                sum2 += Number($(this).val());
            });
            $('#numa_doaadminbundle_item_sale_total_sale_cost').val(sum2);
        });

        $('.form-control').keyup(function () {
            var n1 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_1_out").value);
            var n2 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_2_out").value);
            var n3 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_trade_in_tax").value);
            var n4 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_1_in").value);
            var n5 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_2_in").value);
            if(isNaN(parseFloat(n1))){
                n1 = 0;
            }
            if(isNaN(parseFloat(n2))){
                n2 = 0;
            }
            if(isNaN(parseFloat(n3))){
                n3 = 0;
            }
            if(isNaN(parseFloat(n4))){
                n4 = 0;
            }
            if(isNaN(parseFloat(n5))){
                n5 = 0;
            }

            $('#numa_doaadminbundle_item_sale_net_tax').val((n1+n2+n3) - (n4+n5));
        });

        $('.form-control').keyup(function () {
            var n1 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_total_unit_cost").value);
            var n2 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_selling_price").value);
            var n3 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_trade_in").value);
            if(isNaN(parseFloat(n1))){
                n1 = 0;
            }
            if(isNaN(parseFloat(n2))){
                n2 = 0;
            }
            if(isNaN(parseFloat(n3))){
                n3 = 0;
            }
            $('#numa_doaadminbundle_item_sale_net_grain').val((n2+n3) - n1);
        });

        $('.sum4').keyup(function () {
            var sum4 = 0;
            $('.sum4').each(function() {
                sum4 += Number($(this).val());
            });
            $('#numa_doaadminbundle_item_sale_total_revenue').val(sum4);
            $('#numa_doaadminbundle_item_sale_revenue_this_unit').val(sum4);
        });
    </script>

<commit_msg>sale table added<commit_after>{% form_theme form with ['bootstrap_3_horizontal_layout.html.twig', _self] %}
<div class="hidden">
{% block form_label_class -%}
    col-sm-12
{%- endblock form_label_class %}
{% block form_group_class -%}
    col-sm-12
{%- endblock form_group_class %}
</div>
<div class="row">
    <h1>UNIT PROFIT REPORT</h1>
    <table cellspacing="0" width="100%" border="0">
        <tr>
            <td colspan="3">
                {{ form_row(form.Vendor) }}
            </td>
            <td colspan="3">
                {{ form_row(form.stock_nr) }}
            </td>
        </tr>
        <tr>
            <td colspan="3">
                {{ form_row(form.sales_person) }}
            </td>
            <td colspan="3">
                {{ form_row(form.vin) }}
            </td>
        </tr>
        <tr>
            <td>{{ form_label(form.invoice_nr) }}</td>
            <td>{{ form_widget(form.invoice_nr) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.invoice_date) }}</td>
            <td>{{ form_widget(form.invoice_date) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.invoica_amt) }}</td>
            <td>{{ form_widget(form.invoica_amt, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.related_taxes_1) }}</td>
            <td>{{ form_widget(form.related_taxes_1, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.related_taxes_2) }}</td>
            <td>{{ form_widget(form.related_taxes_2, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td colspan="2"><h2>UNIT COST RECAP</h2></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td colspan="2"><h2>UNIT REVENUE</h2></td>
        </tr>
        <tr>
            <td>{{ form_label(form.delivery) }}</td>
            <td>{{ form_widget(form.delivery, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td>{{ form_label(form.selling_price) }}</td>
            <td>{{ form_widget(form.selling_price, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.clear_up) }}</td>
            <td>{{ form_widget(form.clear_up, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td>{{ form_label(form.trade_in) }}</td>
            <td>{{ form_widget(form.trade_in, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.glass) }}</td>
            <td>{{ form_widget(form.glass, {'attr': {'class': 'sum1'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td>{{ form_label(form.warranty1) }}</td>
            <td>{{ form_widget(form.warranty1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.mechanical_1) }}</td>
            <td>{{ form_widget(form.mechanical_1, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip1) }}</td>
            <td>{{ form_widget(form.discrip1) }}</td>
            <td>{{ form_label(form.life_insur) }}</td>
            <td>{{ form_widget(form.life_insur, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.mechanical_2) }}</td>
            <td>{{ form_widget(form.mechanical_2, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip2) }}</td>
            <td>{{ form_widget(form.discrip2) }}</td>
            <td>{{ form_label(form.disability_ins1) }}</td>
            <td>{{ form_widget(form.disability_ins1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.other_exp_1) }}</td>
            <td>{{ form_widget(form.other_exp_1, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip3) }}</td>
            <td>{{ form_widget(form.discrip3) }}</td>
            <td>{{ form_label(form.admin_fees1) }}</td>
            <td>{{ form_widget(form.admin_fees1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.other_exp_2) }}</td>
            <td>{{ form_widget(form.other_exp_2, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip4) }}</td>
            <td>{{ form_widget(form.discrip4) }}</td>
            <td>{{ form_label(form.doc_fees1) }}</td>
            <td>{{ form_widget(form.doc_fees1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.other_exp_3) }}</td>
            <td>{{ form_widget(form.other_exp_3, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip5) }}</td>
            <td>{{ form_widget(form.discrip5) }}</td>
            <td>{{ form_label(form.protect_pkg1) }}</td>
            <td>{{ form_widget(form.protect_pkg1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.other_exp_4) }}</td>
            <td>{{ form_widget(form.other_exp_4, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip6) }}</td>
            <td>{{ form_widget(form.discrip6) }}</td>
            <td>{{ form_label(form.insurance1) }}</td>
            <td>{{ form_widget(form.insurance1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.other_exp_5) }}</td>
            <td>{{ form_widget(form.other_exp_5, {'attr': {'class': 'sum1'}}) }}</td>
            <td>{{ form_label(form.discrip7) }}</td>
            <td>{{ form_widget(form.discrip7) }}</td>
            <td>{{ form_label(form.bank_commis) }}</td>
            <td>{{ form_widget(form.bank_commis, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.total_unit_cost) }}</td>
            <td>{{ form_widget(form.total_unit_cost, {'attr': {'style': 'background-color: lightgray'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td>{{ form_label(form.other_1) }}</td>
            <td>{{ form_widget(form.other_1, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.net_grain) }}</td>
            <td>{{ form_widget(form.net_grain, {'attr': {'style': 'background-color: lightgray'}}) }}</td>
            <td colspan="2"><h2>TAXES</h2></td>
            <td>{{ form_label(form.other_2) }}</td>
            <td>{{ form_widget(form.other_2, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td colspan="2"><h2>SALES COST RECAP</h2></td>
            <td>{{ form_label(form.tax_1_out) }}</td>
            <td>{{ form_widget(form.tax_1_out) }}</td>
            <td>{{ form_label(form.other_3) }}</td>
            <td>{{ form_widget(form.other_3, {'attr': {'class': 'sum4'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.protect_pkg) }}</td>
            <td>{{ form_widget(form.protect_pkg, {'attr': {'class': 'sum2'}}) }}</td>
            <td>{{ form_label(form.tax_2_out) }}</td>
            <td>{{ form_widget(form.tax_2_out) }}</td>
            <td>{{ form_label(form.total_revenue) }}</td>
            <td>{{ form_widget(form.total_revenue) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.warranty) }}</td>
            <td>{{ form_widget(form.warranty, {'attr': {'class': 'sum2'}}) }}</td>
            <td>{{ form_label(form.trade_in_tax) }}</td>
            <td>{{ form_widget(form.trade_in_tax) }}</td>
            <td>{{ form_label(form.revenue_this_unit) }}</td>
            <td>{{ form_widget(form.revenue_this_unit, {'attr': {'style': 'background-color: lightgray'}}) }}</td>
        </tr>
        <tr>
            <td>{{ form_label(form.doc_fees) }}</td>
            <td>{{ form_widget(form.doc_fees, {'attr': {'class': 'sum2'}}) }}</td>
            <td>{{ form_label(form.tax_1_in) }}</td>
            <td>{{ form_widget(form.tax_1_in) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.admin_fees) }}</td>
            <td>{{ form_widget(form.admin_fees, {'attr': {'class': 'sum2'}}) }}</td>
            <td>{{ form_label(form.tax_2_in) }}</td>
            <td>{{ form_widget(form.tax_2_in) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.insurance) }}</td>
            <td>{{ form_widget(form.insurance, {'attr': {'class': 'sum2'}}) }}</td>
            <td>{{ form_label(form.net_tax) }}</td>
            <td>{{ form_widget(form.net_tax, {'attr': {'style': 'background-color: lightgray'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.life_ins) }}</td>
            <td>{{ form_widget(form.life_ins, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.disability_ins) }}</td>
            <td>{{ form_widget(form.disability_ins, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.feverse) }}</td>
            <td>{{ form_widget(form.feverse, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.misc_1) }}</td>
            <td>{{ form_widget(form.misc_1, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.misc_2) }}</td>
            <td>{{ form_widget(form.misc_2, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.misc_3) }}</td>
            <td>{{ form_widget(form.misc_3, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.sales_comms) }}</td>
            <td>{{ form_widget(form.sales_comms, {'attr': {'class': 'sum2'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
        <tr>
            <td>{{ form_label(form.total_sale_cost) }}</td>
            <td>{{ form_widget(form.total_sale_cost, {'attr': {'style': 'background-color: lightgray'}}) }}</td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
            <td width="165px"></td>
        </tr>
    </table>

    <script>
        $('.form-control').keyup(function () {
            var sum = 0;
            $('.sum1').each(function() {
                sum += Number($(this).val());
            });

            $('#numa_doaadminbundle_item_sale_total_unit_cost').val(sum);
        });

        $('.form-control').keyup(function () {
            var sum2 = 0;
            $('.sum2').each(function() {
                sum2 += Number($(this).val());
            });
            $('#numa_doaadminbundle_item_sale_total_sale_cost').val(sum2);
        });

        $('.form-control').keyup(function () {
            var n1 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_1_out").value);
            var n2 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_2_out").value);
            var n3 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_trade_in_tax").value);
            var n4 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_1_in").value);
            var n5 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_tax_2_in").value);
            if(isNaN(parseFloat(n1))){
                n1 = 0;
            }
            if(isNaN(parseFloat(n2))){
                n2 = 0;
            }
            if(isNaN(parseFloat(n3))){
                n3 = 0;
            }
            if(isNaN(parseFloat(n4))){
                n4 = 0;
            }
            if(isNaN(parseFloat(n5))){
                n5 = 0;
            }

            $('#numa_doaadminbundle_item_sale_net_tax').val((n1+n2+n3) - (n4+n5));
        });

        $('.form-control').keyup(function () {
            var n1 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_total_unit_cost").value);
            var n2 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_selling_price").value);
            var n3 = parseFloat(document.getElementById("numa_doaadminbundle_item_sale_trade_in").value);
            if(isNaN(parseFloat(n1))){
                n1 = 0;
            }
            if(isNaN(parseFloat(n2))){
                n2 = 0;
            }
            if(isNaN(parseFloat(n3))){
                n3 = 0;
            }
            $('#numa_doaadminbundle_item_sale_net_grain').val((n2+n3) - n1);
        });

        $('.form-control').keyup(function () {
            var sum4 = 0;
            $('.sum4').each(function() {
                sum4 += Number($(this).val());
            });
            $('#numa_doaadminbundle_item_sale_total_revenue').val(sum4);
            $('#numa_doaadminbundle_item_sale_revenue_this_unit').val(sum4);
        });
    </script>


{'fraction_non_alphanumeric': 0.21792205443530158, 'fraction_numerical': 0.024550140157337915, 'mean_word_length': 2.127244450728121, 'pattern_counts': {'":': 0, '<': 506, '<?xml version=': 0, '>': 506, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1459655', 'n_tokens_mistral': 8077, 'n_tokens_neox': 7636, 'n_words': 1164}