

<?php $__env->startSection('content'); ?>
<div class="container">
    
    <div class="card shadow">
        <div class="card-header  text-white" style="background-color:#2C4E71">
            <div class="row">
                <div class="col-md-6">
                    <h4 class="mb-0">
                     مرتجعات المبيعات
                     </h4>
                </div>
                <div class="col-md-6 text-right">
                    <a  href='<?php echo e(url("invoice/return")); ?>'  class="btn btn-light">
                        <i class="fas fa-plus"></i> 
        اضافة مرتجع جديد
                    </a>
                </div>
            </div>
        </div>
        
        <div class="card-body">
            <div class="table-responsive">
                <table id="example1"  class="table table-hover table-bordered">
                    <thead class="thead-light">
                        <tr>
                            <th>اسم العميل</th>
                            <th>رقم الفاتورة</th>
                            <th>تاريخ المراجعة</th>
                            <th>حالة المراجعة</th>
                            <th>المبلغ الإجمالي</th>
                            <th>سبب المراجعة</th>
                            <th>الإجراءات</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($reviews as $review): ?>
                        
                        <?php if( $branch_id == $review->client->branch_id): ?>
                        <tr>
                            <td> <?php echo e($review->client->name); ?></td>
                            <td><?php echo e($review->invoice_id); ?></td>
                            <td><?php echo e($review->created_at); ?></td>
                            <td>
                                <span class="badge 
                                    <?php if($review->status == 'approved'): ?> badge-success
                                    <?php elseif($review->status == 'rejected'): ?> badge-danger
                                    <?php else: ?> badge-warning
                                    <?php endif; ?>">
                                    <?php echo e($review->status); ?>

                                </span>
                            </td>
                            <td><?php echo e(number_format($review->total_price, 2)); ?> جنيه</td>
                            <td><?php echo e($review->reason); ?></td>
                            <td>
                                 
                                <a  class="btn btn-sm btn-info viewid"   href='<?php echo e(url("invoice/reviewitems/{$review->id}")); ?>'> <i class="fas fa-list"></i>  عرض الأصناف</a>
                                
                                <?php if($review->status == 'pending'): ?>
                                <a  
                                   class="btn btn-sm btn-success">
                                    <i class="fas fa-check"></i> اعتماد
                                </a>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endif; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
            
            
        </div>
    </div>
</div>
 


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.masterHome2', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>