<?php $__env->startSection('content'); ?>
<div class="panel panel-default">
    <div class="panel-heading">edit Billing service  <?php echo e($service->service_ref); ?></div>


    <div class="panel-body">
        <?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><br />
        <?php endif; ?>
        <form style="float: right;"  onsubmit="return confirm('Do you really want to delete this service?');" action="<?php echo e(route('billing-services.destroy', $service->id)); ?>" method="post" style="margin-bottom: 10px;">
          <?php echo e(csrf_field()); ?>

          <?php echo method_field('delete'); ?>

          <button  class="btn btn-danger" type="submit">Delete</button>

        </form>
           <form method="post" class="edit_billing_form" action="<?php echo e(route('billing-services.update',$service->id)); ?>" >
            <input type="hidden" value="<?php echo e(csrf_token()); ?>" name="_token" />
            <button type="submit" class="btn btn-primary">Save</button>
                <div class="form-group" style="margin-top: 15px;">
                    <label for="title">Customer:</label>
                    <select data-live-search="true" class="form-control" name="customer_id">
                        <option <?php if( $service->customer_id ==0 ) { ?> selected <?php } ?> value="0">None</option>
                        <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option data-tokens="<?php echo e($customer->xero_name); ?>" <?php if( $customer->id == $service->customer_id ): ?> selected <?php endif; ?> value="<?php echo e($customer->id); ?>"><?php echo e($customer->xero_name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div> 
                <div class="form-group">
                    <label for="title">Tax rate type :</label>
                    <select data-live-search="true" class="form-control" name="tax_type">
                         <?php $__currentLoopData = $xeroTaxes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $rate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option <?php if( $key == $service->tax_type ) { ?> selected <?php } ?> data-tokens="<?php echo e($rate); ?>" value="<?php echo e($key); ?>"><?php echo e($rate); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                
                <input type="hidden" class="form-control" name="service_ref" value="<?php echo e($service->service_ref); ?>"/>
                <div class="form-group">
                    <label for="title">setup date (format yyyy-mm-dd) :</label>
                    <input type="text" class="form-control datefield"  name="setup_date" value="<?php echo e($service->setup_date); ?>"/>
                </div>
                <div class="form-group">
                    <label for="title">last billed date  (format yyyy-mm-dd) :</label>
                    <input type="text" class="form-control datefield"  name="last_billed" value="<?php echo e($service->last_billed); ?>"/>
                </div>

                <div class="form-group">
                    <label for="title">next billed date  (format yyyy-mm-dd) :</label>
                    <input type="text" class="form-control datefield"  name="next_billed" value="<?php echo e($service->next_billed); ?>"/>
                </div>

                <div class="form-group">
                    <label for="title">cancelled date  (format yyyy-mm-dd) :</label>
                    <input type="text" class="form-control datefield"  name="canseled_date" value="<?php echo e($service->canseled_date); ?>"/>
                </div>

                <div class="form-group">
                    <label for="title">description :</label><br>
                    <input type="text" class="form-control" name="description" value="<?php echo e($service->description); ?>"/>
                </div>
                <div class="form-group">
                    <label for="title">do not bill :</label>
                    <input type="checkbox" value="1" class="" name="do_not_bill" <?php if( $service->do_not_bill == 1 ) { ?> checked="checked" <?php } ?> />
                </div>
                <div class="form-group">
                    <label for="title">fee :</label>
                    <input type="text" class="form-control" name="fee" value="<?php echo e($service->fee); ?>"/>
                </div>
                <div class="form-group">
                    <label for="title">renew :</label>
                    <select class="form-control" name="renew">
                        <option value="1" <?php if( $service->renew == 1 ): ?> selected  <?php endif; ?>>Monthly</option>
                        <option value="2" <?php if( $service->renew == 2 ): ?> selected  <?php endif; ?>>Quarterly</option>
                        <option value="3" <?php if( $service->renew == 3 ): ?> selected  <?php endif; ?>>Annually</option>
                    </select>
                   
                </div>
                <div class="form-group">
                    <label for="title">username :</label>
                    <input type="text" class="form-control" name="username" value="<?php echo e($service->username); ?>"/>
                </div>
                <div class="form-group">
                    <label for="title">password :</label>
                    <input type="text" class="form-control" name="password" value="<?php echo e($service->password); ?>"/>
                </div>
                <div class="form-group">
                    <label for="title">agreement :</label>
                    <textarea style="width:100%;height: 75px" name="agreement"><?php echo e($service->agreement); ?></textarea>
                    
                </div>
                 <div class="form-group">
                    <label for="title">notes :</label><br>
                    <textarea style="width:100%;height: 75px;" name="notes"><?php echo e($service->notes); ?></textarea>
                </div>
                
                 <button type="submit" class="btn btn-primary">Save</button>
             </form>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/joraleqyan/PhpstormProjects/xero/resources/views/billing_services/edit.blade.php ENDPATH**/ ?>