<?php $__env->startSection('title'); ?><?php echo e(trans_choice('general.add',1)); ?>  <?php echo e(trans_choice('general.chart_of_account',1)); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="box box-primary">
        <div class="box-header with-border">
            <h4 class="box-title"><?php echo e(trans_choice('general.add',1)); ?>  <?php echo e(trans_choice('general.chart_of_account',1)); ?></h4>

            <div class="box-tools pull-right">
                <button onclick="window.history.back()" class="btn btn-info btn-sm">
                    <?php echo e(trans_choice('general.cancel',1)); ?>

                </button>
            </div>
        </div>
        <form method="post" action="<?php echo e(url('accounting/gl_account/store')); ?>" class="form-horizontal"
              enctype="multipart/form-data">
            <?php echo e(csrf_field()); ?>

            <div class="box-body">
                <div class="form-group">
                    <label for="account_type"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.type',1)); ?></label>
                    <div class="col-md-3">
                        <select name="account_type" class="form-control select2" id="account_type" required>
                            <option></option>
                            <option value="asset"><?php echo e(trans_choice('general.asset',1)); ?></option>
                            <option value="liability"><?php echo e(trans_choice('general.liability',1)); ?></option>
                            <option value="equity"><?php echo e(trans_choice('general.equity',1)); ?></option>
                            <option value="income"><?php echo e(trans_choice('general.income',1)); ?></option>
                            <option value="expense"><?php echo e(trans_choice('general.expense',1)); ?></option>
                        </select>
                    </div>
                    <label for="parent_id"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.parent',1)); ?></label>
                    <div class="col-md-3">
                        <select name="parent_id" class="form-control select2" id="parent_id">
                            <option></option>
                            <?php $__currentLoopData = \App\Models\GlAccount::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($key->id); ?>"><?php echo e($key->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="gl_code"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.gl_code',1)); ?></label>
                    <div class="col-md-3">
                        <input type="text" name="gl_code" class="form-control"
                               value="<?php echo e(old('gl_code')); ?>"
                               required id="gl_code">
                    </div>
                    <label for="name"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.name',1)); ?></label>
                    <div class="col-md-3">
                        <input type="text" name="name" class="form-control"
                               value="<?php echo e(old('name')); ?>"
                               required id="name">
                    </div>

                </div>
                <div class="form-group">
                    <label for="manual_entries"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.manual',1)); ?> <?php echo e(trans_choice('general.entry',2)); ?></label>
                    <div class="col-md-3">
                        <select name="manual_entries" class="form-control " id="manual_entries" required>
                            <option value="1"><?php echo e(trans_choice('general.yes',1)); ?></option>
                            <option value="0"><?php echo e(trans_choice('general.no',1)); ?></option>
                        </select>
                    </div>
                    <label for="active"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.active',1)); ?></label>
                    <div class="col-md-3">
                        <select name="active" class="form-control " id="active" required>
                            <option value="1"><?php echo e(trans_choice('general.yes',1)); ?></option>
                            <option value="0"><?php echo e(trans_choice('general.no',1)); ?></option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="notes"
                           class="control-label col-md-2"><?php echo e(trans_choice('general.note',2)); ?></label>
                    <div class="col-md-8">
                        <textarea name="notes" class="form-control "
                                  placeholder=""
                                  id="notes" rows="3"><?php echo e(old('notes')); ?></textarea>
                    </div>
                </div>


            </div>
            <!-- /.box-body -->
            <div class="box-footer">
                <div class="heading-elements">
                    <button type="submit" class="btn btn-primary pull-right"><?php echo e(trans_choice('general.save',1)); ?></button>
                </div>
            </div>
        </form>
    </div>
    <!-- /.box -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('footer-scripts'); ?>
    <script>
        $(".form-horizontal").validate({
            rules: {
                field: {
                    required: true,
                    step: 10
                }
            }, highlight: function (element) {
                $(element).closest('.form-group div').addClass('has-error');
            },
            unhighlight: function (element) {
                $(element).closest('.form-group div').removeClass('has-error');
            },
            errorElement: 'span',
            errorClass: 'help-block',
            errorPlacement: function (error, element) {
                if (element.parent('.input-group').length) {
                    error.insertAfter(element.parent());
                } else {
                    error.insertAfter(element);
                }
            }
        });
    </script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ic026402/public_html/cres/resources/views/gl_account/create.blade.php ENDPATH**/ ?>