<table width="100%" class="table m-table nowrap table-header-fixed table-striped table-bordered table-hover table-header-fixed" id="vehicle_expenses_view_table">
  <thead>
    <tr class="">
      <th>Sl No</th>
      <th>Bill ID</th>
      <th>Bill Date</th>
      <th>Vehicle</th>
      <th>Expense Type</th>
      <th>Expense Head</th>
      <th>Supplier</th>
      <th>Bill No</th>
      <th>Consignee</th>
      <th><?php echo $this->config->item('Tax_tax_name')?> %</th>
      <th><?php echo $this->config->item('Tax_tax_name')?> Amt</th>
      <th>Payable Amount</th>
      <th>Total Paid</th>
      <th>Balance</th>
      <th>Status</th>
      <th>Description</th>
      <th>Remarks</th>
      <th>Attachment</th>
      <th>Work</th>
      <th>Created By</th>
      <th>Created Date</th>
      <th>Actions</th>
      <th>Type</th>
      <th>Vehicle ID</th>
      <th>Bill ID</th>
      <th>Attachment</th>
      <th>Tax Percent</th>
      <th>Tax Amount</th>
      <th>Supplier</th>
      <th>Approval Status</th>
    </tr>
  </thead>
  <tbody>
  </tbody>
</table>

<div class="modal fade" tabindex="-1" id="vehicle_expense_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content">
      <div class="modal-header" style="background-color: #36a3f7;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add New Vehicle Expense
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <!--                                                    ADD EXPENSE DATA start-->
      <form autocomplete="off" data-form-type="vehicle_expense" id="form_vehicle_expense_add" data-modal-id="vehicle_expense_add_modal" method="post" action="<?php echo base_url().'bills/create'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body" style="padding-bottom: 0px">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_vehicle_expense_add_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <div style="background: white;border: 4px solid #f7f7fa;padding: 0px;margin: 0px;padding-bottom: 0px">
            <div class="m-section" style="margin: 0px 0 10px 0;">
              <h3 class="m-section__heading" style="padding: 10px;margin: 0px">Bill Details</h3>
              <div class="row">
                <div class="col-lg-6">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Supplier
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select required style="width: 100%" class="form-control m-select2  form_vehicle_expense_add_select" id="expense_vehicle_supplier_add" name="supplier_id" >
                        <option selected disabled>Select Supplier</option>
                        <?php
                        foreach($vehicle_suppliers as $row):
                          ?>
                          <option value="<?php echo $row->supplier_id?>"><?php echo $row->supplier_name ?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group m-form__group">
                    <label>
                      Expense Type
                    </label>
                    <div class="m-radio-inline" style="padding-top: 10px;">
                      <!-- <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input required type="radio" class="form_fields_radio"  name="expense_type" value="Fuel"> Fuel
                        <span></span>
                      </label> -->
                      <label class="m-radio m-radio--solid m-radio--state-warning">
                        <input type="radio" class="form_fields_radio" name="expense_type"  value="Workshop"> WorkShop
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-info">
                        <input type="radio" class="form_fields_radio" name="expense_type"  value="Service"> Service
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input type="radio" class="form_fields_radio" name="expense_type"  value="Spare_Parts"> Spare Parts
                        <span></span>
                      </label>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-6">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Vehicle
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select required style="width: 100%" class="form-control m-select2  form_vehicle_expense_add_select" id="expense_vehicle_add" name="vehicle_id" required >
                        <option selected disabled>Select Vehicle</option>
                        <?php
                        foreach($owned_vehicles as $row):
                          $v_id[]= $row->id;
                          ?>
                          <option value="<?php echo $row->id?>"><?php echo $row->vehicle_name." : ".$row->vehicle_no." [ ".$row->consignee_name." ] "?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group m-form__group">
                    <label for="user_name">
                      Expense Head
                    </label>
                    <div class="input-group m-input-group m-input-group--pill">
                      <div class="input-group-prepend">
                        <a href="#expense_head_add_modal"   data-toggle="modal" data-target="#expense_head_add_modal" class="btn btn-focus btn_add_types">
                          <i class="fa fa-plus-circle"></i>
                        </a>
                      </div>
                      <select style="width: 82%" class="form-control m-select2 m-select2-general form_vehicle_expense_add_select" required id="expense_head_add" name="expense_head">

                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" style="padding-left: 10px;padding-right: 10px;" >
                <div class="col-lg-3 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill No
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="bill_no" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Bill No" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-3 padding-0">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Date
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required  data-date-format="dd-mm-yyyy" id="vehicle_expense_date_add"  type="text" name="bill_date" class="form_vehicle_expense_add_fields form-control m-input m-input--pill m-input--air " placeholder="Bill Date" >
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-calendar"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-2 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      <?php echo $this->config->item('Tax_tax_name')?> %
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill ">
                      <select required id="vehicle_expense_tax_percent_add" name="bill_tax_percent" style="width: 100%" class="form-control m-input form_vehicle_expense_add_select vehicle_expense_amount_fields_add" aria-describedby="basic-addon1" data-placeholder="Select Tax Percentage">
                        <?php
                        $tax_percent = $this->config->item('Tax_tax_percent_old');
                        foreach($tax_percent as $row):
                          $selected_tax='';
                          if($row==0){
                            $selected_tax='selected';
                          }
                          ?>
                          <option <?php echo $selected_tax?> value="<?php echo $row?>"><?php echo $row?>%</option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                    <input type="hidden" name="bill_tax_amount" id="vehicle_expense_tax_amount_add" />
                  </div>
                </div>
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required type="text" name="bill_amount" id="vehicle_expense_amount_add" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields vehicle_expense_amount_fields_add" placeholder="Bill Amount" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" style="padding-left: 10px;padding-right: 10px;">
                <div class="col-lg-8">
                  <div class="row">
                    <div class="col-lg-6 padding-0" >
                      <div class="form-group m-form__group" >
                        <label for="user_name">
                          Consignee
                        </label>
                        <div class="m-input-icon m-input-icon--right">
                          <input type="text" name="consignee" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Consignee Name" aria-describedby="basic-addon1">
                          <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                    <div class="col-lg-6 padding-0" >
                      <div class="form-group m-form__group" >
                        <label for="user_name">
                          Bill Description
                        </label>
                        <div class="m-input-icon m-input-icon--right">
                          <input type="text" name="bill_description" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Bill Description" aria-describedby="basic-addon1">
                          <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Payable Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input readonly type="text" name="bill_payable_amount" id="vehicle_expense_payable_amount_add" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields " placeholder="Bill Amount" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-6" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Remarks
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="bill_remarks" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Bill Remarks" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Upload Bill Copy
                    </label>
                    <div class="custom-file">
                      <input type="file" class="custom-file-input form_vehicle_expense_add_fields" name="uploaded_file" id="expense_upload_bill_add">
                      <label class="custom-file-label" for="expense_upload_bill_add">Choose file</label>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br/>
          <div style="background: white;border: 4px solid #f7f7fa;padding: 0px;margin: 0px;padding-bottom: 0px">
            <div class="m-section" style="margin: 0px 0 10px 0;">
              <h3 class="m-section__heading" style="padding: 10px;margin: 0px">Transaction Details</h3>
              <div class="row" style="padding-top: 15px" >
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Paid Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required type="text" name="paid_amount" id="vehicle_expense_paid_amount_add" value="" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Paid Amount" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Paid Date
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input  data-date-format="dd-mm-yyyy" id="vehicle_expense_paid_date_add"  type="text" name="paid_date" class="form_vehicle_expense_add_fields form-control m-input m-input--pill m-input--air vehicle_expense_paid_amount_req_fields " placeholder="Paid Date" >
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-calendar"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Paid From Acc
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select id="vehicle_expense_debit_acc_add" name="debit_acc" style="width: 100%" class="form-control m-input form_vehicle_expense_add_select vehicle_expense_paid_amount_req_fields"  aria-describedby="basic-addon1">
                        <?php
                        foreach($this->config->item('account_heads') as $row):
                          $selected="";
                          if($row->acc_head_id==1){
                            $selected="selected";
                          }
                          ?>
                          <option <?php echo $selected?> value="<?php echo $row->acc_head_id?>"><?php echo $row->acc_head_name?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" >
                <div class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Payment Mode
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select id="vehicle_expense_payment_mode_add" name="payment_mode" style="width: 100%" class="form-control m-input form_vehicle_expense_add_select vehicle_expense_paid_amount_req_fields"  aria-describedby="basic-addon1">
                        <option selected disabled>Select Payment Mode</option>
                        <?php
                        foreach($this->config->item('payment_modes') as $row):
                          ?>
                          <option value="<?php echo $row?>"><?php echo $row?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      TR Reference No
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="reference_no"  class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Reference No" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      TR Reference Date
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" data-date-format="dd-mm-yyyy" name="reference_date" id="vehicle_expense_reference_date_add"  class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Reference Date" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-8" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Transaction Remarks
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="tr_remarks" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields" placeholder="Transaction Remarks" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Balance Amt
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input readonly type="text" name="balance_amount" id="vehicle_expense_balance_amount_add" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_add_fields"  aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br/>
          <input type="hidden" name="bill_type" value="vehicle" >
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">
            Close
          </button>
          <button type="submit" class="btn btn-primary form_submit_btn">
            Submit
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
<div class="modal fade" tabindex="-1" id="vehicle_expense_edit_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 800px">
    <div class="modal-content">
      <div class="modal-header" style="background-color: #00c5dc;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Edit Expense Details
        </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">
            &times;
          </span>
        </button>
      </div>
      <form autocomplete="off" data-form-type="vehicle_expense" data-modal-id="vehicle_expense_edit_modal" id="form_vehicle_expense_edit" method="post" action="<?php echo base_url().'bills/update'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body" style="padding-bottom: 0px">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_vehicle_expense_edit_msg">
              <div class="m-alert__icon">
                <i class="la la-warning"></i>
              </div>
              <div class="m-alert__text">
                Oh snap! Change a few things up and try submitting again.
              </div>
              <div class="m-alert__close">
                <button type="button" class="close" data-close="alert" aria-label="Close"></button>
              </div>
            </div>
          </div>
          <div style="background: white;border: 4px solid #f7f7fa;padding: 0px;margin: 0px;padding-bottom: 0px">
            <div class="m-section" style="margin: 0px 0 10px 0;">
              <h3 class="m-section__heading" style="padding: 10px;margin: 0px">Bill Details</h3>
              <div class="row">
                <div class="col-lg-6">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Supplier
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select required style="width: 100%" class="form-control m-select2  form_vehicle_expense_edit_select" id="expense_vehicle_supplier_edit" name="supplier_id" >
                        <option selected disabled>Select Supplier</option>
                        <?php
                        foreach($vehicle_suppliers as $row):
                          ?>
                          <option value="<?php echo $row->supplier_id?>"><?php echo $row->supplier_name ?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group m-form__group">
                    <label>
                      Expense Type
                    </label>
                    <div class="m-radio-inline" style="padding-top: 10px;">
                      <!-- <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input required type="radio" class="form_fields_radio"  name="expense_type_edit" value="Fuel"> Fuel
                        <span></span>
                      </label> -->
                      <label class="m-radio m-radio--solid m-radio--state-warning">
                        <input type="radio" class="form_fields_radio" name="expense_type_edit"  value="Workshop"> WorkShop
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-info">
                        <input type="radio" class="form_fields_radio" name="expense_type_edit"  value="Service"> Service
                        <span></span>
                      </label>
                      <label class="m-radio m-radio--solid m-radio--state-danger">
                        <input type="radio" class="form_fields_radio" name="expense_type_edit"  value="Spare_Parts"> Spare Parts
                        <span></span>
                      </label>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-6">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Vehicle
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill">
                      <select required style="width: 100%" class="form-control m-select2  form_vehicle_expense_edit_select" id="expense_vehicle_edit" name="vehicle_id" required >
                        <option selected disabled>Select Vehicle</option>
                        <?php
                        foreach($owned_vehicles as $row):
                          $v_id[]= $row->id;
                          ?>
                          <option value="<?php echo $row->id?>"><?php echo $row->vehicle_name." : ".$row->vehicle_no." [ ".$row->consignee_name." ] "?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6">
                  <div class="form-group m-form__group">
                    <label for="user_name">
                      Expense Head
                    </label>
                    <div class="input-group m-input-group m-input-group--pill">
                      <div class="input-group-prepend">
                        <a href="#expense_head_add_modal"   data-toggle="modal" data-target="#expense_head_add_modal" class="btn btn-focus btn_add_types">
                          <i class="fa fa-plus-circle"></i>
                        </a>
                      </div>
                      <select style="width: 82%" class="form-control m-select2 m-select2-general form_vehicle_expense_edit_select" required id="expense_head_edit" name="expense_head">

                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" style="padding-left: 10px;padding-right: 10px;">
                <div class="col-lg-3 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill No
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="bill_no" id="vehicle_expense_no_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" placeholder="Bill No" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-3 padding-0">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Date
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required  data-date-format="dd-mm-yyyy" id="vehicle_expense_date_edit"  type="text" name="bill_date" class="form_vehicle_expense_edit_fields form-control m-input m-input--pill m-input--air " placeholder="Bill Date" >
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-calendar"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-2 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      <?php echo $this->config->item('Tax_tax_name')?> %
                    </label>
                    <div class="m-select2 m-select2--air m-select2--pill ">
                      <select required id="vehicle_expense_tax_percent_edit" name="bill_tax_percent" style="width: 100%" class="form-control m-input form_vehicle_expense_edit_select vehicle_expense_amount_fields_edit" aria-describedby="basic-addon1" data-placeholder="Select Tax Percentage">
                        <?php
                        $tax_percent = $this->config->item('Tax_tax_percent_old');
                        foreach($tax_percent as $row):
                          $selected_tax='';
                          if($row==0){
                            $selected_tax='selected';
                          }
                          ?>
                          <option <?php echo $selected_tax?> value="<?php echo $row?>"><?php echo $row?>%</option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                    <input type="hidden" name="bill_tax_amount" id="vehicle_expense_tax_amount_edit" />
                  </div>
                </div>
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input required type="text" name="bill_amount" id="vehicle_expense_amount_edit" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields vehicle_expense_amount_fields_edit" placeholder="Bill Amount" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" style="padding-left: 10px;padding-right: 10px;">
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Consignee
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="consignee" id="vehicle_expense_consignee_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" placeholder="Consignee Name" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-tag"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Description
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="bill_description" id="vehicle_expense_description_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" placeholder="Bill Description" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4 padding-0" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Bill Payable Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input readonly type="text" name="bill_payable_amount" id="vehicle_expense_payable_amount_edit" value="0" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" placeholder="Bill Amount" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-6" >
                  <div class="form-group m-form__group">
                    <label for="user_name">
                      Bill Remarks
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" name="bill_remarks" id="vehicle_expense_remarks_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" placeholder="Bill Remarks" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6" >
                  <div class="form-group m-form__group" id="vehicle_expense_edit_file_table">
                    <table width="100%" class="table table-bordered m-table">
                      <tbody id="vehicle_expense_edit_file_table_body">
                      </tbody>
                    </table>
                  </div>
                  <div class="form-group m-form__group" style="padding-top:0px;display: none" id="vehicle_expense_edit_file_upload">
                    <label for="user_name">
                      Upload Bill Copy
                    </label>
                    <div class="custom-file">
                      <input type="file" class="custom-file-input form_vehicle_expense_edit_fields" name="uploaded_file" id="expense_upload_bill_edit">
                      <label class="custom-file-label" for="expense_upload_bill_edit">Choose file</label>
                    </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-lg-6" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Paid
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" readonly id="vehicle_expense_total_paid_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-6" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Balance
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input type="text" readonly id="vehicle_expense_balance_edit" class="form-control m-input m-input--pill m-input--air form_vehicle_expense_edit_fields" aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><?php echo $this->config->item('Currency_currency_format'); ?></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <input type="hidden" id="vehicle_expense_attachment_delete_status" name="attachment_delete_status" value="0" >
          <input type="hidden" name="bill_type" value="vehicle" >
          <input type="hidden" name="bill_id" id="vehicle_expense_id_edit">
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
        <div class="modal-footer">
          <button type="button" class="btn  btn-secondary" data-dismiss="modal">
            Close
          </button>
          <button type="submit" class="btn form_submit_btn btn-primary">
            Save & Update
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
