<?php $__env->startSection('content'); ?>
<div class="panel panel-default">
    <div class="panel-heading">edit Miscellaneous Charge</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 method="post" class="create_billing_form" action="<?php echo e(route('charges.update', $charge->id)); ?>" >
            <input type="hidden" value="<?php echo e(csrf_token()); ?>" name="_token" />
           
                <div class="form-group">
                    <label for="title">Customer:</label>
                    <select data-live-search="true" class="form-control" name="customer_id">
                        <option 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 == $charge->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">description :</label><br>
                    <input type="text" class="form-control" name="description" value="<?php echo e($charge->description); ?>"/>
                </div>

                <div class="form-group">
                    <label for="title">fee :</label>
                    <input type="text" class="form-control" name="price" value="<?php echo e($charge->price); ?>"/>
                </div>


                 
                <div class="form-group">
                    <label for="title">date invoice :</label>
                    <select class="form-control" name="date_invoice">
                        <option <?php if( $charge->date_invoiced == 'next_day' ): ?> selected  <?php endif; ?> value="next_day">Next day</option>
                        <option <?php if( $charge->date_invoiced == 'end_of_the_week' ): ?> selected  <?php endif; ?> value="end_of_the_week" value="end_of_the_week">End of the week</option>
                        <option <?php if( $charge->date_invoiced == 'end_of_the_month' ): ?> selected  <?php endif; ?> value="end_of_the_month" value="end_of_the_month" >End of the month</option>
                    </select>
                </div>
                 <?php if( $charge->invoiced == 0 ): ?>
                
                <?php endif; ?>
               
                 <button style="float: right;" type="submit" class="btn btn-primary">Save</button>
             </form>
             <form style="float: left;"  onsubmit="return confirm('Do you really want to delete this charge?');" action="<?php echo e(route('charges.destroy', $charge->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>
    </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/charges/edit.blade.php ENDPATH**/ ?>