@extends('backend.header')
@section('index-content')
<style>
    .form-control {
        height: 40px;
    }
    @media (min-width: 768px){
        .form-horizontal .control-label {
            padding-top: 7px;
            margin-bottom: 0;
            text-align: right;
        }
    }
</style>



<?php
function convertToUnicodeNumber($input) {

    $standard_numsets = array("0","1","2","3","4","5","6","7","8","9");
    $devanagari_numsets = array("०","१","२","३","४","५","६","७","८","९");
    
    return str_replace($standard_numsets, $devanagari_numsets, $input);
}
?>
<section role="main" class="content-body">
    <header class="page-header">
        <div class="row">
          <div class="col-lg-5">
            <h2>Add In Wards</h2>  
          </div>
        
          <div class="col-lg-5">
            <ol class="breadcrumbs">
                <li>
                  <a href="{{url('index')}}">
                    <i class="fa fa-home"></i>
                </a>
                </li>
                <li><span class="active">In Wards</span></li>
                <li><span class="active">In Wards List </span></li>
            </ol>
          </div>
          <div class="col-lg-2">
              <div class="back-btn-div">
            <button class="btn btn-primary back-btn" onclick="window.history.back()" style="margin-right: 25px;">Back</button>
        </div>
          </div>
      </div>
  </header>
     <!-- <header class="page-header">
        <h2> Add In Wards</h2>
    </header>
        <div class="row">
          <div class="col-xs-12">
            <div class="right-wrapper">
              <ol class="breadcrumbs">
                <li>
                  <a href="{{url('index')}}">
                    <i class="fa fa-home"></i>
                </a>
            </li>
            <li><span class="active">In Wards</span></li>
            <li><span class="active">In Wards List </span></li>
        </ol>
        </div>
        </div>
    </div>
 -->


<!-- allot user code here -->
<div class="row" id="userallotform">
  <div class="col-md-12">
   @if(session('error'))
   <div class="alert alert-danger">{{session('error')}}</div>
   @endif
    @if(session('success'))
   <div class="alert alert-success">{{session('success')}}</div>
    @endif


   <section class="panel mt-2">
    <header class="panel-heading">
        <h4 class="my-0">District Wise Search</h4>  
        <!-- <div class="back-btn-div">
            <button class="btn btn-primary back-btn" onclick="window.history.back()">Back</button>
        </div> -->

  </header>
  <form action="{{url('inwards_store')}}" id="inwardform"   method="post" class="form-horizontal" enctype="multipart/form-data">
      @csrf
      <div class="panel-body mb-4">

        <div class="row px-3">
            <div class="form-group">
                <label class="col-sm-2 control-label">District Name</label>
                <div class="col-sm-10">
                    <select name="jilla_id" class="h40 w-100" id="jilla_id" >
                        <option value="">Select District</option>
                        @foreach($jilla as $j)
                        <option value="{{$j->id}}">{{$j->area_name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Make Name</label>
                <div class="col-sm-10">
                    <select name="maker_name" class="h40 w-100" >
                        <option value="">Select Make </option>
                        @foreach($makeslist as $make)
                        <option value="{{$make->name}}">{{$make->name}}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Number</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text"  name="invoice_number" class="form-control">
                    </div>
                </div>
            </div>
            <!--  <div class="form-group">
                <label class="col-sm-2 control-label">No of Drivers</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="num_drivers" class="form-control" >
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">No of SPD's</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="num_spd" class="form-control">
                    </div>
                </div>
            </div>

           

            <div class="form-group">
                <label class="col-sm-2 control-label">Tiltable Adapters</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="tiltable_adapters" class="form-control">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Bufferstock</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="buffer_stock" class="form-control">
                    </div>
                </div>
            </div> -->
           
            <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Date</label>
                <div class="col-sm-10">
                    <div>
                        <input type="date" name="invoice_date" class="form-control">
                    </div>
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="col-sm-2 control-label">Total Invoice Qunatity </label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="total" class="form-control">
                    </div>
                </div>
            </div>
            -->
            
         <!--    <div class="form-group">
                <label class="col-sm-2 control-label">Received Tiltable Adapters</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="tiltadap_rcv_qty" class="form-control">
                    </div>
                </div>
            </div> -->
            <!-- <div class="form-group">
                <label class="col-sm-2 control-label">Received Bufferstock</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="bufstck_rcv_qty" class="form-control">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Received DRIVERS</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="num_drv_rcv_qty" class="form-control">
                    </div>
                </div>
            </div>
               <div class="form-group">
                <label class="col-sm-2 control-label">No of SPD's Received</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="num_spd_rcv_qty" class="form-control">
                    </div>
                </div>
            </div> -->
           <!--  <div class="form-group">
                <label class="col-sm-2 control-label">Total Received Quantity</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="total_rcv_qty" class="form-control">
                    </div>
                </div>
            </div> -->
            <div class="form-group">
                <label class="col-sm-2 control-label">Received Date</label>
                <div class="col-sm-10">
                    <div>
                        <input type="date" name="date_of_receiving" class="form-control">
                    </div>
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="col-sm-2 control-label">Received Quantity</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="received_quantity" class="form-control">
                    </div>
                </div>
            </div> -->
            <div class="form-group">
                <label class="col-sm-2 control-label">Files</label>
                <div class="col-sm-10">
                    <div>
                        <input type="file" name="files" class="form-control" multiple="multiple">
                    </div>
                </div>
            </div>
          
            <div class="form-group">
                <label class="col-sm-2 control-label">Remarks</label>
                <div class="col-sm-10">
                    <div>
                        <input type="text" name="remarks" class="form-control">
                    </div>
                </div>
            </div>

             <div class="form-group">
                <label class="col-sm-12 control-label text-center mt-4">WATTAGE OF LIGHTS</label>
            </div>
             <div class="form-group">
                <label class="col-sm-2 control-label">Invoice Qunatity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                               <input type="text" name="led_wattage_18" placeholder="18 W" class="form-control wattage" id="led_wattage_18" data-wat="18">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="led_wattage_35" id="led_wattage_35" placeholder="35 W" class="form-control wattage" data-wat="35">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="led_wattage_70" id="led_wattage_70" placeholder="70 W" class="form-control wattage" data-wat="70">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="led_wattage_110" id="led_wattage_110" placeholder="110 W" class="form-control wattage" data-wat="110">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="text" name="led_wattage_190" id="led_wattage_190" placeholder="190 W" class="form-control wattage" data-wat="190">
                           </div>
                       </div>
                   </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">Received Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                               <input type="text" name="rcv_qty_18w" id="rcv_qty_18w" placeholder="18 W" class="form-control rcv_wattage" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="rcv_qty_35w" id="rcv_qty_35w"  placeholder="35 W" class="form-control rcv_wattage" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="rcv_qty_70w" id="rcv_qty_70w" placeholder="70 W" class="form-control rcv_wattage" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="rcv_qty_110w" id="rcv_qty_110w"  placeholder="110 W" class="form-control rcv_wattage" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="text" name="rcv_qty_190w" id="rcv_qty_190w" placeholder="190 W" class="form-control rcv_wattage" disabled>
                           </div>
                       </div>
                   </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-12 control-label text-center mt-4">SPARE LIGHTS WATTAGE </label>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Invoice Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                               <input type="number" name="bufferstck_invoice_qty_18w" id="bufferstck_invoice_qty_18w" placeholder="18 W" class="form-control spare_wattage" data-wat="18">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="bufferstck_invoice_qty_35w" id="bufferstck_invoice_qty_35w" placeholder="35 W" class="form-control spare_wattage" data-wat="35">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="bufferstck_invoice_qty_70w" id="bufferstck_invoice_qty_70w" placeholder="70 W" class="form-control spare_wattage" data-wat="70">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="bufferstck_invoice_qty_110w" id="bufferstck_invoice_qty_110w" placeholder="110 W" class="form-control spare_wattage" data-wat="110">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="bufferstck_invoice_qty_190w" id="bufferstck_invoice_qty_190w" placeholder="190 W" class="form-control spare_wattage" data-wat="190">
                           </div>
                       </div>
                   </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Received Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                              <input type="number" name="bufferstck_received_qty_18w"  id="bufferstck_received_qty_18w" placeholder="18 W" class="form-control spare_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="bufferstck_received_qty_35w" id="bufferstck_received_qty_35w" placeholder="35 W" class="form-control spare_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="bufferstck_received_qty_70w" id="bufferstck_received_qty_70w" placeholder="70 W" class="form-control spare_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="bufferstck_received_qty_110w" id="bufferstck_received_qty_110w" placeholder="110 W" class="form-control spare_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="bufferstck_received_qty_190w" id="bufferstck_received_qty_190w" placeholder="190 W" class="form-control spare_wattage_rev" disabled>
                           </div>
                       </div>
                   </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-12 control-label text-center mt-4">WATTAGE OF DRIVERS</label>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Invoice Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                               <input type="number" name="drivers_invoice_qty_18w" id="drivers_invoice_qty_18w" placeholder="18 W" class="form-control driver_wattage" data-wat="18">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="drivers_invoice_qty_35w" id="drivers_invoice_qty_35w" placeholder="35 W" class="form-control driver_wattage" data-wat="35">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="drivers_invoice_qty_70w" id="drivers_invoice_qty_70w" placeholder="70 W" class="form-control driver_wattage" data-wat="70">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="drivers_invoice_qty_110w"  id="drivers_invoice_qty_110w" placeholder="110 W" class="form-control driver_wattage" data-wat="110">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="drivers_invoice_qty_190w" id="drivers_invoice_qty_190w" placeholder="190 W" class="form-control driver_wattage" data-wat="190">
                           </div>
                       </div>
                   </div>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Received Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                              <input type="number" name="drivers_received_qty_18w" id="drivers_received_qty_18w" placeholder="18 W" class="form-control driver_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="drivers_received_qty_35w"   id="drivers_received_qty_35w" placeholder="35 W" class="form-control driver_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="drivers_received_qty_70w" id="drivers_received_qty_70w" placeholder="70 W" class="form-control driver_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="drivers_received_qty_110w"  id="drivers_received_qty_110w" placeholder="110 W" class="form-control driver_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="drivers_received_qty_190w"  id="drivers_received_qty_190w" placeholder="190 W" class="form-control driver_wattage_rev" disabled>
                           </div>
                       </div>
                   </div>
                </div>
            </div>

             <div class="form-group" >
                <label class="col-sm-12 control-label text-center mt-4">WATTAGE OF SPD</label>
            </div>
           
            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Invoice Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                               <input type="number" name="spd_invoice_qty_18w" id="spd_invoice_qty_18w" placeholder="18 W" class="form-control spd_wattage" data-wat="18">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="text" name="spd_invoice_qty_35w"   id="spd_invoice_qty_35w" placeholder="35 W" class="form-control spd_wattage" data-wat="35">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="spd_invoice_qty_70w" id="spd_invoice_qty_70w" placeholder="70 W" class="form-control spd_wattage" data-wat="70">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="spd_invoice_qty_110w" id="spd_invoice_qty_110w" placeholder="110 W" class="form-control spd_wattage" data-wat="110">
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="spd_invoice_qty_190w" id="spd_invoice_qty_190w" placeholder="190 W" class="form-control spd_wattage" data-wat="190">
                           </div>
                       </div>
                   </div>
                </div>
            </div>
             <div class="form-group">
                <label class="col-sm-2 control-label pt-0" >Received Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 col-sm-6 col-md-4 col-lg-20 pr-2">
                           <div>
                              <input type="number" name="spd_received_qty_18w" id="spd_received_qty_18w" placeholder="18 W" class="form-control spd_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="spd_received_qty_35w"  id="spd_received_qty_35w" placeholder="35 W" class="form-control spd_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="spd_received_qty_70w" id="spd_received_qty_70w" placeholder="70 W" class="form-control spd_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 px-2">
                           <div>
                               <input type="number" name="spd_received_qty_110w" id="spd_received_qty_110w" placeholder="110 W" class="form-control spd_wattage_rev" disabled>
                           </div>
                       </div>
                        <div class="col-12 col-sm-6 col-md-4 col-lg-20 pl-2">
                           <div>
                               <input type="number" name="spd_received_qty_190w"  id="spd_received_qty_190w" placeholder="190 W" class="form-control spd_wattage_rev" disabled>
                           </div>
                       </div>
                   </div>
                </div>
            </div>

             <div class="form-group" >
                <label class="col-sm-12 control-label text-center mt-4">TILTABLE ADAPTERS</label>
            </div>
           
            <div class="form-group">
                <label class="col-sm-2 control-label pt-0">Invoice Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 ">
                           <div>
                               <input type="number" name="tiltable_adapters" id="tiltable_adapters" placeholder="Tiltable adapters" class="form-control">
                           </div>
                       </div>
                      
                   </div>
                </div>
            </div>
             <div class="form-group">
                <label class="col-sm-2 control-label pt-0" >Received Quantity</label>
                <div class="col-sm-10">
                   <div class="row">
                       <div class="col-12 ">
                           <div>
                              <input type="number" name="tiltadap_rcv_qty" id="tiltadap_rcv_qty" placeholder="Tiltable adapters Received" class="form-control">
                           </div>
                       </div>
                        
                   </div>
                </div>
            </div>

        </div>
        <div class="row mt-3">
            <div class="col-12 px-3">
                <div class="text-right pr-2">
                    <input type="submit" class="btn btn-success" value="Submit">
                </div>
            </div>
        </div>

    </div>
</form>
</div>

</div>

</section>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>

<script>

    $('.wattage').on('change',function(){

        $(".rcv_wattage").prop('disabled', true);
        $(".rcv_wattage").prop('required', false);
        $(".wattage").each(function() {
            if($(this).val() !=""){
            var wat =$(this).data('wat');
            $('#rcv_qty_'+wat+'w').prop('disabled', false);       
            $('#rcv_qty_'+wat+'w').prop('required', true); 
            }
        });            

    });

    $('.spare_wattage').on('change',function(){

        $(".spare_wattage_rev").prop('disabled', true);
        $(".spare_wattage_rev").prop('required', false);
         $(".spare_wattage").each(function() {
            if($(this).val() !=""){
        var wat =$(this).data('wat');
        $('#bufferstck_received_qty_'+wat+'w').prop('disabled', false);       
        $('#bufferstck_received_qty_'+wat+'w').prop('required', true); 
        }
        });        

    });
    $('.driver_wattage').on('change',function(){

        $(".driver_wattage_rev").prop('disabled', true);
        $(".driver_wattage_rev").prop('required', false);
         $(".driver_wattage").each(function() {
            if($(this).val() !=""){
        var wat =$(this).data('wat');
        $('#drivers_received_qty_'+wat+'w').prop('disabled', false);       
        $('#drivers_received_qty_'+wat+'w').prop('required', true);  
        }
        });       

    });
    $('.spd_wattage').on('change',function(){

        $(".spd_wattage_rev").prop('disabled', true);
        $(".spd_wattage_rev").prop('required', false);
         $(".spd_wattage").each(function() {
            if($(this).val() !=""){
        var wat =$(this).data('wat');
        $('#spd_received_qty_'+wat+'w').prop('disabled', false);       
        $('#spd_received_qty_'+wat+'w').prop('required', true);      
        }
        });   

    });


   $("#inwardform").validate({
      rules: {

        jilla_id: 'required',
         maker_name: 'required',
          date_of_receiving: 'required',
         invoice_date: 'required', 
       
         led_wattage_18: {
              required: function(element){
                      if($('#led_wattage_35').val() == "" && $('#led_wattage_70').val() == "" &&$('#led_wattage_110').val() == "" && $('#led_wattage_190').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

            rcv_qty_18w: {
              required: function(element){
                      if($('#rcv_qty_135w').val() == "" && $('#rcv_qty_70w').val() == "" &&$('#rcv_qty_110w').val() == "" && $('#rcv_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

             bufferstck_invoice_qty_18w: {
              required: function(element){
                      if($('#bufferstck_invoice_qty_35w').val() == "" && $('#bufferstck_invoice_qty_70w').val() == "" && $('#bufferstck_invoice_qty_110w').val() == "" && $('#bufferstck_invoice_qty_190w').val() == "")

                        {
                        //  alert($('#bufferstck_invoice_qty_70w').val());
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

              bufferstck_received_qty_18w: {
              required: function(element){
                      if($('#bufferstck_received_qty_35w').val() == "" && $('#bufferstck_received_qty_70w').val() == "" &&$('#bufferstck_received_qty_110w').val() == "" && $('#bufferstck_received_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

              drivers_invoice_qty_18w: {
              required: function(element){
                      if($('#drivers_invoice_qty_35w').val() == "" && $('#drivers_invoice_qty_70w').val() == "" &&$('#drivers_invoice_qty_110w').val() == "" && $('#drivers_invoice_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

               drivers_received_qty_18w: {
              required: function(element){
                      if($('#drivers_received_qty_35w').val() == "" && $('#drivers_received_qty_70w').val() == "" &&$('#drivers_received_qty_110w').val() == "" && $('#drivers_received_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

                 spd_invoice_qty_18w: {
              required: function(element){
                      if($('#spd_invoice_qty_35w').val() == "" && $('#spd_invoice_qty_70w').val() == "" &&$('#spd_invoice_qty_110w').val() == "" && $('#spd_invoice_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          },

           spd_received_qty_18w: {
              required: function(element){
                      if($('#spd_received_qty_35w').val() == "" && $('#spd_received_qty_70w').val() == "" &&$('#spd_received_qty_110w').val() == "" && $('#spd_received_qty_190w').val() == "")

                        {
                         return true;
                        }else{
                          return false; 
                            }
                  }
          }
      
      },


      messages: {
               led_wattage_18: 'Please Enter Atleast One Wattage',
                rcv_qty_18w: 'Please Enter Atleast One Wattage',

                  bufferstck_invoice_qty_18w: 'Please Enter Atleast One Wattage',
                bufferstck_received_qty_18w: 'Please Enter Atleast One Wattage',
                  drivers_invoice_qty_18w: 'Please Enter Atleast One Wattage',
                drivers_received_qty_18w: 'Please Enter Atleast One Wattage',
                  spd_invoice_qty_18w: 'Please Enter Atleast One Wattage',
                spd_received_qty_18w: 'Please Enter Atleast One Wattage',
               },

         submitHandler: function(form) {
                form.submit();
                          }
                  });



</script>
@stop
