<div class="row">
    <div class="col-md-12">

        <h5 class="text-center"></h5>

    </div>
</div>
<div class="table-scrollable">
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <th> STT</th>
            <th>Ngày thanh toán</th>
            <th>Người nộp tiền</th>
            <th> Số tiền</th>
            <th> Ghi chú</th>
            <th> Thao tác</th>
        </tr>
        </thead>

        <tbody id="table-paid-history">
        @foreach($items as $item)
            <tr>
                <td> {{ $loop->index + 1 }} </td>
                <td> {{ $item->date_action->format('d/m/Y') }} </td>
                <td> {{ $item->payer }} </td>
                <td>{{ number_format($item->amount, 0, '.', '.') }}</td>
                <td> {{ $item->note }} </td>
                <td>
                    @if($loop->last)
                        @php if($item->moneyInfo) {
                            $contract = $item->moneyInfo->contract;
                        } else {
                        $contract = null;}
                        @endphp

                        @if($contract)
                            @if($contract->status != \App\Models\Contract::LIQUIDATED)


                                <a href="#" class="btn btn-sm btn-default btn-edit-payment"
                                   data-payment="{{ $item->id }}"><i
                                            class="fa fa-pencil"></i> Điều chỉnh</a>
                            @endif
                        @else
                            <a href="#" class="btn btn-sm btn-default btn-edit-payment"
                               data-payment="{{ $item->id }}"><i
                                        class="fa fa-pencil"></i> Điều chỉnh</a>
                            @endif
                    @endif
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>
</div>

