@extends('layouts.dashboard')

@section('page_title')
View Ledger

@endsection

@section('page_header_title')
view Ledger
@endsection
@section('page_body')

@php($breadcrumb = ['head_id' => Crypt::encrypt($subhead->head_id), 'head_name' => $subhead->head->name, 'subhead_id' => Crypt::encrypt($subhead->id), 'subhead_name' => $subhead->name])

{{ Breadcrumbs::render('ledger',$breadcrumb) }}

<div class="row row-cards row-deck" >
  <div class="col-12">
    <div class="card">
     <div class="card-header">
      


      <div class="col-md-3">
         @if(Auth::user()->hasAnyPermission(['All','View Ledger Report']))

            <button style="float: left;"  class="btn btn-sm btn-outline-primary" data-toggle="modal" data-target="#md_ledger_report" ><i class="fa fa-print"></i></button> 
          @endif
          <h3 style="float: left; margin-left: 4%;" class="card-title">View Ledger</h3>
      </div>

      <div class="col-md-5"></div>

      <div class="col-md-3" style="margin-left: 90px;">
            @php($datatable_key = Crypt::encrypt('Ledger'))
            <select onchange="showParameterBranchWiseDataTable(event,this,'{{Crypt::encrypt($account_id)}}','{{$datatable_key}}','show_ledgers');" name="branch" class="form-control form-control-sm">
              <option value="{{Crypt::encrypt(0)}}">Select {{ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))}}</option>

              @foreach($branch as $rows)
                <option @if(false) selected @endif value="{{Crypt::encrypt($rows->id)}}">{{$rows->name}} ({{$rows->code}})</option>
              @endforeach
            </select>
            
        </div>

    </div>

    <div class="card-status card-status-left bg-blue"></div>
    <div class="table-responsive" >
      <table class="table table-hover table-sm table-outline table-vcenter text-nowrap card-table cls_datatable">
        <thead>
          <tr>

            <th>#</th>
            <th>Date</th>
            <th>Voucher#</th>
            <th>Name</th>
          <th>Booking Detail</th>

            <th>Narration</th>
            <th>Mode</th>
            <th>Drawn</th>
            <th>Instrument / Cheque #</th>
            <th>Instrument Date</th>




            
            <th>Status</th>
            <th>Debit</th>
            <th>Credit</th>
            <th>Balance</th>
          </tr>
        </thead>
      
        <tbody id="show_ledgers">

        {!! $view_ledger !!}

        </tbody>

     </table>
   </div>
 </div>
</div>
</div>
@endsection

@section('page_modal')


@include('voucher.modals.approve_voucher')
@include('reports.modals.ledger_report')
@include('voucher.modals.update_voucher')


@endsection

@section('page_script')

@include('scripts.voucher')

@include('scripts.account')

@endsection

