
<?php $__env->startSection('content'); ?>
    <!-- begin::main content -->
    <style>
        textarea{
    min-height: 30px !important;
}

.form-control, .swal-modal input.swal-content__input{
    height: 43px !important;
}

.btn.btn-add, .btn.btn-add-payment {
    padding-left: 2.8571428571em;
    background-repeat: no-repeat;
    background-position: 1.4285714286em center;
}




input{
    border: 1px solid #c6d9e0 !important;
}

.search-btn {
    position: relative;
    right: 31px;
    top: 1px;
    color: #bdbdbd;
}

label {
    display: block;
    font-size: 13px;
    line-height: 1.3846153846em;
    color: #526069;
    margin-bottom: 0.7692307692em;
    user-select: none;
    cursor: pointer;
    font-weight: 500;
    width: 10.7692307692em;
}

.search-card{
    width:100%;
    border:none;
}
.tab {
    display: inline-block;
    padding: 16px 12px;
    cursor: pointer;
    
    background-color: #E6EAED;
    margin-right: -4px; /* Remove spacing between tabs */
  }

  /* Style for highlighted tab */
  .tab.active {
    background-color: white;
  }

  /* Content area style */
  .tab-content {
    
    padding: 20px;
    border-radius: 0 0 5px 5px;
    display: none; /* Hide all content areas by default */
  }

  /* Show active content area */
  .tab-content.active {
    display: block;
  }
  #select2-payhead_id-2r-container{
    text-transform: capitalize !important;
  }
  .d-none{
    display:none !important;
  }
    </style>

    <main class="main-content">

        <div class="container">

            <!-- begin::page header -->
            <div class="page-header">
                <h3><?php echo e(__('message.add')); ?> Payhead Details</h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
                        <li class="breadcrumb-item" aria-current="page"><a href="<?php echo e(asset('hrms/payhead')); ?>">Payhead</a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.add')); ?></li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->

            <div class="row">
                <div class="col-md-12">

                    <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
                    <?php if($errors->any()): ?>
                        <div class="alert alert-danger">
                            <ul>
                                <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <li><?php echo e($error); ?></li>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </ul>
                        </div>
                    <?php endif; ?>
                    
                    <div class="card">
                    
                        <div class="card-body py-0">
                        
                            <div class="bg-white ">
                                <form action="<?php echo e(asset('hrms/add-payhead')); ?>"  method="post" enctype="multipart/form-data">
                                    <?php echo csrf_field(); ?>

                                    <input type="hidden" class="form-control select2" name="type" value="<?php echo e($head_type); ?>">
                                    <div class="row pb-5">
                                        <div class="col-md-6" style="border-right: 1px solid #e5e5e5;">
                                                
                                                <div class="card-body">
                                 
                                                        <div class="form-group d-flex align-items-center">
                                                            <label for="name">Select Payhead</label>
                                                            <select name="payhead_id" class="form-control select2 head_change" >
                                                                    <option disabled selected>SELECT</option>
                                                                    <?php $__currentLoopData = $heads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $h): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                                        <option value="<?php echo e($h->id); ?>" class="text-capitalize" head_slug="<?php echo e($h->slug); ?>"><?php echo e($h->name); ?></option>                                                                
                                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                                        <option value="0">Custom</option>
                                                            </select>
                                                        </div>

                                                        <div class="d-flex justify-content-end px-3">
                                                            <?php if($errors->has('payhead_id')): ?>
                                                                <div class="text-danger">
                                                                    <p><?php echo e($errors->first('payhead_id')); ?></p>
                                                                </div>
                                                            <?php endif; ?>
                                                        </div>  
                                                        
                                                        <div class="form-group d-flex align-items-center">
                                                            <label for="name" class="">Payhead Name</label>
                                                            <input type="text" class="form-control" name="name">
                                                        
                                                        </div>   
                                                        <div class="d-flex justify-content-end bonus_notification"></div>
                                                        
                                                        <div class="d-flex justify-content-end px-3">
                                                            <?php if($errors->has('name')): ?>
                                                                <div class="text-danger">
                                                                    <p><?php echo e($errors->first('name')); ?></p>
                                                                </div>
                                                            <?php endif; ?>
                                                        </div>  

                                                        
                                                        <div class="form-group d-flex align-items-center rate_type">
                                                            <label for="branch">Calcution Type</label>
                                                            <select class="form-control select2 " name="rate_type">
                                                                <option value="percentage">Percentage</option>
                                                                <option value="flat">Flat</option>
                                                            </select>
                                                        
                                                        </div>
                                                        <div class="d-flex justify-content-end px-3">
                                                            <?php if($errors->has('rate_type')): ?>
                                                                <div class="text-danger">
                                                                    <p><?php echo e($errors->first('rate_type')); ?></p>
                                                                </div>
                                                            <?php endif; ?>
                                                        </div> 

                                                        <div class="form-group d-flex align-items-center rate">
                                                            <label for="rate" class="rate_on">Rate</label>
                                                            <input type="number" class="form-control rate_input" name="rate" >
                                                            <input type="hidden" name="calculate_on" id="calculate_on">
                                                                                                                    
                                                        </div>
                                                        <div class="d-flex justify-content-end px-3">
                                                            <?php if($errors->has('rate')): ?>
                                                                <div class="text-danger">
                                                                    <p><?php echo e($errors->first('rate')); ?></p>
                                                                </div>
                                                            <?php endif; ?>
                                                        </div> 
                                                        <div class="form-check mb-2">
                                                            <input class="form-check-input" type="checkbox" name="status" value="active">
                                                            <label class="form-check-label">Mark this as Active</label>
                                                        </div>
                                      
                                                </div>
                                        </div>
                                        <div class="col-md-6 py-4">

                                            <h6>Other Configurations</h6>
                                        

                                            <div class="form-check mb-2">
                                                <input class="form-check-input" type="checkbox" name="tax_status" value="active">
                                                <label class="form-check-label">This is a taxable earning</label>
                                                <small class="d-block text-muted">The income tax amount will be divided equally and deducted every month across the financial year.</small>
                                            </div>

                                        

                                            <div class="form-check mb-2">
                                          
                                                    <input class="form-check-input epf_status" type="radio" name="epf_status"  value="active">
                                                    <label class="form-check-label" for="always">Consider for EPF Contribution</label>                                               
                                               
                                            </div>

                                            <div class="ms-3">
                                                <div class="form-check">
                                                    <input class="form-check-input epf_status" type="radio" name="epf_status" value="active">
                                                    <label class="form-check-label" for="always">Always</label>
                                                </div>
                                                <div class="form-check">
                                                    <input class="form-check-input epf_status" type="radio" name="epf_status" value="15000">
                                                    <label class="form-check-label" for="below15k">Only when PF Wage is less than ₹15,000 <i class="text-muted">(ℹ️)</i></label>
                                                </div>
                                            </div>

                                            <div class="form-check mb-2">
                                                <input class="form-check-input" type="checkbox"  name="esi_status" value="active">
                                                <label class="form-check-label">Consider for ESI Contribution</label>
                                            </div>

                                            <div class="form-check mb-2">
                                                <input class="form-check-input" type="checkbox" name="payslip_status" value="active">
                                                <label class="form-check-label">Show this component in payslip</label>
                                            </div>
                                        
                                            
                                            <div class="row bg-white py-4 w-100"  style="position:fixed;bottom:0;left:266px">
                                                <div class="col-12 py-2 px-4">
                                                    <button class="btn btn-success text-white mx-4" type="submit">
                                                    <i class="fa fa-check fa-lg"></i>&nbsp SAVE
                                                    </button>
                                                    <button class="btn btn-primary" type="button">CANCEL</button>
                                                </div>
                                            </div>
                                        
                                        </div>
                                    </div>
                                </form>
                                
                                
                                   
                                
                            </div>
                            
                        </div>
                    </div>



                </div>

            </div>

                     
        </div>

    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <!-- begin::select2 -->
    <link rel="stylesheet" href="<?php echo e(asset('public/admin/vendors/select2/css/select2.min.css')); ?>" type="text/css">
    <script src="<?php echo e(asset('public/admin/vendors/select2/js/select2.min.js')); ?>"></script>
    <!-- end::select2 -->
    <script>
       
        $(document).ready(function() {
            
            $('#js-example-basic-roles').select2({});

            $(".head_change").on('change',function(){
                var head = $(this).find(":selected").attr("head_slug");
                   if(head=="basic" || head=="basic_pay" || head=="Basic")
                   {
                        $(".rate_on").html("Rate On CTC");
                        $(".epf_status").attr("disabled",false);
                        $(".rate").removeClass("d-none");
                        $(".rate_type").removeClass("d-none");
                        $(".bonus_notification").html("");
                        $("#calculate_on").val("ctc");
                        $(".rate_input").attr("readonly",false);
                   }
                   else if(head=="house_rent_allowance")
                   {
                        $(".epf_status").attr("disabled",true);
                        $(".rate").removeClass("d-none");
                        $(".rate_type").removeClass("d-none");
                        $(".bonus_notification").html("");
                        $("#calculate_on").val("basic");
                        $(".rate_input").attr("readonly",false);
                   }
                   else if(head=="fixed_allowance")
                   {
                        $(".epf_status").attr("disabled",true);
                        $(".rate_type").removeClass("d-none");
                        $(".rate_type option[value='flat']").prop("selected", true);
                        $(".rate").removeClass("d-none");
                        $(".rate_input").attr("readonly",true);
                        $(".rate_input").val(0);
                        $(".bonus_notification").html("<p><i class='ti ti-info-alt'></i> Adjestable Allowance will use in salary.</p>");
                        $("#calculate_on").val("basic");
                   }
                   else if(head=="bonus")
                   {
                        $(".epf_status").attr("disabled",true);
                        $(".rate").addClass("d-none");
                        $(".rate_type").addClass("d-none");
                        $(".bonus_notification").html("<p><i class='ti ti-info-alt'></i> Variable amount paid during any payroll.</p>");
                        $("#calculate_on").val("basic");
                        $(".rate_input").attr("readonly",false);
                   }
                   
                   else
                   {
                        $(".rate_on").html("Rate On Basic");
                        $(".epf_status").attr("disabled",false);
                        $(".rate").removeClass("d-none");
                        $(".rate_type").removeClass("d-none");
                        $(".bonus_notification").html("");
                        $("#calculate_on").val("basic");
                        $(".rate_input").attr("readonly",false);
                   }

            });      
        });    

    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\blurb_erp\resources\views/hrms/payroll/payhead/add.blade.php ENDPATH**/ ?>