<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.10/css/intlTelInput.css">
<link rel="stylesheet" type="text/css" href="{{ asset('admin/plugins/datepicker/less/datepicker.less') }}">
<link href="{{ asset('admin/plugins/datepicker/css/datepicker.css') }}" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />

<form class="row g-3 auto-width" action="{{ route('invoice-update', $invoice->id)}}" method="post" enctype='multipart/form-data'>
        @csrf
        <div class="col-md-6 mb-1">
            <label for="bill_date" class="form-label">Invoice Date </label>
            <div class="input-group">
                <input type="text" name="consignor_invoice_date" id="consignor_invoice_date" class="form-control " value="{{$invoice->consignor_invoice_date}}" placeholder="Enter Invoice Date">
            </div>
        </div>
        <div class="col-md-6 mb-1">
            <label for="consignor_invoice_no" class="form-label">Invoice No <span class="text-danger"><b>*</b></span></label>
            <div class="input-group" >
                  <input type="number" name="consignor_invoice_no" id="consignor_invoice_no" class="form-control " value="{{$invoice->consignor_invoice_no}}" placeholder="Enter Invoice No ">
                  <span class="text-danger error_bill_no" style="display:none;">This field is required.</span>
            </div>
        </div>
        <div class="col-md-6 mb-1">
            <label for="consignor_invoice_value" class="form-label">Invoice Value<span class="text-danger"><b>*</b></span></label>
            <div class="input-group">
                <input type="number" name="consignor_invoice_value"  id="consignor_invoice_value" class="form-control " value="{{$invoice->consignor_invoice_value}}" placeholder="Enter Invoice Value">
                <span class="text-danger error_invoice_value" style="display:none;">This field is required.</span>
            </div>
        </div>
        <div class="col-md-6 mb-1">
            <label for="Way Bill No" >Way Bill No</label>
            <div class="input-group" >
                <input class="form-control form-control-lg" type="text" name="way_bill_no" id="way_bill_no" placeholder="Way Bill No" value="{{$invoice->way_bill_no}}">
            </div>
        </div>
        <div class="col-md-6 mb-1">
            <label for="Way Bill Date"  >Way Bill Date</label>
            <div class="input-group">
                <input class="form-control form-control-lg" type="text" name="way_bill_date" id="way_bill_date" placeholder="Way Bill Date"value="{{$invoice->way_bill_date}}">
            </div>
        </div>
        <div class="col-md-6 mb-1">
            <label for="Way Exp date" >Way Exp Date</label>
            <div class="input-group">
                <input class="form-control form-control-lg" type="text" name="way_exp_date" id="way_exp_date" placeholder="Way Exp date" value="{{$invoice->way_bill_expiry_date}}">
            </div>
</form>
<script type="text/javascript" src="{{ asset('admin/plugins/datepicker/js/bootstrap-datepicker.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.10/js/intlTelInput.js"></script>
<script type="text/javascript" src="{{ asset('admin/plugins/datepicker/js/bootstrap-datepicker.js') }}"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script>

    $(function () {
        $('#bill_date').datepicker({
            dateFormat: 'dd/mm/yy'
        })
        .on('changeDate', function (ev) {
             $(this).datepicker('hide');
        })

    });

    $(function () {
        $('#way_bill_date').datepicker({
            dateFormat: 'dd/mm/yy'
        })
        .on('changeDate', function (ev) {
             $(this).datepicker('hide');
        })

    });

    $(function () {
        $('#way_exp_date').datepicker({
            dateFormat: 'dd/mm/yy'
        })
        .on('changeDate', function (ev) {
             $(this).datepicker('hide');
        })

    });
</script>
