<?php $__env->startSection('title', 'Payment Vouchers List'); ?>

<?php $__env->startSection('content'); ?>

    <div class="page-header">
        <div class="page-title">
            <h4>Payment Voucher List</h4>
            <h6>Manage your payment vouchers</h6>
        </div>
        <?php if(auth()->user()->hasPermission('Payment Voucher Create')): ?>
        <div class="page-btn">
            <a href="<?php echo e(route('payment-vouchers.create')); ?>" class="btn btn-added">
                <img src="<?php echo e(asset('assets/img/icons/plus.svg')); ?>" alt="img" class="me-1">Add Payment Voucher
            </a>
        </div>
        <?php endif; ?>
    </div>

    <div class="card">
        <div class="card-body">
            <div class="table-top">
                <div class="search-set">
                    <div class="search-input">
                        <a class="btn btn-searchset">
                            <img src="<?php echo e(asset('assets/img/icons/search-white.svg')); ?>" alt="img">
                        </a>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table datanew dataTable no-footer table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>DOC NO</th>
                            <?php if(auth()->user()->hasPermission('Payment Voucher Update')): ?>
                            <th>Action</th>
                            <?php endif; ?>
                            <th>Supplier</th>
                            <th>Address</th>
                            <th>Contact Person</th>
                            <th>Phone</th>
                            <th>Debit</th>
                            <th>Credit</th>
                            <th>Total</th>
                            <th>Date</th>
                            <?php if (\Illuminate\Support\Facades\Blade::check('role', 'Superadmin')): ?>
                                <th>Company</th>
                            <?php endif; ?>
                            <th>Is Approved</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $paymentVouchers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $paymentVoucher): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><?php echo e($loop->iteration); ?></td>
                                <td> <a class="link-primary" href="<?php echo e(route('payment-vouchers.show', $paymentVoucher->id)); ?>"><?php echo e($paymentVoucher->code); ?></a></td>
                                <?php if(auth()->user()->hasPermission('Payment Voucher Update')): ?>
                                <td>
                                    <?php if($paymentVoucher->is_approved == 0 || ($paymentVoucher->is_approved == 1 && auth()->user()->hasPermission('Approved Document Update'))): ?>
                                    <a class="me-3" href="<?php echo e(route('payment-vouchers.edit', $paymentVoucher->id)); ?>">
                                        <img src="<?php echo e(asset('assets/img/icons/edit.svg')); ?>" alt="Edit">
                                    </a>
                                    <?php endif; ?>
                                </td>
                                <?php endif; ?>
                                <td><?php echo e($paymentVoucher->party->name); ?></td>
                                <td><?php echo e($paymentVoucher->party->address); ?></td>
                                <td><?php echo e($paymentVoucher->party->contact_person_name); ?></td>
                                <td><?php echo e($paymentVoucher->party->contact_person_phone ?? $paymentVoucher->party->phone); ?></td>
                                <td><?php echo e($paymentVoucher->total_debit . $paymentVoucher->currency); ?></td>
                                <td><?php echo e($paymentVoucher->total_credit . $paymentVoucher->currency); ?></td>
                                <td><?php echo e($paymentVoucher->total . $paymentVoucher->currency); ?></td>
                                <td><?php echo e($paymentVoucher->created_at->format('d M, Y')); ?></td>
                                <?php if (\Illuminate\Support\Facades\Blade::check('role', 'Superadmin')): ?>
                                    <td><?php echo e($paymentVoucher->company->name); ?></td>
                                <?php endif; ?>
                                <td><span class="badge <?php echo e($paymentVoucher->is_approved == 1 ? 'bg-success' : 'bg-danger'); ?>"><?php echo e($paymentVoucher->is_approved == 1 ? 'Yes' : 'No'); ?></span></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/aligkrwp/public_html/resources/views/admin/payment-vouchers/index.blade.php ENDPATH**/ ?>