@extends('layouts.dashboard')

@section('page_title')
Voucher
@endsection

@section('page_header_title')
Manage Voucher
@endsection



@section('page_body')
{{ Breadcrumbs::render('reject_voucher') }}

<div class="row row-cards row-deck mt-4">

  <div class="col-12">
    <div class="card">
         {!! Form::open(array('route' =>    'approve.multiple.vouchers')) !!}

      <div class="card-header">



       <h3 class="card-title">Reject Voucher </h3> &nbsp; &nbsp;

     
     </div>


     <div class="card-status card-status-left bg-blue"></div>
     <div class="table-responsive table-height">
      <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>Temp Voucher#</th>
            <th>{{ucwords(str_replace('_',' ',EF::branchWhiteLabel()['module']))}}</th>
            <th>Type</th>
            <th>debit</th>
            <th>credit</th>
          </tr>
        </thead>
        <tbody id="show_vouchers">
            
         @php($transaction_count = 0)


          @isset($trasnaction_list)
          @foreach($trasnaction_list as $rows)

          <tr>

              @php($journal_list = $rows->getRejectedJournalListByTransaction($rows->id))
              
              @php($journal_count = @count($journal_list))

              @php($count = 0)

              @foreach($journal_list as $journal_rows)
                @php($uniqId = uniqId())
                @php($other_info = $journal_rows->payment->showGenericTypeDetail($journal_rows->payment))
                <tr class="row_{{$uniqId}}">
                 @if($count == 0)
                      
                    <td rowspan="{{$journal_count}}">{{++$transaction_count}}</td>
                   
                    <td rowspan="{{$journal_count}}">{{EF::dateFormat($rows->created_at)}}</td>

                    
                   


                    <td rowspan="{{$journal_count}}"><a target="_blank" href="{{route('document.voucherrejectpreview',['id' => Crypt::encrypt($rows->id)])}}" > VR / {{sprintf('%04d', $rows->id)}} </a></td>
                    <td rowspan="{{$journal_count}}">{{$rows->getRejectedBranch($rows->id)}}</td>

                    <td rowspan="{{$journal_count}}">{{$rows->compound_type}}</td>
                    
                 @endif
                    
                    <td>{{EF::numberFormat($journal_rows->debit)}}</td>
                    <td>{{EF::numberFormat($journal_rows->credit)}}</td>

                    

                 @php($count++)
                </tr>
              @endforeach



         @endforeach
         @endisset
       </tbody>
     </table>
   </div>

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




