<?php $__env->startSection('content'); ?>

       <div class="content-wrapper">
      <!-- Content Header (Page header) -->
      <section class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6">
              <h1>Sale</h1>
            </div>
            <div class="col-sm-6">
              <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="#">Home</a></li>
                <li class="breadcrumb-item active">Edit Sale</li>
              </ol>
            </div>
          </div>
        </div><!-- /.container-fluid -->
      </section>

      <!-- Main content -->
      <section class="content">
        <div class="container-fluid">
          <div class="card card-primary">
            <form action="<?php echo e(url('sale-update/'.$register_data->transaction_id)); ?>" method="post" enctype="multipart/form-data">
              <?php echo csrf_field(); ?>
              <!--<?php echo method_field('PUT'); ?>-->
              <div class="card-body row">
                <div class="col-md-4">
                <div class="form-group">
                            <label>Supplied by</label>
                            <!-- <select class="form-control select2bs4" style="width: 100%;"> if live search needed -->
                            <select class="form-control" style="width: 100%;" id="supplied_by" name="supplied_by" readonly>
                              <option value="SRK DIESEL TRADING L.L.C" <?php if($register_data->supplied_by == 'SRK DIESEL TRADING L.L.C') echo 'selected'; ?>>SRK DIESEL TRADING L.L.C</option>
                              <option value="THREE STAR FUEL TRADING L.L.C" <?php if($register_data->supplied_by == 'THREE STAR FUEL TRADING L.L.C') echo 'selected'; ?>>THREE STAR FUEL TRADING L.L.C</option>
                            </select>
                             <?php if($errors->has('supplied_by')): ?>
                            <span class="text-danger"><?php echo e($errors->first('supplied_by')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>
                 <div class="col-md-4">
                <div class="form-group">
                            <label>Date</label>
                           <input type="date" class="form-control" name="date" id="date"  value="<?php echo e($register_data->transaction_date); ?>" autocomplete="off">
                            <?php if($errors->has('date')): ?>
                            <span class="text-danger"><?php echo e($errors->first('date')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>
                          <div class="col-md-4">
                <div class="form-group">
                            <label>Transaction Time</label>
                           <input type="time" class="form-control" name="transaction_time" id="transaction_time"   autocomplete="off" value="<?php echo e($register_data->transaction_time); ?>">
                            <?php if($errors->has('transaction_time')): ?>
                            <span class="text-danger"><?php echo e($errors->first('transaction_time')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>
                <div class="col-md-4">
                <div class="form-group">
                            <label>Ledger</label>
                            <!-- <select class="form-control select2bs4" style="width: 100%;"> if live search needed -->
                            <select class="form-control" style="width: 100%;" name="ledger" >
                             <option value="CashMemo" <?php if($register_data->ledger == 'CashMemo') echo 'selected'; ?>>Cash Memo</option>
                              <option value="DoNo" <?php if($register_data->ledger == 'DoNo') echo 'selected'; ?>>DoNo</option>
                            </select>
                            <?php if($errors->has('ledger')): ?>
                            <span class="text-danger"><?php echo e($errors->first('ledger')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>
                                 <div class="col-md-4">
                <div class="form-group">
                            <label>Ledger Number</label>
                           <input type="text" class="form-control" name="ledger_value" id="ledger_value"   autocomplete="off" value="<?php echo e($register_data->ledger_value); ?>">
                            <?php if($errors->has('ledger_value')): ?>
                            <span class="text-danger"><?php echo e($errors->first('ledger_value')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>
                <?php if($register_data->ledger == 'DoNo' && $dono_status->dono_status !=1): ?>
                   <div class="col-md-4 checkdo ">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Do Number</label>
                   <input type="number" class="form-control" min="1" id="ledger_value" name="ledger_value" step="any" value="<?php echo e($register_data->ledger_value); ?>" placeholder="Enter DO number" autocomplete="off" required="">
                    <?php if($errors->has('ledger_value')): ?>
                      <span class="text-danger"><?php echo e($errors->first('ledger_value')); ?></span>
                      <?php endif; ?>
                  </div>

                </div>
                <?php endif; ?>
                       <div class="col-md-4">
                <div class="form-group">
                            <label>Customer Name</label>
                           <select class="form-control select2bs4" style="width: 100%;" name="customer_id" onchange="edit_vehicle_by_customer(this.value);edit_customer_amount(this.value)" required="">
                             <option value="">Select </option>
                             <?php $__currentLoopData = $customer_data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <option value="<?php echo e($customer->id); ?>"  <?php if($register_data->customer_id == $customer->id) echo 'selected'; ?>><?php echo e($customer->company_name); ?></option>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                           
                          </div>

                </div>
                  <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Vehicle Number</label>
                  <select class="form-control select2bs4" style="width: 100%;" name="vehicle_number" id="edit_vehicle_number" onchange="edit_vehicle_change(this.value)">
                
                    <?php $__currentLoopData = $all_vehicle; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $all_vehi): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($all_vehi->id); ?>"<?php if($register_data->vehicle_number ==$all_vehi->id ) echo 'selected' ?> ><?php echo e($all_vehi->vehicle_no); ?> -<?php echo e($all_vehi->driver_name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                 </select>
                  </div>

                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Driver Name</label>
                <!--     <input type="text" class="form-control" name="driver_name" id="driver_name" value="<?php echo e($register_data->driver_name); ?>" autocomplete="off">
                     <?php if($errors->has('driver_name')): ?>
                      <span class="text-danger"><?php echo e($errors->first('driver_name')); ?></span>
                      <?php endif; ?> -->
                          <select class="form-control select2bs4" style="width: 100%;" name="driver_name" id="edit_driver_name" onchange="edit_vehicle_change(this.value)">
                    <option value="<?php echo e($register_data->driver_name); ?>" ><?php echo e($vehicle_data->driver_name); ?></option>
                 </select>
                  </div>

                </div>
      <input type="hidden" id="edit_stock_value" value="<?php echo e($stock->stock +$register_data->quantity); ?>">
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">QTY - Gallon</label>
                    <input type="number" class="form-control" step="any" min="1" id="quantity" name="quantity" value="<?php echo e($register_data->quantity); ?>" placeholder="Enter QTY - Gallon" autocomplete="off" onchange="editqtyavailable(this.value)">
                    <?php if($errors->has('quantity')): ?>
                      <span class="text-danger"><?php echo e($errors->first('quantity')); ?></span>
                      <?php endif; ?>
                  </div>

                </div>
                 <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Return -QTY</label>
                    <input type="number" class="form-control" step="any" min="1" id="return_qty" name="return_qty" value="<?php echo e($register_data->return_qty); ?>" placeholder="Enter QTY - Gallon" autocomplete="off" >
                      <input type="hidden" class="form-control" step="any" min="1" id="hidden_return_qty" name="hidden_return_qty" value="<?php echo e($register_data->return_qty); ?>" placeholder="Enter QTY - Gallon" autocomplete="off" >
                    <?php if($errors->has('return_qty')): ?>
                      <span class="text-danger"><?php echo e($errors->first('return_qty')); ?></span>
                      <?php endif; ?>
                  </div>

                </div>
<input type="hidden" name="hide_value" id="hide_value">
              
                <div class="col-md-4 ">
                  <div class="form-group">
                    <label for="exampleInputEmail1">QTY - ltr (1GLn is 4.5 Ltr)</label>
                    <input type="text" class="form-control" id="quantity_ltr" name="quantity_ltr"  value="<?php echo e($register_data->quantity_ltr); ?>" readonly>
                  </div>
                </div>
              
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Unit / Gallon Price</label>
                    <input type="number" class="form-control" step="any" id="unit_price" value="<?php echo e($register_data->unit_price); ?>" name="unit_price" autocomplete="off" min="1" readonly>
                    <?php if($errors->has('unit_price')): ?>
                      <span class="text-danger"><?php echo e($errors->first('unit_price')); ?></span>
                      <?php endif; ?>
                  </div>

                </div>

                <div class="col-md-4 ">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Unit / Liter Price (gallon unit x Price)</label>
                    <input type="text" class="form-control" id="unit_ltr_price" name="unit_ltr_price" value="<?php echo e($register_data->unit_ltr_price); ?>" readonly>
                  </div>
                </div>
                
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Gallon Price (Gallon x Gallon price)</label>
                    <input type="text" class="form-control" id="gallon_price" name="gallon_price" value="<?php echo e($register_data->gallon_price); ?>" readonly>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Tax VAT %</label>
                    <input type="text" class="form-control" id="tax" name="tax" value="<?php echo e($register_data->tax); ?>"  >
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Total</label>
                    <input type="text" class="form-control" id="total" name="total" value="<?php echo e($register_data->total); ?>" readonly>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Kilometer NOW(KMs)</label>
                    <input type="number" class="form-control" id="kilometer" step="any" value="<?php echo e($register_data->kilometer); ?>" name="kilometer" placeholder="Enter Kilometer NOW(KMs)">
                    <?php if($errors->has('kilometer')): ?>
                      <span class="text-danger"><?php echo e($errors->first('kilometer')); ?></span>
                      <?php endif; ?>
                  </div>

                </div>


              </div>
              <div class="card-footer pt-0 mb-5">
                <button class="btn btn-primary update" type="submit">Submit</button>
                <a href="<?php echo e(route('admin.index')); ?>" class="btn btn-danger" >Back</a>
              </div>
            </form>
          </div>
        </div>
        <!-- /.container-fluid -->
      </section>
      <!-- /.content -->


    </div>
      <!-- /.content -->
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script src="<?php echo e(asset('js/form.js')); ?>"></script>
<script>
    $(document).ready(function() {
      $("#sale").addClass('menu-open');
    //   $("#add-sale").addClass('active');
    });
  </script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/z7a6qwiy0umc/public_html/srkdiesel-trading.in/resources/views/edit-register.blade.php ENDPATH**/ ?>