{% load i18n %}
{% load humanize %}
{% load evelinks %}

<!--##############################DAILY#######################-->
<div class="tab-pane panel panel-default" id="tab-daily">
    <div class="card-body modal-tab">
        {% include "ledger/partials/information/day.html" with character=character mode=mode %}

        {% for key, label in character.income_types %}
            {% with value=character|get_item:key %}
                {% if value %}
                    <div class="row description-row">
                        <div class="col-sm-6 {% if label == 'Not Defined Category' %}text-warning{% endif %}">{% trans "Avg." %} {{ label }} {% trans "per Day" %}:</div>
                        <div class='col-sm-4 text-end'>
                            <span class="{% if not key == 'mining_income' %}text-success{% else %}text-info{% endif %}">
                                {{ value.average_day|floatformat:0|intcomma }}
                            </span> ISK
                        </div>
                    </div>
                {% endif %}
            {% endwith %}
        {% endfor %}

        <!--############################## Costs #######################-->

        {% for key, label in character.cost_types %}
            {% with value=character|get_item:key %}
                {% if value %}
                    <div class="row description-row">
                        <div class="col-sm-6 {% if label == 'Not Defined Category' %}text-warning{% endif %}">{% trans "Avg." %} {{ label }} {% trans "Cost per Day" %}:</div>
                        <div class='col-sm-4 text-end'>
                            <span class="text-danger">{{ value.average_day|floatformat:0|intcomma }}</span> ISK
                        </div>
                    </div>
                {% endif %}
            {% endwith %}
        {% endfor %}

        <!--############################## SUMMARY DAILY #######################-->
        {% if character.summary.total_amount_day %}
            <hr>
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Summary Day" %}:</div>
                <div class='col-sm-4 text-end'>
                    <span class="{% if character.summary.total_amount_day < 0 %}text-danger{% else %}text-success{% endif %}">



                     {{ character.summary.total_amount_day|floatformat:0|intcomma }}
                    </span> ISK
                </div>
            </div>
        {% endif %}
    </div>
</div>
