@if(empty($isDelete))
<form role="form" id="form-paid-full">
    <div class="form-body">
        <div class="row">
            <div class="col-md-6">
                <div class="form-group">

                    <label>Hình thức thanh toán </label>
                    <select class="form-control" name="payment_method">

                        <option value="{{ \App\Models\CollectSpend::MONEY }}">Tiền mặt</option>
                        <option value="{{ \App\Models\CollectSpend::BANK }}" selected>Chuyển khoản</option>
                    </select>

                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>Ngày thanh toán</label>
                    <input type="text" class="form-control datepicker" name="date_action" value="{{ \Carbon\Carbon::now()->format('d/m/Y') }}">
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <div class="form-group">

                    <label>Điền số tiền </label>
                    <input class="form-control price-r" name="amount" value="@if(isset($amount)){{ $amount }}@endif">

                </div>
            </div>
        </div>

        @foreach($ids as $id)
            <input type="hidden" name="id[]" value="{{ $id }}">
        @endforeach

    </div>
</form>
@else
    <div class="alert alert-danger">
        <strong>CẢNH BÁO:</strong> HÓA ĐƠN TIỀN PHÒNG XÓA ĐI SẼ MẤT HOÀN TOÀN TRÊN HỆ THỐNG VÀ KHÔNG THỂ KHÔI PHỤC. BẠN CÓ CHẮC CHẮC MUỐN XÓA KHÔNG ? </div>
    @endif
<div class="row">
    <div class="col-md-12">
        <table class="table table-striped table-bordered table-hover">
            <tr>

                <th>Nội dung</th>
                <th>Mã</th>
                <th>Nhà</th>
                <th>Phòng</th>
                <th>Khách</th>
                <th>Số tiền</th>
                <th>Đã trả</th>
                <th>Giảm giá</th>
                <th>Còn lại</th>
                <th></th>

            </tr>

            @foreach($moneyInfos as $moneyInfo)
                <tr>
                    <td>{{ $moneyInfo->money_info_name }}</td>
                    <td>{{ $moneyInfo->name }}</td>
                    <td>{{ optional($moneyInfo->hostel)->name }}</td>
                    <td>{{ optional($moneyInfo->room)->name }}</td>
                    <td>{{ optional($moneyInfo->contract)->name }}</td>
                    <td>{{ number_format($moneyInfo->amount, 0, '.', '.') }}</td>
                    <td>{{ number_format($moneyInfo->pay, 0, '.', '.') }}</td>
                    <td>{{ number_format($moneyInfo->discount, 0, '.', '.') }}</td>
                    <td>{{ number_format($moneyInfo->remain, 0, '.', '.') }}</td>

                    <td>
                        @if(empty($isDelete))
                            @if(auth('backend')->user()->can('view-money-info'))
                        <a data-id="{{ $moneyInfo->id }}" data-toggle="modal" href="#detail-money-info"
                           class="btn btn-icon-only red detail-money" data-toggle="tooltip"><i class="fa fa-eye"></i></a>
                            @endif
                        <a target="_blank" data-money-info="{{ $moneyInfo->id }}" data-date="{{ $moneyInfo->date_action->format('m/Y') }}" class="print-money-info btn btn-icon-only detail-money  green">
                            <i class="fa fa-print"></i></a>
                                @if(auth('backend')->user()->can('view-payment-history'))
                        <a data-room="{{ $moneyInfo->room_id }}" data-id="{{ $moneyInfo->id }}" data-toggle="modal" href="#transaction-history" class="btn btn-icon-only btn-transaction-history dark">
                            <i class="fa fa-money"></i> </a>
                                    @endif
                        @else
                        <a data-money-info="{{ $moneyInfo->id }}" data-date="{{ $moneyInfo->date_action->format('m/Y') }}" class="delete-voucher btn btn-icon-only btn-editable red">
                            <i class="fa fa-trash"></i> </a>
                            @endif
                    </td>
                </tr>
            @endforeach

        </table>
    </div>
</div>
