<input type="hidden" id="update_expense_service_qty" value="<?php echo e($totalExpenseServiceQty); ?>">
<input type="hidden" id="update_expense_service_amount" value="<?php echo e($totalExpenseServiceAmount); ?>">
<thead>
    <tr>
        <th class="text-center" scope="col"><span>SN</span></th>
        <th class="text-center" scope="col"><span>Expense</span></th>
        <th class="text-center" scope="col"><span>Details</span></th>
        <th class="text-center" scope="col"><span>Amount</span></th>
    </tr>
</thead>
<tbody>
    <?php $__currentLoopData = $unpaidExpenseServiceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    <?php if(isset($item) && $item != null): ?>
    <tr class="text-center">
        <td>
            <b><?php echo e($key+1); ?></b>
        </td>
        <td class="text-start">
            <div class="row_title">
                <b>Category: </b><?php echo e($item->expenseCategoryData->category_name); ?> <br>
                <b>Expense: </b><?php echo e($item->expenseData->expense_name); ?>

            </div>
            <div class="row-actions mt-2">
                <?php if(Auth::user()->can('expense-receipt-edit')): ?>
                <span><a class="text-primary fw-bolder"
                        href="javascript(void.0)" onclick="editExpenseReceipt(<?php echo e($item->id); ?>)">Edit</a>
                </span>
                <?php endif; ?>
                
                <?php if(Auth::user()->can('expense-receipt-delete')): ?>
                <span> | <a class="text-danger fw-bolder"
                        href="javascript(void.0)" onclick="deleteExpenseServiceData(<?php echo e($item->id); ?>)">Delete</a>
                </span>
                <?php endif; ?>
            </div>
        </td>

        <td class="text-start w-50">
            <span class="text-secondary"><?php echo e($item->expense_details); ?></span>
        </td>

        <td class="text-center">
            <span class="fw-bolder text-success"><?php echo e($item->expense_amount); ?></span>
        </td>
    </tr>

    <div class="modal fade" id="editExpenseReceipt<?php echo e($item->id); ?>" tabindex="-1" aria-labelledby="oneInputModalLabel" aria-hidden="true"
        data-bs-backdrop='static'>
        <div class="modal-dialog modal-dialog-centered max-width-900px">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="modal-title fs-5" id="oneInputModalLabel">Update Expense Receipt</h1>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <form action="#" method="post" enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" id="expense_receipt_id<?php echo e($item->id); ?>" value="<?php echo e($item->expense_receipt_id); ?>">
                    <div class="modal-body p-0">
                        <div class="row px-4 my-4">

                            <div class="col-md-6 mb-3">
                                <div class="form-group custom-select2-form">
                                    <label for="expense_category_id">Expense Category <span class=" text-danger">(required)</span>
                                    </label>
                                    <select name="expense_category_id" id="expense_category_id<?php echo e($item->id); ?>" class="form-select select2"
                                        onchange="getExpenseDataWithCateFU(<?php echo e($item->id); ?>)" required>
                                        <option value="" selected disabled>Select Category</option>
                                        <?php $__currentLoopData = $expenseCategoryData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleECD): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($singleECD->id); ?>"
                                            <?php echo e($singleECD->id == $item->expense_category_id ? 'selected' : ''); ?>

                                            ><?php echo e($singleECD->category_name); ?></option>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </select>
                                </div>
                            
                                <?php $__errorArgs = ['expense_category_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                <span class=text-danger><?php echo e($message); ?></span>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <?php
                             //To get all the expense data with category...   
                             $getExpenseData = App\Models\Expense::getExpenseDataWithCategory($item->expense_category_id);
                            //  dd($getExpenseData);
                            ?>

                            <div class="col-md-6 mb-3">
                            <div class="form-group custom-select2-form">
                                <label for="expense_id">Expense <span class=" text-danger">(required)</span>
                                </label>
                                <select name="expense_id" id="expense_id<?php echo e($item->id); ?>" class="form-select select2" required>
                                    <option value="" selected disabled>Select Expense</option>

                                    <?php $__currentLoopData = $getExpenseData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $singleED): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($singleED->id); ?>" <?php echo e($singleED->id == $item->expense_id ? 'selected' : ''); ?>>
                                        <?php echo e($singleED->expense_name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    
                                </select>
                            </div>
                        
                            <?php $__errorArgs = ['expense_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="expense_amount">Expense Amount<span class="text-danger">(required)</span>
                                </label>
                                <input type="number" name="expense_amount" id="expense_amount<?php echo e($item->id); ?>" required class="form-control form-control-solid"
                                    value="<?php echo e($item->expense_amount); ?>" step="0.01" placeholder="Expense Amount">
                            </div>

                            <?php $__errorArgs = ['expense_amount'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
                        
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="expense_details">Expense Details<span class="text-danger">(required)</span>
                                </label>
                                <textarea rows="3" cols="3" name="expense_details" id="expense_details<?php echo e($item->id); ?>" required class="form-control form-control-solid"
                                    value="" placeholder="Expense Details"><?php echo e($item->expense_details); ?></textarea>
                            </div>

                            <?php $__errorArgs = ['expense_details'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>
    
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-success" onclick="updateExpenseReceipt(<?php echo e($item->id); ?>)">Update</button>
                        <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Cancel</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


    <?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</tbody><?php /**PATH E:\Project\Personal-Project\Office-Project\Next-Web-Service\muktijoddhe-somobai-somity\resources\views/admin/expenses/expenseReceipt/updateExpenseDetails.blade.php ENDPATH**/ ?>