{% load django_ledger %}
<div class="box content">
    <h2 class="has-text-weight-light has-text-centered">
        Financial Analysis
    </h2>
    <h4>Solvency:</h4>
    <h5 class="has-text-weight-light">
        Current
        Ratio: {{ tx_digest.ratios.current_ratio | currency_format }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.current_ratio | fin_ratio_threshold_class:'current_ratio' }}"
              value="{{ tx_digest.ratios.current_ratio }}"
              max="{% fin_ratio_max_value ratio='current_ratio' %}">
        {{ tx_digest.ratios.current_ratio }}
    </progress>
    <h5 class="has-text-weight-light">
        Quick
        Ratio: {{ tx_digest.ratios.quick_ratio | currency_format }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.quick_ratio | fin_ratio_threshold_class:'quick_ratio' }}"
              value="{{ tx_digest.ratios.quick_ratio }}"
              max="{% fin_ratio_max_value ratio='quick_ratio' %}">
        {{ tx_digest.ratios.current_ratio }}
    </progress>
    <h4>Leverage:</h4>
    <h5 class="has-text-weight-light">
        Debt to
        Equity: {{ tx_digest.ratios.debt_to_equity | currency_format }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.debt_to_equity | fin_ratio_threshold_class:'debt_to_equity' }}"
              value="{{ tx_digest.ratios.debt_to_equity }}"
              max="{% fin_ratio_max_value ratio='debt_to_equity' %}">
        {{ tx_digest.ratios.debt_to_equity }}
    </progress>
    <h4>Profitability:</h4>
    <h5 class="has-text-weight-light">
        Return on
        Equity: {{ tx_digest.ratios.return_on_equity | percentage }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.quick_ratio | fin_ratio_threshold_class:'quick_ratio' }}"
              value="{{ tx_digest.ratios.return_on_equity }}"
              max="{% fin_ratio_max_value ratio='return_on_equity' %}">
        {{ tx_digest.ratios.return_on_equity }}
    </progress>
    <h5 class="has-text-weight-light">
        Return on
        Assets: {{ tx_digest.ratios.return_on_assets | percentage }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.return_on_assets | fin_ratio_threshold_class:'return_on_assets' }}"
              value="{{ tx_digest.ratios.return_on_assets }}"
              max="{% fin_ratio_max_value ratio='return_on_assets' %}">
        {{ tx_digest.ratios.return_on_assets }}
    </progress>
    <h5 class="has-text-weight-light">
        Net Profit
        Margin: {{ tx_digest.ratios.net_profit_margin | percentage }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.net_profit_margin | fin_ratio_threshold_class:'net_profit_margin' }}"
              value="{{ tx_digest.ratios.net_profit_margin }}"
              max="{% fin_ratio_max_value ratio='net_profit_margin' %}">
        {{ tx_digest.ratios.net_profit_margin }}
    </progress>
    <h5 class="has-text-weight-light">
        Gross Profit
        Margin: {{ tx_digest.ratios.gross_profit_margin | percentage }}
    </h5>
    <progress class="progress {{ tx_digest.ratios.gross_profit_margin | fin_ratio_threshold_class:'gross_profit_margin' }}"
              value="{{ tx_digest.ratios.gross_profit_margin }}"
              max="{% fin_ratio_max_value ratio='gross_profit_margin' %}">
        {{ tx_digest.ratios.gross_profit_margin }}
    </progress>
</div>
