﻿@page
@model MyBudgetExplorer.Pages.Budget.IncomeModel
@foreach (var income in Model.Income)
{
    <table class="table table-striped table-bordered table-sm table-hover">
        <thead class="thead-light">
            <tr>
                <th scope="col" colspan="2" style="text-align:center">Current Funding: @income.CurrentFundingPercentage%</th>
                <th scope="col" colspan="2" style="text-align:center">Future Funding: @income.FutureFundingPercentage%</th>
            </tr>
            <tr>
                <th scope="col" width="15%">Date</th>
                <th scope="col" width="35%">Payee</th>
                <th scope="col" width="35%">Category</th>
                <th scope="col" width="15%" style="text-align: right">Amount</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td scope="row" style="font-weight: bold">@income.Date</td>
                <td style="font-weight: bold">@income.Payee</td>
                <td style="font-weight: bold">[To Be Budgeted]</td>
                <td style="font-weight: bold" align="right">@income.Amount</td>
            </tr>
            @foreach (var projected in income.Projected)
            {
                <tr>
                    <td scope="row">@projected.Date</td>
                    <td>@projected.Payee</td>
                    <td>@projected.Category</td>
                    <td align="right">@projected.Amount</td>
                </tr>
            }
        </tbody>
        <tfoot class="bg-warning">
            @if (!string.IsNullOrWhiteSpace(income.Available))
            {
                <tr>
                    <td style="font-weight: bold">@income.Date</td>
                    <td style="font-weight: bold">[Remaining Funds]</td>
                    <td></td>
                    <td style="font-weight: bold" align="right">@income.Available</td>
                </tr>
            }
        </tfoot>
    </table>
    <br />
}