{% load i18n %}
{% load static %}
{% load humanize %}
{% load evelinks %}
{% load ledger %}

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

        {% if character.bounty_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Ratting" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.bounty_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} Tick {% trans "Ratting" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-warning">{{ character.bounty_income.average_day_tick|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.ess_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} ESS {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.ess_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.stolen.average_day %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Stolen" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-warning">{{ character.stolen.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.mission_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Mission Reward" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.mission_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.mining %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Mining" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.mining.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.incursion_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Incursion" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.incursion_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        <!--############################## Misc #######################-->

        {% if character.market_income %}
            <hr>
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Market" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.market_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.contract_income %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Contract" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-success">{{ character.contract_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.donation_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Donation" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.donation_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.insurance_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Insurance" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.insurance_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.milestone_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Corp Project" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.milestone_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.daily_goal_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Daily Goal" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.daily_goal_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.citadel_income %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Citadel" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-success">{{ character.citadel_income.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        <!--############################## COSTS #######################-->

        {% if character.production_cost or character.market_cost or character.contract_cost or character.asset_cost or character.traveling_cost %}
            <hr>
        {% endif %}

        {% if character.market_cost %}
            <div class="row description-row">
                <div class="col-sm-6">{% trans "Avg." %} {% trans "Market Cost" %} {% trans "per Day" %}:</div>
                <div class='col-sm-4 text-end'><span class="text-danger">{{ character.market_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
            </div>
        {% endif %}

        {% if character.contract_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Contract Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.contract_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.lp_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Loyality Point Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.lp_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.production_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Production Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.production_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.traveling_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Traveling Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.traveling_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.asset_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Asset Safety Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.asset_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.skill_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Skillbook Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.skill_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.insurance_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Insurance Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.insurance_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}

        {% if character.planetary_cost %}
                <div class="row description-row">
                    <div class="col-sm-6">{% trans "Avg." %} {% trans "Planetary Cost" %} {% trans "per Day" %}:</div>
                    <div class='col-sm-4 text-end'><span class="text-danger">{{ character.planetary_cost.average_day|floatformat:0|intcomma }}</span> ISK</div>
                </div>
        {% endif %}
<!--############################## SUMMARY DAILY #######################-->
        {% if character.date %}
            <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>
