<div class="modal fade " id="paymentModal">
    <div class="modal-dialog">
        <form id="ajaxPaymentForm" class="form " role="form" enctype="multipart/form-data" method="post" action="#">
            <?php echo csrf_field(); ?>
            <div class="modal-content" style="padding:5px 15px 5px 15px;">
                <div class="modal-header">
                    <h4 class="text-center">Payment For  <span id="clientNameHead"></span></h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="text-center" id="modalAlert"></div>
                    <div class="row">

                        <input type="hidden" name="client_id" value="" id="cid">
                        <input type="hidden" name="monthsms" id="monthsms" value="">
                        <input type="hidden" name="billIds[]" id="billIds" value="">

                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Payment Date</label>
                                    <?php if(checkSettings('change-payment-date') == 'enable'): ?>
                                        <?php if(auth()->user()->hasPermissionTo('change-payment-date')): ?>
                                            <input class="form-control" value="<?php echo e(today()->format('Y-m-d')); ?>"
                                                type="date" id="created_at">
                                        <?php else: ?>
                                            <input class="form-control" value="<?php echo e(today()->format('Y-m-d')); ?>"
                                                type="date" disabled id="created_at">
                                        <?php endif; ?>
                                    <?php else: ?>
                                        <input class="form-control" value="<?php echo e(today()->format('Y-m-d')); ?>"
                                            type="date" disabled id="created_at">
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">

                                    <label>Payment Month </label>
                                    <select name="month" class="form-control" id="ajaxPaymentMonth">
                                        <option value="">Select Month</option>
                                        <option value="January"
                                            <?php echo e(today()->format('F') == 'January' ? 'selected' : ''); ?>>January</option>
                                        <option value="February"
                                            <?php echo e(today()->format('F') == 'February' ? 'selected' : ''); ?>>February</option>
                                        <option value="March" <?php echo e(today()->format('F') == 'March' ? 'selected' : ''); ?>>
                                            March</option>
                                        <option value="April" <?php echo e(today()->format('F') == 'April' ? 'selected' : ''); ?>>
                                            April</option>
                                        <option value="May" <?php echo e(today()->format('F') == 'May' ? 'selected' : ''); ?>>May
                                        </option>
                                        <option value="June" <?php echo e(today()->format('F') == 'June' ? 'selected' : ''); ?>>
                                            June</option>
                                        <option value="July" <?php echo e(today()->format('F') == 'July' ? 'selected' : ''); ?>>
                                            July</option>
                                        <option value="August"
                                            <?php echo e(today()->format('F') == 'August' ? 'selected' : ''); ?>>
                                            August</option>
                                        <option value="September"
                                            <?php echo e(today()->format('F') == 'September' ? 'selected' : ''); ?>>September
                                        </option>
                                        <option value="October"
                                            <?php echo e(today()->format('F') == 'October' ? 'selected' : ''); ?>>October</option>
                                        <option value="November"
                                            <?php echo e(today()->format('F') == 'November' ? 'selected' : ''); ?>>November
                                        </option>
                                        <option value="December"
                                            <?php echo e(today()->format('F') == 'December' ? 'selected' : ''); ?>>December
                                        </option>
                                    </select>

                                </div>
                            </div>

                            <?php if(checkSettings('due-history-in-payment') == 'enable'): ?>
                                <div class="col-md-12">
                                    <label for=""> Due Month</label>
                                    <table class="table table-bordered">
                                        <tbody id="due-history-in-payment">

                                        </tbody>
                                    </table>
                                </div>
                            <?php endif; ?>

                            <div class="col-md-12">
                                <div class="form-group">
                                    <label>Payment Description</label>
                                    <?php if(checkSettings('payment_month_show_in_remark') == 'enable'): ?>
                                        <textarea name="description" id="paymentDescription" class="form-control" placeholder="Enter Description..."><?php echo e(today()->format('F')); ?></textarea>
                                    <?php else: ?>
                                        <textarea name="description" id="paymentDescription" class="form-control" placeholder="Enter Description...">Payment of month : <?php echo e(today()->format('F')); ?>. Bill Month : <?php echo e(today()->format('F')); ?></textarea>
                                    <?php endif; ?>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Collected By </label>

                                    <?php if(auth()->user()->hasrole('Admin')): ?>
                                        <select name="collected_by" class="form-control " id="paymentCollectedBy"
                                            required>
                                            <option value="">Select Employee</option>
                                            <?php $__currentLoopData = employees(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($employee->admin == null || $employee->admin->user_accounting_status == 'yes'): ?>
                                                    <option value="<?php echo e($employee->id); ?>"><?php echo e($employee->name); ?></option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    <?php else: ?>
                                        <?php if(auth()->user()->hasPermissionTo('change-collector')): ?>
                                            <select name="collected_by" class="form-control" id="paymentCollectedBy"
                                                required>
                                                <option value="">Select Employee</option>
                                                <?php $__empty_1 = true; $__currentLoopData = employees(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                                    <?php if($employee->admin == null || $employee->admin->user_accounting_status == 'yes'): ?>
                                                        <option value="<?php echo e($employee->id); ?>"
                                                            <?php echo e($employee->admin_user_id == auth()->user()->id ? 'selected' : ''); ?>>
                                                            <?php echo e($employee->name); ?></option>
                                                    <?php endif; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                                <?php endif; ?>
                                            </select>
                                        <?php else: ?>
                                            <select name="collected_by" class="form-control" id="paymentCollectedBy"
                                                required disabled>
                                                <option value="">Select Employee</option>
                                                <?php $__empty_1 = true; $__currentLoopData = employees(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                                    <option value="<?php echo e($employee->id); ?>"
                                                        <?php echo e($employee->admin_user_id == auth()->user()->id ? 'selected' : ''); ?>>
                                                        <?php echo e($employee->name); ?></option>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                                <?php endif; ?>
                                            </select>
                                        <?php endif; ?>


                                    <?php endif; ?>
                                </div>
                            </div>

                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Payment Type</label>
                                    <select name="payment_type" class="form-control" id="paymentType" required>
                                        <option value="">Select Type</option>
                                        <?php if(config('app.only_monthly_bill_show') == true): ?>
                                            <?php $__currentLoopData = imcomeHead(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $head): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if(in_array($head->id, [5])): ?>
                                                    <option value="<?php echo e($head->id); ?>"
                                                        <?php echo e($head->id == 5 ? 'selected' : ''); ?>><?php echo e($head->name); ?>

                                                    </option>
                                                    <option value="12">Other</option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <?php $__currentLoopData = imcomeHead(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $head): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if(in_array($head->id, [1, 2, 3, 4, 5, 6, 11])): ?>
                                                    <option value="<?php echo e($head->id); ?>"
                                                        <?php echo e($head->id == 5 ? 'selected' : ''); ?>><?php echo e($head->name); ?>

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

                                        <?php endif; ?>
                                    </select>
                                </div>
                            </div>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('payment-discount')): ?>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>Discount(optional)</label>
                                        <input class="form-control" min="0" placeholder="Discount(optional)"
                                            type="number" name="discount" id="paymentDiscount">
                                    </div>
                                </div>
                            <?php else: ?>
                                <div class="col-md-6"></div>
                            <?php endif; ?>

                            <?php if(getBillingType() == 'day_to_day' &&  auth()->user()->can('day_by_day_payment')): ?>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="checkAmount"><input type="checkbox" id="checkAmount"> Enable
                                            Amount</label>
                                        <input id="paymentAmount" min="0" class="form-control"
                                            style="display:none" type="number" name="amount" required="">

                                        <div class="day_to_day_enable">
                                            <select class="form-control" name="paymentDay" id="paymentDay">
                                                <option value="">Select Day</option>
                                                <?php for($i = 1; $i <= 30; $i++): ?>
                                                    <option value="<?php echo e($i); ?>"><?php echo e($i); ?></option>
                                                <?php endfor; ?>
                                            </select>
                                        </div>

                                    </div>
                                </div>
                            <?php else: ?>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label>Payment Amount</label>
                                        <input id="paymentAmount" min="0" class="form-control" type="number"
                                            name="amount" required="">
                                    </div>
                                </div>

                            <?php endif; ?>

                            <div class="col-md-12">
                                <div class="form-group">
                                    <label>Money Receipt ID</label>
                                    <input class="form-control" placeholder="Receipt ID" type="text"
                                        id="moneyReceiptNumber" name="money_receipt_number">
                                </div>
                            </div>

                            <div class="col-md-12 row">
                                <div class="form-group col-md-6 mt-2">
                                    <label><input type="checkbox" class="checkbox" name="sms" value=""
                                            id="sms" <?php if(checkSettings('auto-payment-sms-send') == 'enable'): ?> checked <?php endif; ?>><b> Send
                                            SMS Notification</b> </label>
                                </div>
                                <div class="form-group col-md-6 mt-2">
                                    <label><input type="checkbox" class="checkbox" name="print" value=""
                                            id="print" <?php if(checkSettings('auto-payment-print') == 'enable'): ?> checked <?php endif; ?>><b> Print
                                            Invoice</b> </label>
                                </div>
                            </div>


                        </div>

                    </div>


                </div>
                <div class="modal-footer justify-content-between">
                    <button type="button" class="btn btn-default" data-dismiss="modal"
                        id="ajaxPaymentModalClose">Close</button>
                    <button class="btn btn-primary buttonHide" type="submit" id="ajaxPaymentProcess">Submit</button>
                </div>

            </div>
            <!-- /.modal-content -->
        </form>
    </div>
    <!-- /.modal-dialog -->
</div>
<?php /**PATH /var/www/html/satkania/radius-circle/resources/views/paymenthistory/paymentModal.blade.php ENDPATH**/ ?>