<?php $__env->startSection('content'); ?>
    <div class="col-md-12 content-header" >
        <h1>
            <i class="fa fa-file-pdf-o"></i>
            <?php echo e(trans('application.invoice_settings')); ?></h1>
    </div>
    <section class="content">
        <div class="row">
            <div class="col-md-3">
                <?php echo $__env->make('settings.partials._menu', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            </div>
            <div class="col-md-9">
                <div class="box box-primary">
                    <div class="box-body">
                        <?php if(count($errors) > 0): ?>
                            <?php echo form_errors($errors); ?>

                        <?php endif; ?>
                        <?php if($setting): ?>
                            <?php echo Form::model($setting, ['route' => ['invoice.update', $setting->uuid], 'method'=>'PATCH', 'files'=>true]); ?>

                        <?php else: ?>
                            <?php echo Form::open(['route' => ['invoice.store'], 'files'=>true]); ?>

                        <?php endif; ?>
                        <div class="form-group">
                            <?php echo Form::label('start_number', trans('application.number_invoice_starting')); ?>

                            <?php echo Form::text('start_number', $setting ? $setting->start_number : '', ['class' => "form-control input-sm"]); ?>

                        </div>
                        <div class="form-group">
                            <?php echo Form::label('terms', trans('application.invoice_terms')); ?>

                            <?php echo Form::textarea('terms', null, ['class' => "form-control input-sm", 'id'=>'invoice_terms']); ?>

                        </div>
                        <div class="form-group">
                            <?php echo Form::label('logo', trans('application.logo').'('.trans('application.width').': 200)'); ?>

                            <?php if($setting && $setting->logo != ''): ?>
                                <?php echo HTML::image(asset('assets/img/'.$setting->logo), 'logo', array('class' => 'thumbnail')); ?>

                            <?php endif; ?>
                            <div class=" form-group input-group input-file" style="margin-bottom: 10px;width:50%">
                                <div class="form-control input-sm"></div>
                                <span class="input-group-addon">
                                        <a class='btn btn-sm btn-primary' href='javascript:;'>
                                            <?php echo e(trans('application.browse')); ?>

                                            <input type="file" name="logo" id="logo" onchange="$(this).parent().parent().parent().find('.form-control').html($(this).val());">
                                        </a>
                                    </span>
                            </div>
                        </div>
                        <div class="form-group ">
                            <?php echo Form::label('due_days', trans('application.due_after')); ?>

                            <div class="input-group  col-md-2">
                                <?php echo Form::input('number','due_days', null, ['class' => "form-control input-sm", 'min'=>'0']); ?>

                                <span class="input-group-btn ">
                                        <button class="btn btn-sm btn-default"><?php echo e(trans('application.days')); ?></button>
                                    </span>
                            </div>
                        </div>
                        <div class="form-group ">
                            <?php echo Form::label('show_status', trans('application.show_status')); ?>

                            <div class="input-group  col-md-2">
                                <?php echo Form::select('show_status',['0'=>'No','1'=>'Yes'], null, ['class' => "form-control input-sm", 'min'=>'0']); ?>

                            </div>
                        </div>
                        <div class="form-group">
                            <?php echo Form::submit(trans('application.save_settings'), ['class="btn btn-primary btn-sm"']); ?>

                        </div>
                        <?php echo Form::close(); ?>

                    </div>
                </div>
            </div>
        </div>
    </section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script>
        $('#invoice_terms').wysihtml5({image:false,link:false});
    </script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>