

<?php $__env->startSection('title'); ?>
    Settings - <?php echo e($title); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('navbar-content'); ?>
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0"> Settings </h1>
                </div><!-- /.col -->
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>">Dashboard</a></li>
                        <?php if(helper::roleAccess('settings.account.index')): ?>
                            <li class="breadcrumb-item"><a href="<?php echo e(route('settings.account.index')); ?>">Account List</a></li>
                        <?php endif; ?>
                        <li class="breadcrumb-item active"><span>Add New Account</span></li>
                    </ol>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.container-fluid -->
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('admin-content'); ?>
    <div class="row">
        <div class="col-md-12">
            <div class="card card-default">
                <div class="card-header">
                    <h3 class="card-title">Add New Account</h3>
                    <div class="card-tools">
                        <?php if(helper::roleAccess('settings.account.index')): ?>
                            <a class="btn btn-default" href="<?php echo e(route('settings.account.index')); ?>"><i
                                    class="fa fa-list"></i>
                                Account List</a>
                        <?php endif; ?>
                        <span id="buttons"></span>

                        <a class="btn btn-tool btn-default" data-card-widget="collapse">
                            <i class="fas fa-minus"></i>
                        </a>
                        <a class="btn btn-tool btn-default" data-card-widget="remove">
                            <i class="fas fa-times"></i>
                        </a>
                    </div>
                </div>
                
                <div class="card-body">
                    <form class="needs-validation" method="POST" action="<?php echo e(route('settings.account.store')); ?>" novalidate>
                        <?php echo csrf_field(); ?>
                        <div class="form-row">
                            <div class="col-md-12 mb-3">
                                <span class="bg-green" style="padding: 5px; font-weight : bold"
                                    for="validationCustom01">Account Code * : <?php echo e($accountCode); ?></span>
                                <input type="hidden" name="accountCode" class="form-control" id=""
                                    value="<?php echo e($accountCode); ?>">
                            </div>
                            <div class="col-md-6 mb-3">
                                <label for=""> Account List <span class="text-danger">*</span></label>
                                <select name="parent_id" class="custom-select select2" id="parent_id">
                                    <option selected disabled>--select Account--</option>
                                    <?php $__currentLoopData = $accounts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $account): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option 
                                            value="<?php echo e($account->id); ?>">
                                            <?php echo e($account->account_name); ?> <?php echo e($account->parent->account_name ?? ''); ?>

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


                            <div class="col-md-6 mb-3">
                                <label for="validationCustom01">Account Name * :</label>
                                <input type="text" name="account_name" class="form-control" id="validationCustom01"
                                    placeholder="Account Name" value="<?php echo e(old('account_name')); ?>">
                                <?php $__errorArgs = ['account_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <span class=" error text-red text-bold"><?php echo e($message); ?></span>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label for="validationCustom02"> Account Number :</label>
                                <input type="text" name="account_code" class="form-control" id="validationCustom02"
                                    placeholder="Account Number" value="<?php echo e(old('account_code')); ?>" required>
                            </div>
                            <div class="col-md-6 mb-3">
                                <label for="validationCustom02"> Bank Name (if need) :</label>
                                <input type="text" name="bank_name" class="form-control" id="validationCustom02"
                                    placeholder="Bank Name" value="<?php echo e(old('bank_name')); ?>" required>
                            </div>

                            <div class="col-md-6 mb-3 d-none" id="depreciation">
                                <label for="validationCustom02"> Depreciation (%) :</label>
                                <input type="number" name="depreciation" class="form-control" id="validationCustom02"
                                    placeholder="" value="<?php echo e(old('depreciation')); ?>">
                            </div>

                            <select class="d-none" id="accountcheck">
                                <option value="2">sdf</option>
                                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.account','data' => ['setAccounts' => $getFixasset]]); ?>
<?php $component->withName('account'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes(['setAccounts' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($getFixasset)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                            </select>

                        </div>
                        <div class="form-row">
                            <div class="card" style="width: 18rem;">
                                <div class="card-body">
                                    <div class="form-check">
                                        <input class="form-check-input" type="checkbox" value="1"
                                            name="billbybillpayment" id="flexCheckDefault">
                                        <label class="form-check-label" for="flexCheckDefault">
                                            Bill By Bill Payment
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <button class="btn btn-info" type="submit"><i class="fa fa-save"></i> &nbsp;Save</button>
                    </form>
                </div>
                <!-- /.card-body -->
                <div class="card-footer">

                </div>
            </div>
        </div>
        <!-- /.col-->
    </div>

    <script>
        $(document).ready(function() {
            $('#parent_id').on('change', function() {
                let val = $(this).val();
                var sum = [];
                $.each($('#accountcheck option'), function(k, v) {
                    sum.push($(this).val());
                });
                if ($.inArray(val, sum) != -1) {
                    $('#depreciation').removeClass('d-none');
                } else {
                    $('#depreciation').addClass('d-none');
                }
            })

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

<?php echo $__env->make('backend.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/jubairba/soft.jubairbangladesh.com/resources/views/backend/pages/settings/account/create.blade.php ENDPATH**/ ?>