<?php $this->view("includes/Inc_pagehead");?>
<!-- Page Styles Goes Here-->

<?php $this->view("includes/Inc_navigation");?>
<div class="m-grid__item m-grid__item--fluid m-wrapper">
  <!-- BEGIN: Subheader -->
  <div class="m-subheader">
    <div class="d-flex align-items-center">
      <div class="mr-auto">
        <h3 class="m-subheader__title m-subheader__title--separator">
          Expense Bills
        </h3>
        <ul class="m-subheader__breadcrumbs m-nav m-nav--inline">
          <li class="m-nav__item m-nav__item--home">
            <a href="#" class="m-nav__link m-nav__link--icon">
              <i class="m-nav__link-icon la la-home"></i>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url().'dashboard'?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Home
              </span>
            </a>
          </li>
          <li class="m-nav__separator">
            -
          </li>
          <li class="m-nav__item">
            <a href="<?php echo base_url().'expense' ?>" class="m-nav__link">
              <span class="m-nav__link-text">
                Expense Bills
              </span>
            </a>
          </li>
        </ul>
      </div>
      <div>

      </div>
    </div>
  </div>
  <!-- END: Subheader -->
  <div class="m-content">
    <div class="m-portlet m-portlet--mobile m-portlet--info m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
      <div class="m-portlet__head">
        <div class="m-portlet__head-caption">
          <div class="m-portlet__head-title">
            <h3 class="m-portlet__head-text">
              List of Expense Bills
            </h3>
          </div>
        </div>
        <div class="m-portlet__head-tools">
          <?php if($this->session->userdata('user_role')!='auditor' || $this->session->userdata('user_data_permission')['adding']==1) { ?>
            <?php if($this->config->item('Expense_local_material_purchase')==1){?>
              <a href="#" style="margin-right:5px;margin-left:5px" data-toggle="modal" id="btn_add_local_material_purchase_bill" data-target="#local_material_purchase_bill_add_modal" class="btn btn-warning m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
                <span>
                  <i class="la la-plus"></i>
                  <span>
                    Add New Item Wise Expense Bill
                  </span>
                </span>
              </a>
            <?php } ?>
            <a href="#" style="margin-right:5px;margin-left:5px" data-toggle="modal" data-target="#expense_bill_add_modal" class="btn btn-focus m-btn m-btn--custom m-btn--icon m-btn--air m-btn--pill">
              <span>
                <i class="la la-plus"></i>
                <span>
                  Add New Expense Bill
                </span>
              </span>
            </a>
          <?php } ?>
        </div>
      </div>
      <div class="m-portlet__body">

      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_expense_bills");?>
      <!--end: Datatable -->
    </div>
  </div>
  <div class="m-portlet m-portlet--mobile m-portlet--success m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
    <div class="m-portlet__head">
      <div class="m-portlet__head-caption">
        <div class="m-portlet__head-title">
          <h3 class="m-portlet__head-text">
            List of Expense Bill Transactions
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">

      </div>
    </div>
    <div class="m-portlet__body">
      <!--begin: Datatable -->
      <?php $this->view("modules/include_tables/table_expense_bill_payments");?>
      <!--end: Datatable -->
    </div>
  </div>
  <div class="m-portlet m-portlet--mobile m-portlet--focus m-portlet--head-solid-bg m-portlet--bordered m-portlet--rounded">
    <div class="m-portlet__head">
      <div class="m-portlet__head-caption">
        <div class="m-portlet__head-title">
          <h3 class="m-portlet__head-text">
            Expense Bill Head Wise Summary
          </h3>
        </div>
      </div>
      <div class="m-portlet__head-tools">
      </div>
    </div>
    <div class="m-portlet__body">
      <?php $this->view("modules/include_tables/table_expense_bills_headwise");?>
    </div>
  </div>
</div>

<?php $this->view("modules/include_modals/modal_bills");?>
<?php $this->view("modules/include_modals/modal_expense_head_add");?>
<?php $this->view("modules/include_modals/modal_transaction_delete");?>
</div>
</div>
<!-- end:: Body -->
<!-- begin::Footer -->
<?php $this->view("includes/Inc_footer");?>
<!-- end::Footer -->
</div>
<!-- end:: Page -->

<?php $this->view("includes/Inc_sidebar");?>
<?php $this->view("includes/Inc_scripts");?>

<!--begin::Page Snippets -->
<script>
$("#expense_menu").addClass('m-menu__item--active m-menu__item--open');
</script>
<?php $this->view("modules/include_scripts/bill_scripts");?>
<?php $this->view("modules/include_scripts/transaction_scripts");?>
<?php $this->view("modules/include_scripts/expense_bill_scripts");?>
