<?php if (\Illuminate\Support\Facades\Blade::check('role', 'admin')): ?>
    <div class="row colorbox-group-widget" style="margin-top: 50px;">
                    <div class="col-md-3 col-sm-6 info-color-box">
                        <div class="white-box">
                            <div class="media bg-primary">
                                <div class="media-body">
                                    
                                        <a style="color: white" href="#" target="_blank">
                                        <h3 class="info-count"><?php echo e(number_format($stats['received-amount'])); ?> <span class="pull-right"><i class="mdi mdi-checkbox-marked-circle-outline"></i></span></h3>
                                    <p class="info-text font-12">Received Amount</p>
                                    <p class="info-ot font-15"><?php echo e($stats['month']); ?><span class="label label-rounded"><?php echo e(number_format($stats['current-received-amount'])); ?></span></p>
                                </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6 info-color-box">
                        <div class="white-box">
                            <div class="media bg-success">
                                <div class="media-body">
                                    
                                        <a style="color: white" href="#" target="_blank">
                                        <h3 class="info-count"><?php echo e(number_format($stats['open_inventory_cost'])); ?> <span class="pull-right"><i class="mdi mdi-comment-text-outline"></i></span></h3>
                                    <p class="info-text font-12">Open Inventory</p>
                                    <p class="info-ot font-15">Count :<span class="label label-rounded"><?php echo e(number_format($stats['open_inventory_count'])); ?></span></p>
                                </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6 info-color-box">
                        <div class="white-box">
                            <div class="media bg-danger">
                                <div class="media-body">
                                      
                                        <a style="color: white" href="#" target="_blank">
                                        <h3 class="info-count"><?php echo e(number_format($stats['sold_inventory_paid'])); ?> <span class="pull-right"><i class="mdi mdi-coin"></i></span></h3>
                                    <p class="info-text font-12">Sold Inventory</p>
                                    <p class="info-ot font-15">Count :<span class="label label-rounded"><?php echo e(number_format($stats['sold_inventory_count'])); ?></span></p>
                                </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6 info-color-box">
                        <div class="white-box">
                            <div class="media bg-warning">
                                <div class="media-body">
                                    
                                        <a style="color: white" href="#" target="_blank">
                                        <h3 class="info-count"><?php echo e(number_format($stats['earning'])); ?> <span class="pull-right"><i class="mdi mdi-coin"></i></span></h3>
                                    <p class="info-text font-12">Net Income</p>
                                    <p class="info-ot font-15"><?php echo e($stats['month']); ?><span class="label label-rounded"></span></p>
                                </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>




<br>
<?php endif; ?>

 <!--.row-->
 <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'list-membership')): ?>
                <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-info">
                            <div class="panel-heading">Search Statements</div>
                            <div class="panel-wrapper collapse in" aria-expanded="true">
                                <div class="panel-body">
                                    <form >
                                        <div class="form-body">
                                            <div class="row">
                                                
                                                <!--/span-->
                                                <div class="col-md-3">
                                                    <div class="form-group has-success" style="margin-bottom: 15px">
                                                        <label class="control-label">By Unit No.</label>
                                                        
                                                        <select id="unit" class="form-control chosen-select">
                                                        <option  value="0">None</option>
                                                        <?php $__currentLoopData = $unitNumbers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($p->id); ?>"><?php echo e($p->unit_number); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select> </div>
                                                </div>
                                                <!--/span-->
                                                <!--/span-->
                                                <div class="col-md-3">
                                                    <div class="form-group has-success" style="margin-bottom: 15px">
                                                        <label class="control-label">By Customer</label>
                                                        
                                                        <select id="customer" class="form-control chosen-select">
                                                        <option  value="0">None</option>
                                                        <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($c->id); ?>"><?php echo e($c->name); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select> </div>
                                                </div>
                                                <!--/span-->

                                                <!--/span-->
                                                <div class="col-md-3">
                                                    <div class="form-group has-success" style="margin-bottom: 15px">
                                                        <label class="control-label">By Dealer</label>
                                                        
                                                        <select id="dealer" class="form-control chosen-select">
                                                        <option  value="0">None</option>
                                                        <?php $__currentLoopData = $dealers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $d): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($d->id); ?>"><?php echo e($d->name); ?>-<?php echo e($d->code); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                        </select> </div>
                                                </div>
                                                <!--/span-->

                                                <!--/span-->
                                                <div class="col-md-3">
                                                    <div class="form-group has-success" style="margin-bottom: 15px">
                                                        <label class="control-label">By status</label>
                                                        <select id="status" class="form-control chosen-select">
                                                        <option  value="0">None</option>
                                                            
                                                        <option  value="<?php echo e(\App\CustomerProperty::approved); ?>">Approved</option>
                                                        <option  value="<?php echo e(\App\CustomerProperty::pending); ?>">Pending</option>
                                                        <option value="<?php echo e(\App\CustomerProperty::cancel); ?>">Cancelled</option>
                                                        
                                                        </select> </div>
                                                </div>
                                                <!--/span-->
                                                <div class="col-md-3">
                                                    <div class="form-actions" style="margin-top: 26px">
                                            <button type="button" class="btn btn-success search-customer"> <i class="fa fa-check" ></i> Search</button>
                                            
                                        </div>
                                                </div>
                                            </div>
                                            
                                            
                                        </div>
                                        
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--./row-->

                <div class="row" id="update-table">
                    
                </div>
                <!-- /.row -->

        <?php endif; ?>

<?php if (\Illuminate\Support\Facades\Blade::check('permission', 'due-payments')): ?>



      <div class="row">

                    <div class="col-sm-12">
                        <div class="white-box">

                            <h3 class="box-title">Current Month Due Amounts <a href="<?php echo e(route('properties.due')); ?>" style="float: right;font-size: 12px"><u>View All</u></a></h3>


                            <div class="table-responsive">
                                <table id="myTable1" class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>Sr No.</th>
                                            <th>Unit No.</th>
                                            <th>Member Name</th>
                                            <th>Dealer</th>
                                            <th>Net Amount</th>
                                            <th class="text-center">Received Amount</th>
                                            <th class="text-center">Due Amount</th>
                                            <th>Due Date</th>
                                            <th>Number</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php $count =1;?>
                                        <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-membership')): ?>
                                        <?php $view_membership = true;?>
                                        <?php else: ?>
                                        <?php $view_membership = false;?>
                                        <?php endif; ?>

                                        <?php $__currentLoopData = $due['properties']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $statement): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                      <?php if($due['dueAmt'][$statement->id] > 0): ?>
                                          <?php if($due['color'][$statement->id] == 'red'): ?>
                                              <tr style="color:red;">
                                          <?php elseif($due['color'][$statement->id] == 'orange'): ?>
                                              <tr style="color:orange;">
                                          <?php else: ?>
                                              <tr style="color:black;">
                                                  <?php endif; ?>
                                            <td><?php echo e($count++); ?></td>
                                            
                                            <td>
                                            <?php echo e($statement->inventory ? $statement->inventory->unit_number : ''); ?></td>

                                            
                                            

                                            <td><?php echo e($statement->customer ? $statement->customer->name: ''); ?></td>
                                            <td >
                                                <?php if($statement->dealer): ?>
                                            <?php echo e($statement->dealer->name); ?>

                                        <?php endif; ?></td>

                                            <td class="text-right"><?php echo e(number_format($statement->net_pay)); ?> PKR</td>


                                            <td class="text-right"><?php echo e(number_format($due['receivedAmt'][$statement->id])); ?> PKR</td>

                                             <td class="text-right"><?php echo e(number_format($due['dueAmt'][$statement->id])); ?> PKR</td>
                                            <td><?php echo e($due['dueDate'][$statement->id] ? date('d-m-Y', strtotime($due['dueDate'][$statement->id]->due_date)) : ''); ?>

                                             <br><?php $__currentLoopData = $due['dueMonth'][$statement->id]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php if($loop->last): ?><?php echo e(date('M', strtotime($s->due_date))); ?> <?php else: ?><?php echo e(date('M', strtotime($s->due_date))); ?> - <?php endif; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                        </td>
                                        <td><?php echo e($statement->customer->mobile_number); ?></td>
                                        <td>
                                            <?php if($view_membership): ?>
                                                <a href="<?php echo e(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>
                                            <?php endif; ?>
                                        </td>



                                        </tr>
                                       <?php endif; ?>

                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
<?php endif; ?><?php /**PATH /home/proje372/akram-city.projecterp.net/resources/views/home-update.blade.php ENDPATH**/ ?>