<div class="modal fade" tabindex="-1" id="vehicle_payment_add_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" style="max-width: 1100px">
    <div class="modal-content">
      <div class="modal-header" style="background-color: #00c5dc;border-radius: 4px">
        <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
          Add New Transaction                                            </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="bill_payment_add" data-modal-id="vehicle_payment_add_modal" id="form_vehicle_payment_add" method="post" action="<?php echo base_url().'vehicles/create_vehicle_payment' ?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
          <div class="modal-body" id="form_bill_payment_add_body">
            <div class="m-form__content">
              <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_bill_payment_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 id="bill_data_table" class="row" 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">Payment Details</h3>
                <div class="row" style="padding-top: 15px;" >
                  <div class="col-lg-12">
                    <table style="width: 100%;max-width: 100%"  id="table_items" class="table m-table m-table--head-bg-success order-list table-striped table-bordered table-advance table-hover">
                      <thead>
                        <tr>
                          <th width="8%">Slip/Vehicle ID</th>
                          <th width="12%">Date</th>
                          <th width="16%">Vehicle</th>
                          <th width="16%">Project/Pay Towards</th>
                          <th width="10%">Total Amount</th>
                          <th width="10%">Amount Paid</th>
                          <th width="10%">Balance Amount</th>
                          <th width="16%">Amount to Paid</th>
                        </tr>
                      </thead>
                      <?php if($page_name=='consignee_profile'){?>
                      <input type="hidden" name="consignee_id" id="consignee_id" value="<?php echo $consignee_data->consignee_id ?>">
                    <?php } ?>
                      <tbody id="vehicle_payment_table_body">
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>


            <div style=" margin-left: 75%; margin-top: 2%;" >
              <div class="form-group m-form__group" >
                <label id="label_paid_amount_add_bill_payment" for="user_name">
                  Total Amount
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input readonly type="text" name="vehicle_payment_total_amount" id="vehicle_payment_total_amount" value="0" class="form-control m-input m-input--pill m-input--air" placeholder="Total 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 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 id="label_paid_amount_add_bill_payment" for="user_name">
                  Paid Amount
                </label>
                <div class="m-input-icon m-input-icon--right">
                <input required type="text" name="paid_amount" id="paid_amount_add_bill_payment" value="" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields" placeholder="Transaction 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 id="label_paid_date_add_bill_payment" for="user_name">
                Paid Date
              </label>
              <div class="m-input-icon m-input-icon--right">
                <input required data-date-format="dd-mm-yyyy" id="paid_date_add_bill_payment"  type="text" name="paid_date" class="form_bill_payment_add_fields form-control m-input m-input--pill m-input--air " placeholder="Transaction 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 id="label_debit_acc_add_bill_payment" for="user_name">
                Paid From Acc
              </label>
              <div class="m-select2 m-select2--air m-select2--pill">
                <select required id="debit_acc_add_bill_payment2" name="debit_acc" style="width: 100%" class="form-control m-input form_bill_payment_add_select 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 required id="payment_mode_add_bill_payment2" name="payment_mode" style="width: 100%" class="form-control m-input form_bill_payment_add_select 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_bill_payment_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="reference_date_add_bill_payment"  class="form-control m-input m-input--pill m-input--air form_bill_payment_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_bill_payment_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 add_bill_payment_purchase_order_hide_fields add_bill_payment_labour_hide_fields add_bill_payment_salary_slip_fields" >
          <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="balance_amount_add_bill_payment" value="0" class="form-control m-input m-input--pill m-input--air form_bill_payment_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>
</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="advance_payment_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 Advance/Op Balance Payment Paid
        </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="client_payment" id="form_advance_payment_edit" data-modal-id="advance_payment_edit_modal" method="post" action="<?php echo base_url().'supplier/update_advance_transaction'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_client_payment_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 class="row">
            <div class="col-lg-4">
              <div class="form-group m-form__group" >
                <label for="client_payment_amount">
                  Paid Amount
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required type="text" name="paid_amount" value="" id="advance_payment_paid_amount_edit"  class="form-control form_client_payment_edit_fields m-input m-input--pill m-input--air" placeholder="Payment 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="advance_payment_paid_date_edit" required type="text" name="paid_date" class="form-control form_client_payment_edit_fields m-input m-input--pill m-input--air" placeholder="Received 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 required id="advance_payment_acc_edit" name="debit_acc" style="width: 100%" class="form-control m-input"  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 class="col-lg-12">
              <div class="form-group m-form__group" style=" !important">
                <label for="client_payment_remarks">
                  Remarks
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input type="text" name="tr_remarks" id="advance_payment_remarks_edit"  class="form-control form_client_payment_edit_fields m-input m-input--pill m-input--air" placeholder="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>

            <input type="hidden" name="transaction_id" id="advance_payment_tr_id_edit">
          </div>
        </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">
            Submit
          </button>
        </div>
      </form>
    </div>
  </div>
</div>


<div class="modal fade" tabindex="-1" id="advance_transaction_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" data-form-type="" data-modal-id="advance_transaction_delete_modal" id="form_transaction_delete" method="post" action="<?php echo base_url().'accounts/delete_transaction'?>" class="form-horizontal">
      <div class="modal-content">
        <div class="alert alert-danger" role="alert" style="margin-bottom: 0px">
          <button type="button" class="close" data-dismiss="modal"></button>
          <br/>
          <h4 class="alert-heading">Warning! Please Confirm Your Action</h4>
          <br/>
          <p> Are You Sure to Delete this Transaction ?. All Data Associated will be Deleted. </p>
          <p>
            <button class="btn btn-danger form_submit_btn" type="submit" name="submit">Confirm & Delete</button>
            <button type="button" class="btn btn-primary modal-dismiss" data-dismiss="modal">Cancel</button>
          </p>
          <input type="hidden"  name="transaction_id" id="advance_payment_tr_id_delete">
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
      </div>
    </form>
  </div>
</div>


<div class="modal fade" tabindex="-1" id="advance_payment_returned_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 Advance Payment Returned
        </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="client_payment" id="form_advance_payment_returned_edit" data-modal-id="advance_payment_returned_edit_modal" method="post" action="<?php echo base_url().'supplier/update_advance_return_transaction'?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
        <div class="modal-body">
          <div class="m-form__content">
            <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_client_payment_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 class="row">
            <div class="col-lg-6">
              <div class="form-group m-form__group" >
                <label for="client_payment_amount">
                  Paid Amount ( Return )
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input required type="text" name="paid_amount" value="" id="advance_payment_paid_amount_edit_return"  class="form-control form_client_payment_edit_fields m-input m-input--pill m-input--air" placeholder="Payment 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-6" >
              <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="advance_payment_paid_date_edit_return" required type="text" name="paid_date" class="form-control form_client_payment_edit_fields m-input m-input--pill m-input--air" placeholder="Received 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>



            <input type="hidden" name="transaction_id" id="advance_payment_tr_id_edit_return">
          </div>
        </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">
            Submit
          </button>
        </div>
      </form>
    </div>
  </div>
</div>


<div class="modal fade" tabindex="-1" id="advance_transaction_delete_modal_return" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" data-form-type="" data-modal-id="advance_transaction_delete_modal_return" id="form_transaction_delete_return" method="post" action="<?php echo base_url().'supplier/delete_advance_return_transaction'?>" class="form-horizontal">
      <div class="modal-content">
        <div class="alert alert-danger" role="alert" style="margin-bottom: 0px">
          <button type="button" class="close" data-dismiss="modal"></button>
          <br/>
          <h4 class="alert-heading">Warning! Please Confirm Your Action</h4>
          <br/>
          <p> Are You Sure to Delete this Transaction ?. All Data Associated will be Deleted. </p>
          <p>
            <button class="btn btn-danger form_submit_btn" type="submit" name="submit">Confirm & Delete</button>
            <button type="button" class="btn btn-primary modal-dismiss" data-dismiss="modal">Cancel</button>
          </p>
          <input type="hidden"  name="transaction_id" id="advance_payment_tr_id_delete_return">
          <input type="hidden" name="redirect_url" value="<?php echo base_url(uri_string())?>" >
        </div>
      </div>
    </form>
  </div>
</div>
