@extends ('layouts/template')

@section('content')

    <div id="practice-bills" class="p-3 mcp-theme-1">
    <div class="card">

        <div class="card-header px-3 py-2 d-flex align-items-center">
            <strong class="mr-4">
                <i class="fas fa-user-injured"></i>
                Note Billing Report
            </strong>
        </div>
        <div class="card-body p-0 border-0 table-responsive">
            <table class="table table-sm table-condensed table-bordered border-0 p-0 m-0">
                <thead class="bg-light">
                <tr>
                    <th>Patient</th>
                    <th>Note</th>
                    <th>Pro</th>
                    <th>Date</th>
                    <th>New/FU</th>
                    <th>Method</th>
                    <th>Billing Closed?</th>
                    <th>Claiming Closed?</th>
                    <th>Claims</th>
                    <th>Bills</th>
                    <th>ICDs</th>
                    <th>Submissions</th>
                </tr>
                </thead>
                <tbody>
                @foreach ($rows as $row)
                    <tr class="{{false ? 'bg-light' : ''}}">
                        <td class="text-nowrap border-left-0">
                            <a href="/patients/view/{{$row->client_uid}}">
                                {{$row->clientDisplayName()}}
                            </a>
                        </td>
                        <td class="text-nowrap border-left-0">
                            <a href="/patients/view/{{$row->client_uid}}/notes/view/{{$row->note_uid}}">
                                {{friendly_date_time($row->note_date, false)}}
                            </a>
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->proDisplayName()}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->note_date}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->new_or_fu_or_na}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->method}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->is_billing_closed}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            {{$row->is_claiming_closed}}
                        </td>
                        <td class="text-nowrap border-left-0">
                            <pre>{{$row->claim_lines}}</pre>
                        </td>
                        <td class="text-nowrap border-left-0">
                            <pre>{{$row->bills}}</pre>
                        </td>
                        <td class="text-nowrap border-left-0">
                            <pre>{{$row->icds}}</pre>
                        </td>
                        <td class="text-nowrap border-left-0">
                            @foreach($row->note->claims as $claim)
                                @foreach($claim->mbClaims as $mbClaim )
                                {{$mbClaim->status}} {{$mbClaim->status_memo}}
                                @endforeach
                            @endforeach
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            <div>
                {{$rows->links()}}
            </div>
        </div>
    </div>
    </div>
@endsection
