<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-file-pdf-o"></i> 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="panel panel-default">
                <div class="panel-heading">Invoice Settings</div>
                <div class="panel-body">
                    <?php if(count($errors) > 0): ?>
                    <?php echo form_errors($errors); ?>

                    <?php endif; ?>
                    <?php if(Session::has('flash_notification.message')): ?>
                    <?php echo message(); ?>

                    <?php endif; ?>

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

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

                    <?php endif; ?>
                    <div class="form-group">
                        <?php echo Form::label('start_number', 'Number Invoice Starting'); ?>

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

                    </div>
                    <div class="form-group">
                        <?php echo Form::label('terms', 'Invoice Terms'); ?>

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

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

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

                        <?php endif; ?>
                        <?php echo Form::file('logo', ['class'=>"form-control"]); ?>

                    </div>
                    <div class="form-group ">
                        <?php echo Form::label('due_days', 'Due After'); ?>

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

                            <span class="input-group-btn ">
                                <button class="btn btn-default">Days</button>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <?php echo Form::submit('Save Settings', ['class="btn btn-info"']); ?>

                    </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(); ?>