<div class="modal fade" tabindex="-1" id="bill_delete_modal" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog " role="document" >
    <form autocomplete="off" data-modal-id="bill_delete_modal" id="form_bill_delete" method="post" action="<?php echo base_url().'bills/delete'?>" 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 Bill ?. Bill and Its Transaction 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="bill_id" id="bill_id_delete">
          <input type="hidden"  name="bill_type" id="bill_type_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="bill_payment_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: #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="bill_payment_add_modal" id="form_bill_payment_add" method="post" action="<?php echo base_url().'accounts/create_transaction' ?>" 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 class="row">
              <input type="hidden" value="" id="bill_work_slip_id_edit" name="work_slip_id">
              <div class="add_bill_payment_labour_hide_fields add_bill_payment_vehicle_hide_fields" >
                <div class="row">
                  <div class="col-lg-5 add_bill_payment_labour_hide_fields" >
                    <div class="row">
                      <div class="col-lg-6 add_bill_payment_vehicle_hide_fields" >
                        <div class="form-group m-form__group" >
                          <label for="user_name">
                            Bill ID
                          </label>
                          <div class="m-input-icon m-input-icon--right">
                            <input disabled type="text" id="bill_id_add_bill_payment_1" 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><i class="la la-edit"></i></span></span>
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_vehicle_slip_fields " >
                        <div class="form-group m-form__group" >
                          <label for="user_name">
                            Bill Date
                          </label>
                          <input disabled type="text" id="bill_date_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-7 add_bill_payment_labour_hide_fields" >
                    <div class="row">
                      <div class="col-lg-6 add_bill_payment_fields add_bill_payment_purchase_bill_fields add_bill_payment_purchase_order_fields" style="display:none;">
                        <div class="form-group m-form__group" >
                          <label for="Paid Amount">
                            Supplier
                          </label>
                          <input disabled type="text" id="supplier_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_fields add_bill_payment_purchase_bill_fields" style="display:none;">
                        <div class="form-group m-form__group" >
                          <label for="Paid Amount">
                            Purchased to
                          </label>
                          <input disabled type="text" id="location_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_fields add_bill_payment_purchase_order_fields" style="display:none;">
                        <div class="form-group m-form__group" >
                          <label for="Paid Amount">
                            Ordered to
                          </label>
                          <input disabled type="text" id="location_add_bill_payment_2" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_fields add_bill_payment_expense_bill_fields" style="display:none;">
                        <div class="form-group m-form__group" >
                          <label for="Paid Amount">
                            Expense Head
                          </label>
                          <input disabled type="text" id="expense_head_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_fields add_bill_payment_subcontract_bill_fields" style="display:none;">
                        <div class="form-group m-form__group" >
                          <label for="Paid Amount">
                            Subwork Name
                          </label>
                          <input disabled type="text" id="subwork_name_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                        </div>
                      </div>
                      <div class="col-lg-6 add_bill_payment_vehicle_slip_fields add_bill_payment_expense_bill_fields add_bill_payment_subcontract_bill_fields" style="display:none; ">
                        <div class="form-group m-form__group" >
                          <label for="user_name">
                            Consignee
                          </label>
                          <div class="m-input-icon m-input-icon--right">
                            <input disabled type="text" id="consignee_name_add_payment" 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><i class="la la-edit"></i></span></span>
                          </div>
                          <span class="m-form__help"></span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-lg-12 add_bill_payment_fields add_bill_payment_labour_fields add_bill_payment_vehicle_hide_fields" >
                <div class="row">
                  <div class="col-lg-5">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Labour
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select  style="width: 100%" class="form-control m-select2  form_bill_payment_add_select" id="labour_add_bill_payment" name="labour"  >
                          <option selected disabled>Select Labour</option>
                          <?php
                          foreach($labours_2 as $row):
                            if($row->labour_type==0){
                              $labour_type = "Individual";
                            }else{
                              if($row->group_position==1){
                                $labour_type = "Group Leader";
                              }else{
                                $labour_type = "Group Member";
                              }
                            }
                            ?>
                            <option value="<?php echo $row->labour_id?>"><?php echo $row->labour_name." [".$row->type_name."] - (".$labour_type.")"?></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">
                        Work Type
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="work_type_add_bill_payment" 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><i class="la la-edit"></i></span></span>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-3 add_bill_payment_labour_group_leader_hide_fields">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Prev. Balance
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="previous_balance_add_bill_payment" 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>
                    </div>
                  </div>
                  <div class="col-lg-3 add_bill_payment_labour_group_leader_fields">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Total Members
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="total_members_add_bill_payment" 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><i class="la la-edit"></i></span></span>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-4 add_bill_payment_labour_group_leader_fields"></div>
                  <div class="col-lg-4 add_bill_payment_labour_group_leader_fields">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Prev. Balance (Personal)
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="previous_balance_personal_add_bill_payment" 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>
                    </div>
                  </div>
                  <div class="col-lg-4 add_bill_payment_labour_group_leader_fields">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Prev. Balance (Group)
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="previous_balance_group_add_bill_payment" 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>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-lg-12 add_bill_payment_fields add_bill_payment_user_fields add_bill_payment_vehicle_hide_fields" >
                <div class="row">
                  <div class="col-lg-12">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Select Employee Account
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select  style="width: 100%" class="form-control m-select2  form_bill_payment_add_select" id="user_add_bill_payment" name="user_acc"  >
                          <option  disabled selected>Select Employee Account</option>
                          <?php
                          foreach($user_accounts as $row): ?>
                          <option value="<?php echo $row->acc_head_id?>"><?php echo $row->acc_head_name?>  [<?php echo $row->department_name?>] <?php if($row->role_title!=''){ echo "[".$row->role_title."]"; } ?></option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-lg-12 add_bill_payment_fields add_bill_payment_user_detail_fields add_bill_payment_vehicle_hide_fields" >
              <div class="row">
                <div class="col-lg-3">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Paid
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="user_total_paid_add_bill_payment" 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 class="col-lg-3">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Spent
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="user_total_spent_add_bill_payment" 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 class="col-lg-3">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Returned
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="user_total_returned_add_bill_payment" 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 class="col-lg-3">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Balance in Hand
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="user_total_balance_add_bill_payment" 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 class="col-lg-12 add_bill_payment_fields add_bill_payment_loan_fields add_bill_payment_vehicle_hide_fields" >
              <div class="row">
                <div class="col-lg-6">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Loan Title
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="loan_title_add_bill_payment" 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><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">
                      Loan Provider
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="loan_provider_add_bill_payment" 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><i class="la la-user"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
            </div>

            <div class="col-lg-12 add_bill_payment_fields add_bill_payment_tool_payment_fields add_bill_payment_vehicle_hide_fields" >
              <div class="row">
                <div class="col-lg-5">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Tool Name
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="tool_name_add_bill_payment" 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><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">
                      Project
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="work_name_add_bill_payment" 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><i class="la la-user"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-3">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Payable Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="tool_payable_amount_add_bill_payment" 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 class="col-lg-12 add_bill_payment_fields add_bill_payment_salary_slip_fields " >
              <div class="row">
                <div class="col-lg-3 add_bill_payment_vehicle_slip_fields" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Slip ID
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="salary_slip_id_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields add_bill_payment_vehicle_slip_fields"  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-2" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Month
                    </label>
                    <input disabled type="text" id="salary_month_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Employee
                    </label>
                    <input disabled type="text" id="employee_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-3" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Designation
                    </label>
                    <input disabled type="text" id="employee_designation_add_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_add_fields"  aria-describedby="basic-addon1">
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="row" style="margin-bottom: 10px;">
            <div class="col-lg-3 add_bill_payment_labour_hide_fields add_bill_payment_vehicle_hide_fields">
              <div class="form-group m-form__group" >
                <label for="user_name">
                  Bill No
                </label>
                <div class="m-input-icon m-input-icon--right">
                  <input disabled type="text" id="bill_no_add_bill_payment" 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><i class="la la-edit"></i></span></span>
                </div>
                <span class="m-form__help"></span>
              </div>
            </div>
            <div class="col-lg-9 add_bill_payment_labour_hide_fields  add_bill_payment_vehicle_slip_fields" >
              <div class="row">
                <div class="col-lg-4 add_bill_payment_vehicle_slip_fields" style="display: none;">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Vehicle No
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="vehicle_number_edit" 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><i class="la la-edit"></i></span></span>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4 add_bill_payment_purchase_order_hide_fields">
                  <div class="form-group m-form__group " >
                    <label for="user_name">
                      Bill Payable Amt
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="bill_total_amount_add_bill_payment" 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 class="col-lg-4 add_bill_payment_fields add_bill_payment_purchase_order_fields">
                  <div class="form-group m-form__group "  style="display: none">
                    <label for="user_name">
                      Total Est Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="bill_total_est_amount_add_bill_payment" 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 class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Paid
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="bill_total_paid_add_bill_payment" 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 class="col-lg-4">
                  <div class="form-group m-form__group add_bill_payment_purchase_order_hide_fields" >
                    <label for="user_name">
                      Balance Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled value="0" type="text" id="bill_balance_amount_add_bill_payment" 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 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_payment" 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_payment" 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>
            <input type="hidden" name="tr_type" id="tr_type_add_bill_payment">
            <input type="hidden" name="reference_id" id="reference_id_add_bill_payment">
            <input type="hidden" name="reference_type" id="reference_type_add_bill_payment">
          </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="bill_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 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_edit" data-modal-id="bill_payment_edit_modal" id="form_bill_payment_edit" method="post" action="<?php echo base_url().'accounts/update_transaction' ?>" 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_edit_body">
            <div class="m-form__content">
              <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_bill_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 bill_info_fields_edit_payment">
              <div class="col-lg-5 edit_bill_payment_labour_hide_fields " >
                <div class="row">
                  <div class="col-lg-6 add_bill_payment_vehicle_hide_fields" >
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Bill ID
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="bill_id_edit_bill_payment_1" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  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">
                        Bill Date
                      </label>
                      <input disabled type="text" id="bill_date_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-lg-4 edit_bill_payment_vehicle_fields" style="display:none;">
                <div class="form-group m-form__group" >
                  <label for="Paid Amount">
                    Vehicle No
                  </label>
                  <input disabled type="text" id="vehicle_no_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                </div>
              </div>
              <div class="col-lg-7" >
                <div class="row">
                  <div class="col-lg-6 edit_bill_payment_vehicle_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Vehicle
                      </label>
                      <input disabled type="text" id="vehicle_name_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_purchase_bill_fields edit_bill_payment_purchase_order_fields" style="padding-right: 29px">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Supplier
                      </label>
                      <input disabled type="text" id="supplier_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_purchase_bill_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Purchased to
                      </label>
                      <input disabled type="text" id="location_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_purchase_order_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Ordered to
                      </label>
                      <input disabled type="text" id="location_edit_bill_payment_2" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_expense_bill_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Expense Head
                      </label>
                      <input disabled type="text" id="expense_head_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_subcontract_bill_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Subwork Name
                      </label>
                      <input disabled type="text" id="subwork_name_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_vehicle_fields edit_bill_payment_fields edit_bill_payment_expense_bill_fields edit_bill_payment_subcontract_bill_fields add_bill_payment_vehicle_slip_fields add_bill_payment_purchase_order_hide_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Consignee
                      </label>
                      <input disabled type="text" id="consignee_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>

                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_labour_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Labour
                      </label>
                      <input disabled type="text" id="labour_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_labour_fields edit_bill_payment_labour_fields_work_type" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Work Type
                      </label>
                      <input disabled type="text" id="work_type_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_labour_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        Payment Type
                      </label>
                      <div class="m-radio-inline" style="padding-top: 10px;">
                        <label class="m-radio m-radio--solid m-radio--state-danger">
                          <input type="radio" class="form_fields_radio"  name="labour_payment_type_edit" value="insurance"> Insurance
                          <span></span>
                        </label>
                        <label class="m-radio m-radio--solid m-radio--state-primary">
                          <input type="radio" class="form_fields_radio"  name="labour_payment_type_edit" value="fd"> FD
                          <span></span>
                        </label>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-12 edit_bill_payment_fields edit_bill_payment_user_fields" style="display:none;">
                    <div class="form-group m-form__group" >
                      <label for="Paid Amount">
                        User Account
                      </label>
                      <input disabled type="text" id="user_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_loan_fields" style="display:none;">
                <div class="form-group m-form__group" >
                  <label for="Paid Amount">
                    Loan Title
                  </label>
                  <input disabled type="text" id="loan_title_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                </div>
              </div>
              <div class="col-lg-6 edit_bill_payment_fields edit_bill_payment_loan_fields" style="display:none;">
                <div class="form-group m-form__group" >
                  <label for="Paid Amount">
                    Loan Provider
                  </label>
                  <input disabled type="text" id="loan_provider_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                </div>
              </div>
              <div class="col-lg-12 edit_bill_payment_fields edit_bill_payment_salary_slip_fields edit_bill_payment_employee_fields" >
                <div class="row">
                  <div class="col-lg-3" style="padding-right:5px">
                    <div class="form-group m-form__group edit_bill_payment_salary_slip_id_fields" style="display:none">
                      <label for="user_name">
                        Slip ID
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="salary_slip_id_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  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>
                    </div>
                    <?php if($page_name=='payments_view'){ ?>
                    <div class="form-group m-form__group edit_bill_payment_salary_advance_fields" style="padding-top: 0px;">
                      <label for="user_name">
                        Expense Under
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select  style="width: 100%" class="form-control m-select2 form_bill_payment_edit_fields" id="salary_advance_work_edit"  name="work_id" data-placeholder="Select Work">
                          <option value="0">Office Expense</option>
                          <?php
                          foreach($works as $row): ?>
                          <option data-work-status="<?php echo $row->work_status?>" value="<?php echo $row->work_id?>"><?php echo $row->work_name?>'s Expense</option>
                          <?php
                        endforeach;
                        ?>
                      </select>
                    </div>
                    <span class="m-form__help"></span>
                  </div>
                <?php } ?>
                  </div>
                  <div class="col-lg-2" style="padding-right:5px;padding-left:5px">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Month
                      </label>
                      <input disabled type="text" id="salary_month_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                  <div class="col-lg-4"  style="padding-right:5px;padding-left:5px">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Employee
                      </label>
                      <input disabled type="text" id="employee_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                  <div class="col-lg-3" style="padding-left:5px">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Designation
                      </label>
                      <input disabled type="text" id="employee_designation_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-form__help"></span>
                    </div>
                  </div>
                </div>
              </div>
            </div>

             <div class="col-lg-12 edit_bill_payment_fields edit_bill_payment_tool_payment_fields edit_bill_payment_vehicle_hide_fields" >
              <div class="row">
                <div class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Tool Name
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="tool_name_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  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">
                      No of Tools
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="no_tools_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  aria-describedby="basic-addon1">
                      <span class="m-input-icon__icon m-input-icon__icon--right"><span><i class="la la-user"></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">
                      Payable Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="tool_payable_amount_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_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 class="row bill_info_fields_edit_payment bill_info_fields_edit_payment_row2" style="margin-bottom: 10px;">
              <div class="col-lg-3 edit_bill_payment_labour_hide_fields add_bill_payment_vehicle_hide_fields" >
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Bill No
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input disabled type="text" id="bill_no_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields"  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-9 edit_bill_payment_labour_hide_fields edit_bill_payment_salary_slip_fields" >
                <div class="row">
                  <div class="col-lg-4 edit_bill_payment_purchase_order_hide_fields">
                    <div class="form-group m-form__group " >
                      <label for="user_name">
                        Bill Payable Amt
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="bill_total_amount_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_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-4 edit_bill_payment_fields edit_bill_payment_purchase_order_fields">
                    <div class="form-group m-form__group "  style="display: none">
                      <label for="user_name">
                        Total Est Amount
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="bill_total_est_amount_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_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-4 edit_bill_payment_total_field">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Total Paid
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" value="" id="bill_total_paid_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_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-4">
                    <div class="form-group m-form__group edit_bill_payment_purchase_order_hide_fields" >
                      <label for="user_name">
                        Balance Amount
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input disabled type="text" id="bill_balance_amount_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields final_balance_calculate_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 class="row subcontract_info_fields_edit_payment" style="margin-bottom: 10px;">
              <div class="col-lg-2" >
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Contract ID
                  </label>
                  <input readonly type="text" id="contract_id_payment_edit" class="form-control m-input m-input--pill m-input--air form_subcontract_bill_add_fields"  aria-describedby="basic-addon1">
                </div>
              </div>
              <div class="col-lg-10" >
                <div class="row">
                  <div class="col-lg-4" >
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Project
                      </label>
                      <input readonly type="text" id="subcontract_project_name_payment_edit" class="form-control m-input m-input--pill m-input--air form_subcontract_bill_add_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-4" >
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Sub Work Name
                      </label>
                      <input readonly type="text" id="subwork_name_payment_edit" class="form-control m-input m-input--pill m-input--air form_subcontract_bill_add_fields"  aria-describedby="basic-addon1">
                    </div>
                  </div>
                  <div class="col-lg-4" >
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Sub Work Type
                      </label>
                      <div id="subwork_type_payment_edit" style="border: 1px dashed #ebedf2 !important;"></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="row subcontract_info_fields_edit_payment" style="margin-bottom: 10px;">
              <div class="col-lg-4">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Contractor
                  </label>
                  <input type="text" readonly id="subcontract_contractor_edit_payment" class="form-control m-input m-input--pill m-input--air" aria-describedby="basic-addon1">
                </div>
              </div>
              <div class="col-lg-4">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Est. Budget
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input type="text" readonly id="subcontract_est_budget_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </div>
              </div>
              <div class="col-lg-4">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Total Bill Amount
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input readonly type="text" id="subcontract_total_bill_amount_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </div>
              </div>
            </div>
            <div class="row subcontract_info_fields_edit_payment" style="margin-bottom: 20px;display: none">
              <div class="col-lg-3">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Total Paid on Bill
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input readonly type="text" id="subcontract_total_bill_paid_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </div>
              </div>
              <div class="col-lg-3">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Total Advance Paid
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input readonly type="text" id="subcontract_advance_paid_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </div>
              </div>
              <div class="col-lg-3">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Balance to Bills
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input type="text" readonly id="subcontract_bill_balance_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </div>
              </div>
              <div class="col-lg-3">
                <div class="form-group m-form__group" >
                  <label for="user_name">
                    Balance to Budget
                  </label>
                  <div class="m-input-icon m-input-icon--right">
                    <input type="text" readonly id="subcontract_budget_balance_edit_payment" class="form-control m-input m-input--pill m-input--air" 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>
                </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">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_old_edit_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_edit_bill_payment" value="0" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields final_balance_calculate_fields " placeholder="Transaction Amount" aria-describedby="basic-addon1">
                        <input type="hidden"  id="paid_amount_old_edit_bill_payment" >
                        <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_edit_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_edit_bill_payment"  type="text" name="paid_date" class="form_bill_payment_edit_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_edit_bill_payment" for="user_name">
                        Paid From Acc
                      </label>
                      <div class="m-select2 m-select2--air m-select2--pill">
                        <select required id="debit_acc_edit_bill_payment" name="debit_acc" style="width: 100%" class="form-control m-input form_bill_payment_edit_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_edit_bill_payment" name="payment_mode" style="width: 100%" class="form-control m-input form_bill_payment_edit_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" id="reference_no_edit_bill_payment"  class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_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_edit_bill_payment"  class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_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" id="tr_remarks_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_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 bill_balance_amount_field edit_bill_payment_purchase_order_hide_fields edit_bill_payment_labour_hide_fields edit_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_edit_bill_payment" value="0" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields final_balance_calculate_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>
              <input type="hidden" name="transaction_id" id="tr_id_edit_bill_payment">
              <input type="hidden" name="tr_type" id="tr_type_edit_bill_payment">
              <input type="hidden" name="reference_id" id="reference_id_edit_bill_payment">
              <input type="hidden" name="reference_type" id="reference_type_edit_bill_payment">
            </div>
            <div class="subcontract_info_fields_edit_payment" style="background: white;border: 4px solid #f7f7fa;padding: 0px;margin: 0px;padding-bottom: 0px;display: none">
              <div class="m-section" style="margin: 0px 0 10px 0;">
                <div class="row" style="padding-top: 15px" >
                  <div class="col-lg-5" >
                    <div class="m-form__group form-group"  >
                      <label for="">Payment Options</label>
                      <div class="m-checkbox-inline">
                        <label class="m-checkbox m-checkbox--bold m-checkbox--state-brand">
                          <input type="checkbox" value="1" name="payment_move" id="payment_move_option" class="payment_move_option"> Move This <strong>Advance Payment</strong> to <strong>Bill Payment</strong>
                          <span></span>
                        </label>
                      </div>
                    </div>
                  </div>
                  <div class="col-lg-7 payment_move_div" style="display: none">
                    <div class="m-form__group form-group">
                      <div class="form-group m-form__group"  >
                        <label for="user_name">
                          List of Payable Subcontract Bills
                        </label>
                        <div class="m-select2 m-select2--air m-select2--pill">
                          <select  id="move_bill_id_edit_bill_payment" name="move_bill_id" style="width: 100%" class="form-control m-input form_bill_payment_edit_select paid_amount_req_fields"  aria-describedby="basic-addon1">
                            <option selected disabled>Select Subcontract Bill</option>

                          </select>
                        </div>
                        <span class="m-form__help"></span>
                      </div>
                    </div>
                  </div>
                  <!-- <div class="col-lg-4 payment_move_div" style="display: none">
                    <div class="form-group m-form__group" >
                      <label for="user_name">
                        Amount to Move
                      </label>
                      <div class="m-input-icon m-input-icon--right">
                        <input  type="text" name="move_bill_amount" id="move_bill_amount_edit_bill_payment" class="form-control m-input m-input--pill m-input--air form_bill_payment_edit_fields paid_amount_req_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="receive_payment_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: #00c5dc;border-radius: 4px">
          <h5 class="modal-title" id="exampleModalLabel" style="color: #ffffff" >
            Receive New Payment                                            </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="receive_payment_add" data-modal-id="receive_payment_add_modal" id="form_receive_payment_add" method="post" action="<?php echo base_url().'accounts/create_transaction' ?>" enctype="multipart/form-data" class="m-form m-form--fit m-form--state m-form--label-align-right " >
            <div class="modal-body" id="form_receive_payment_add_body">
              <div class="m-form__content">
                <div class="m-alert m-alert--icon alert alert-warning m--hide" role="alert" id="form_receive_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 class="row">
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Invoice ID
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="invoice_id_add_receive_payment_1" class="form-control m-input m-input--pill m-input--air form_receive_payment_add_fields"  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">
                      Invoice Date
                    </label>
                    <input disabled type="text" id="invoice_date_add_receive_payment" class="form-control m-input m-input--pill m-input--air form_receive_payment_add_fields"  aria-describedby="basic-addon1">
                    <span class="m-form__help"></span>
                  </div>
                </div>
                <div class="col-lg-4" >
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Customer
                    </label>
                    <input disabled type="text" id="customer_add_receive_payment" class="form-control m-input m-input--pill m-input--air form_receive_payment_add_fields"  aria-describedby="basic-addon1">
                    <span class="m-form__help"></span>
                  </div>
                </div>
              </div>
              <div class="row" style="margin-bottom: 10px;">
                <div class="col-lg-4">
                  <div class="form-group m-form__group " >
                    <label for="user_name">
                      Invoice Receivable Amt
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="invoice_total_amount_add_receive_payment" class="form-control m-input m-input--pill m-input--air form_receive_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 class="col-lg-4">
                  <div class="form-group m-form__group" >
                    <label for="user_name">
                      Total Received
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="invoice_total_received_add_receive_payment" class="form-control m-input m-input--pill m-input--air form_receive_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 class="col-lg-4">
                  <div class="form-group m-form__group add_receive_payment_purchase_order_hide_fields" >
                    <label for="user_name">
                      Balance Amount
                    </label>
                    <div class="m-input-icon m-input-icon--right">
                      <input disabled type="text" id="invoice_balance_amount_add_receive_payment" class="form-control m-input m-input--pill m-input--air form_receive_payment_add_fields final_balance_calculate_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 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">
                          Received Amount
                        </label>
                        <div class="m-input-icon m-input-icon--right">
                          <input required type="text" name="received_amount" id="received_amount_add_receive_payment" value="0" class="form-control m-input m-input--pill m-input--air form_receive_payment_add_fields" placeholder="Received 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">
                          Received Date
                        </label>
                        <div class="m-input-icon m-input-icon--right">
                          <input required data-date-format="dd-mm-yyyy" id="received_date_add_receive_payment"  type="text" name="received_date" class="form_receive_payment_add_fields form-control 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">
                          Received to Acc
                        </label>
                        <div class="m-select2 m-select2--air m-select2--pill">
                          <select required id="credit_acc_add_receive_payment" name="credit_acc" style="width: 100%" class="form-control m-input form_receive_payment_add_select "  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">
                          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_receive_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 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_receive_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_receive_payment_purchase_order_hide_fields add_receive_payment_labour_hide_fields" >
                        <label for="user_name">
                          Invoice Balance Amt
                        </label>
                        <div class="m-input-icon m-input-icon--right">
                          <input readonly type="text" name="balance_amount" id="balance_amount_add_receive_payment" value="0" class="form-control m-input m-input--pill m-input--air form_receive_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>
                <input type="hidden" name="tr_type" id="tr_type_add_receive_payment">
                <input type="hidden" name="reference_id" id="reference_id_add_receive_payment">
                <input type="hidden" name="reference_type" id="reference_type_add_receive_payment">
              </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>
