 <div class="col-sm-12">
                        <div class="white-box">
                        	
                            <h3 class="box-title">All Statement ({{number_format(count($allStatements))}})</h3>

                            <div class="table-responsive">
                                <table id="myTable" class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>Sr No.</th>
                                            <th>Project</th>
                                            <th>Unit No</th>
                                            <th>Size</th>
                                            
                                            <th>Member Name</th>
                                            <th>Net Amount</th>

                                            <th>Received Amount</th>
                                            
                                            <th>Booking Date</th>
                                            <th>Status</th>
                                            <th style="width: 185px!important;">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $count =1;?>
                                        @permission('view-membership')
                                            <?php $view_membership = true;?>
                                        @else
                                            <?php $view_membership = false;?>
                                        @endpermission

                                        @permission('create-schedule')
                                            <?php $create_schedule = true;?>
                                        @else
                                            <?php $create_schedule = false;?>
                                        @endpermission

                                        @permission('edit-membership')
                                            <?php $edit_membership = true;?>
                                        @else
                                            <?php $edit_membership = false;?>
                                        @endpermission

                                        @permission('delete-membership')
                                            <?php $delete_membership = true;?>
                                        @else
                                            <?php $delete_membership = false;?>
                                        @endpermission

                                        @permission('download-membership')
                                            <?php $download_membership = true;?>
                                        @else
                                            <?php $download_membership = false;?>
                                        @endpermission

                                        @permission('reminder-membership')
                                            <?php $reminder_membership = true;?>
                                        @else
                                            <?php $reminder_membership = false;?>
                                        @endpermission

                                        @permission('sms-membership')
                                            <?php $sms_membership = true;?>
                                        @else
                                            <?php $sms_membership = false;?>
                                        @endpermission

                                        @foreach($allStatements as $statement)
                                        <tr >
                                            <td>{{$count++}}</td>
                                           
                                            <td>
                                                @if($statement->inventory)
                                                 @if($statement->inventory->multiProject)
                                                 {{$statement->inventory->multiProject->name}}
                                                 @else
                                                 None
                                                @endif
                                               
                                              @endif
                                            </td>
                                            <td>{{$statement->inventory->unit_number}}</td>
                                              <td>@if($statement->inventory)
                                                @if($statement->inventory->size)
                                                
                                                {{$statement->inventory->size->name}} {{env('SIZE')}}
                                                @endif
                                                @endif
                                            </td>
                                            <td>{{$statement->customer ? $statement->customer->name: ''}}<br><b>Dealer: </b>
                                                @foreach ($statement->dealerTransaction as $d)
                                                    @if($loop->last)
                                                        {{ $d->dealer->name }}
                                                    @else
                                                        {{ $d->dealer->name }},
                                                    @endif
                                                @endforeach
                                            </td>

                                            <td class="text-right"><b>{{number_format($statement->net_pay)}}</b></td>


                                            <td class="text-right"><b>{{number_format($receivedAmt[$statement->id])}}</b></td>

                                            

                                            <td>{{date('d-m-Y', strtotime($statement->booking_date)) }}</td>



                                            @if($statement->status == \App\CustomerProperty::pending)
                                            <td><span class="label label-primary" style="background-color:#cd703d;">Pending</span></td>

                                            @elseif($statement->status == \App\CustomerProperty::approved)
                                            <td><span class="label label-success">Approved</span></td>
                                            @elseif($statement->status == \App\CustomerProperty::cancel)
                                            <td><span class="label label-danger">Canceled</span></td>
                                            @else
                                            <td></td>
                                            @endif



                                            <td class="text-nowrap">
                                                @if($view_membership)
                                                <a href="{{route('statement.detail',['id'=>$statement->id])}}" data-toggle="tooltip" data-original-title="View"> <i class="fa fa-eye text-inverse m-r-10"></i>&nbsp;&nbsp;</a>
                                                @endif

                                                
                                                @if($statement->status != \App\CustomerProperty::approved)
                                                @if($edit_membership)

                                                 <a href="{{route('membership.edit',['id'=>$statement->id])}}" data-toggle="tooltip" data-original-title="Edit"> <i class="fa fa-pencil text-inverse m-r-10"></i>&nbsp;&nbsp;</a>
                                                 @endif

                                                 @if($delete_membership)

                                                <a href="{{route('statement.delete',['id'=>$statement->id])}}" onclick="return  confirm('Are you sure to delete?')" data-toggle="confirmation" data-title="Are you sure to delete?" > <i class="fa fa-close text-danger"></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                                                @endif

                                                @endif

                                                @if($download_membership)

                                                <a target="_blank" href="{{route('membership.download',['id'=>$statement->id])}}" data-toggle="tooltip" data-original-title="Download"> <i class="fa fa-download text-inverse m-r-10"></i>&nbsp;&nbsp;</a>
                                                @endif

                                                @if($reminder_membership)

                                                @if($statement->reminder_text)
                                                @if($statement->reminder_date)
                                                @if($statement->reminder_date < \Carbon\Carbon::now())
                                                <a href="#" onclick="openReminderModal({{$statement->id}})" data-toggle="tooltip" data-original-title="Overdue Reminder" style="color: red;"> <i class="fa fa-bell text-inverse m-r-10"></i>&nbsp;&nbsp;</a>
                                                @else
                                                <a href="#" onclick="openReminderModal({{$statement->id}})" data-toggle="tooltip" data-original-title="Coming Reminder" style="color: green;"> <i class="fa fa-bell text-inverse m-r-10"></i>&nbsp;&nbsp;</a>
                                                @endif
                                                @else
                                                <a href="#" onclick="openReminderModal({{$statement->id}})" data-toggle="tooltip" data-original-title="See Coming Reminder" style="color: green;"> <i class="fa fa-bell text-inverse m-r-10"></i>&nbsp;&nbsp;</a>

                                                @endif
                                                @else
                                                <a href="#" onclick="openReminderModal({{$statement->id}})" data-toggle="tooltip" data-original-title="Reminder"> <i class="fa fa-bell text-inverse m-r-10"></i>&nbsp;&nbsp;</a>

                                                @endif

                                                @endif

                                                @if($sms_membership)

                                                <a href="#" onclick="openSmsModal({{$statement->id}})" ><i class="fa fa-comment"></i></a>
                                                @endif
                                            </td>

                                        </tr>

                                        @endforeach

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