<?php $__env->startSection('title','Register Form'); ?>
<?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="#">Home123</a></li>
                <li class="breadcrumb-item active">Add Sale</li>
              </ol>
            </div>
          </div>
        </div><!-- /.container-fluid -->
      </section>

      <!-- Main content -->
      <section class="content">
        <div class="container-fluid">
          <div class="card card-primary">
                   <?php if(session()->has('success')): ?>
            <div class="alert alert-success">
                <?php echo e(session()->get('success')); ?>

            </div>
        <?php endif; ?>
            <form action="<?php echo e(route('admin.store')); ?>" method="post" enctype="multipart/form-data">
              <?php echo csrf_field(); ?>
              <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" onchange="get_litr_show(this.value)">
                              <option value="SRK DIESEL TRADING L.L.C" >SRK DIESEL TRADING L.L.C</option>
                              <option value="THREE STAR FUEL TRADING L.L.C">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>Transaction Date</label>
                           <input type="date" class="form-control" name="date" id="date"  value="<?php echo date('Y-m-d'); ?>" 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">
                            <?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" onchange="getDoNumber(this.value)">
                             <option value="CashMemo">Cash Memo</option>
                              <option value="DoNo">D.O No.</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 enterdonno">
                  <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(old('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>
                <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="vehicle_by_customer(this.value);getPrice(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 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="vehicle_number" onchange="vehicle_change(this.value);">
                 </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" placeholder="Enter Driver Name" value="<?php echo e(old('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="driver_name" >
                 </select>
                  </div>

                </div>
             
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">QTY - Gallon</label>
                    <input type="number" class="form-control" min="1" id="quantity" name="quantity" step="any" value="<?php echo e(old('quantity')); ?>" placeholder="Enter QTY - Gallon" autocomplete="off" onchange="qtyavailable(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" min="1" id="return_qty" name="return_qty" step="any" value="<?php echo e(old('return_qty')); ?>" placeholder="Enter RETURN QTY" 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" id="stock_value" value="<?php echo e($stock->stock); ?>">
                <div class="col-md-4 hide1">
                  <div class="form-group">
                    <label for="exampleInputEmail1">QTY - ltr </label>
                    <input type="text" class="form-control" id="quantity_ltr" name="quantity_ltr" value="4.5" readonly >
                  </div>
                </div>
                <input type="hidden" name="hide_value" id="hide_value">
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Unit / Gallon Price</label>
                    <input type="number" class="form-control" id="unit_price" value="<?php echo e(old('unit_price')); ?>" step="any" name="unit_price" autocomplete="off" min="1" >
                    <?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 hide2">
                  <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="0" readonly onclick="hide2()">
                  </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"  readonly>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <label for="exampleInputEmail1">Tax VAT %</label>
                    <input type="number" class="form-control" id="tax" name="tax" value="5"  >
                  </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"  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(old('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 class="col-md-4">
                <div class="form-group">
                            <label>Payment Mode</label>
                            <!-- <select class="form-control select2bs4" style="width: 100%;"> if live search needed -->
                            <select class="form-control" style="width: 100%;" name="payment_mode" required="">
                             <option value="cash">Cash </option>
                              <option value="credit">Credit</option>
                            </select>
                            <?php if($errors->has('payment_mode')): ?>
                            <span class="text-danger"><?php echo e($errors->first('payment_mode')); ?></span>
                            <?php endif; ?>
                          </div>

                </div>


              </div>
              <div class="card-footer pt-0 mb-5">
                <button class="btn btn-primary save" type="submit">Submit</button>
                <a href="<?php echo e(route('admin.index')); ?>" class="btn btn-danger" >Back</a>
                <!--<input  class="btn btn-primary" type="button" onclick="hide1();" value="Remove Litr" id="btn-id">-->
              </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/mc25vp7ttt60/public_html/srkdiesel-trading.in/resources/views/add-register.blade.php ENDPATH**/ ?>