dotledger/dotledger

View on GitHub
app/assets/javascripts/dot_ledger/templates/reports/income_and_expenses/table.jst.ejs

Summary

Maintainability
Test Coverage
<% _.each(categoryTypes(), function(type) { %>
  <table class="table">
    <thead>
      <tr>
        <th colspan="3">
          <h3><%= type.label %></h3>
        </th>
      </tr>

      <tr>
        <th>Category</th>
        <th class="amount">Spent</th>
        <th class="amount">Received</th>
      </tr>
    </thead>

    <tbody id="<%= type.id %>"></tbody>

    <tfoot>
      <tr>
        <th>Subtotal</th>
        <th class="amount"><%= spentAmountSubTotal(type.label) %></th>
        <th class="amount"><%= receivedAmountSubTotal(type.label) %></th>
      </tr>
    </tfoot>
  </table>
  <hr>
<% }) %>

<table class="table">
  <tfoot>
    <tr>
      <th>Total</th>
      <th class="amount"><%= spentAmountTotal() %></th>
      <th class="amount"><%= receivedAmountTotal() %></th>
    </tr>
  </tfoot>
</table>