LocalGovIMS_localgov-ims/src/Admin/Views/Transaction/_PaymentsList.cshtml
@model Admin.Models.Transaction.DetailsViewModel
<div class="table-responsive">
    <table class="table table-striped table-bordered mt-2 ui-payments-table">
        <thead>
            <tr>
                <th scope="col">Type</th>
                <th scope="col">Account</th>
                <th scope="col">Narrative</th>
                <th scope="col">VAT (£)</th>
                <th scope="col">Amount (£)</th>
                <th scope="col"><span class="visually-hidden">Actions</span></th>
            </tr>
        </thead>
        <tbody>
            @foreach (var transactionLine in Model.Transaction.TransactionLines)
            {
                <tr>
                    <td>@(transactionLine.Fund != null ? string.Format("{0} ({1})", transactionLine.Fund.FundName, transactionLine.Fund.FundCode) : "")</td>
                    <td>@transactionLine.AccountReference</td>
                    <td>@transactionLine.Narrative @transactionLine.AppReference</td>
                    <td class="text-end">@Html.ToCurrency(transactionLine.VatAmount) (@transactionLine.VatCode)</td>
                    <td class="text-end @if (transactionLine.Amount < 0) { @Html.Raw("td--negative") }">
                        @Html.ToCurrency(transactionLine.Amount)
                    </td>
                    <td class="text-end">
                        @if (User.IsInRole(Role.TransactionJournal)
                            && Model.IsRefund == false
                            && Model.Transaction.AmountAvailableToTransferOrRefundForTransactionLine(transactionLine.TransactionReference) > 0)
                        {
                            <a href="#" class="btn btn-secondary transfer"
                               data-id="@transactionLine.TransactionReference"
                               data-amount="@transactionLine.Amount"
                               data-amount-available-to-transfer="@Model.Transaction.AmountAvailableToTransferOrRefundForTransactionLine(transactionLine.TransactionReference)"
                               data-bs-toggle="modal" data-bs-target="#transferModal">Create journal</a>
                        }
                    </td>
                </tr>
            }
        </tbody>
    </table>
</div>