cityssm/lottery-licence-manager

View on GitHub
views/event-financials.ejs

Summary

Maintainability
Test Coverage
<%- include('_header'); -%>

<div class="columns is-variable is-4-mobile is-4-tablet is-block-print" id="is-site-layout">
  <%- include("_sideMenu-events"); -%>
  <div class="column is-block-print is-full-print">
    <nav class="breadcrumb">
      <ul>
        <li><a href="<%= urlPrefix %>/dashboard">Home</a></li>
        <li><a href="<%= urlPrefix %>/events">
          <span class="icon is-small"><i class="fas fa-calendar" aria-hidden="true"></i></span>
          <span>Lottery Events</span>
        </a></li>
        <li class="is-active"><a href="#" aria-current="page">Financial Summary</a></li>
      </ul>
    </nav>

    <h1 class="title is-1">
      Financial Summary Report
    </h1>

    <div class="box">
      <form id="form--financialSummary">
        <%- include('_dateRangeSelector', {
          fieldKey: "eventDate",
          fieldName: "Event Date",
          yearMin: eventYearMin,
          startValue: eventDateStartString,
          endValue: eventDateEndString
        }); -%>
      </form>
    </div>

    <table class="table is-fullwidth is-striped is-hoverable has-status-loading has-sticky-header" id="table--financialSummary">
      <thead>
        <tr>
          <th>Licence Type</th>
          <th class="has-text-right">Licence Count</th>
          <th class="has-text-right has-border-right-width-2">Events Reported</th>
          <th class="has-text-right">Receipts</th>
          <th class="has-width-1"><i class="fas fa-minus" aria-hidden="true"></i></th>
          <th class="has-text-right">Administration</th>
          <th class="has-width-1"><i class="fas fa-minus" aria-hidden="true"></i></th>
          <th class="has-text-right">Prizes Awarded</th>
          <th class="has-width-1"><i class="fas fa-equals" aria-hidden="true"></i></th>
          <th class="has-text-right has-border-right-width-2">Net Proceeds</th>
          <th class="has-text-right has-border-right-width-2">Prize Amount Donated</th>
          <th class="has-text-right">Licence Fee</th>
        </tr>
      </thead>
      <tbody>
        <%
          const licenceTypes = configFunctions.getProperty("licenceTypes");

          for (let index = 0; index < licenceTypes.length; index += 1) {
            const licenceTypeObj = licenceTypes[index];
        %>
          <tr data-licence-type-key="<%= licenceTypeObj.licenceTypeKey %>">
            <th scope="row"><%= licenceTypeObj.licenceType %></th>
            <td class="has-text-right is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="licenceCount"></span>
            </td>
            <td class="has-text-right has-border-right-width-2 is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="eventCount"></span>
            </td>
            <td class="has-text-right is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="costs_receiptsSum"></span>
            </td>
            <td><i class="fas fa-minus" aria-hidden="true"></i></td>
            <td class="has-text-right is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="costs_adminSum"></span>
            </td>
            <td><i class="fas fa-minus" aria-hidden="true"></i></td>
            <td class="has-text-right is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="costs_prizesAwardedSum"></span>
            </td>
            <td><i class="fas fa-equals" aria-hidden="true"></i></td>
            <td class="has-text-right has-border-right-width-2 is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="costs_netProceedsSum"></span>
            </td>
            <td class="has-text-right has-border-right-width-2 is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="costs_amountDonatedSum"></span>
            </td>
            <td class="has-text-right is-nowrap">
              <span class="is-hidden-status-view has-text-grey-lighter">
                <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
              </span>
              <span class="is-hidden-status-loading" data-field="licenceFeeSum"></span>
            </td>
          </tr>
        <%
          }
        %>
      </tbody>
      <tfoot id="tfoot--financialSummary">
        <tr>
          <th>Total</th>
          <td class="has-text-right is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="licenceCount"></span>
          </td>
          <td class="has-text-right has-border-right-width-2 is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="eventCount"></span>
          </td>
          <td class="has-text-right is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="costs_receiptsSum"></span>
          </td>
          <td><i class="fas fa-minus" aria-hidden="true"></i></td>
          <td class="has-text-right is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="costs_adminSum"></span>
          </td>
          <td><i class="fas fa-minus" aria-hidden="true"></i></td>
          <td class="has-text-right is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="costs_prizesAwardedSum"></span>
          </td>
          <td><i class="fas fa-equals" aria-hidden="true"></i></td>
          <td class="has-text-right has-border-right-width-2 is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="costs_netProceedsSum"></span>
          </td>
          <td class="has-text-right has-border-right-width-2 is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="costs_amountDonatedSum"></span>
          </td>
          <td class="has-text-right is-nowrap">
            <span class="is-hidden-status-view has-text-grey-lighter">
              <i class="fas fa-circle-notch fa-spin" aria-hidden="true"></i>
            </span>
            <span class="is-hidden-status-loading" data-field="licenceFeeSum"></span>
          </td>
        </tr>
      </tfoot>
    </table>

  </div>
</div>

<%- include('_footerA'); -%>

<script src="<%= urlPrefix %>/javascripts/event-financials.min.js"></script>

<%- include('_footerB'); -%>