<div class="row colorbox-group-widget">

@section('css')
<style>
         .graphbox{
            position: relative;
            width: 100%;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            grid-gap: 30px;
            margin-bottom: 13px;
        }
        .graphbox .box{
            position: relative;
            background: #fff;
            width: 100%;
            box-shadow: 0 7px 25px rgba(0, 0, 0, 0.08);
            border-radius: 5px;
            margin-top: 60px;
        }
        #FirstChart{
            margin-left: 45px;
        }
        #SecondChart{
            margin-left: 23px;
        }
        #ThirdChart{
            margin-left: 50px
        }
        /* Responsivness */
        @media (max-width: 991px){
            .graphbox{
                grid-template-columns: 1fr;
                height: auto;
            }
        }
    </style>

@stop
             
           


    <div class="col-md-6 col-sm-6 info-color-box">  
        <div class="white-box">
            <div class="media bg-primary">
                <div class="media-body">

                    <h3 class="info-count">{{ number_format($totalBankBalance) }} <span class="pull-right"><i
                                class="mdi mdi-checkbox-marked-circle-outline"></i></span></h3>
                    <p class="info-text font-12">Bank Balances</p>
                    @foreach ($banks as $b)
                        @if ($bankBalance[$b->id] != 0)
                            <p class="info-ot font-15">{{ $b->number }} - {{ $b->name }}<span
                                    class="label label-rounded">
                                    @if ($bankBalance[$b->id] < 0)
                                        <td class="text-right">({{ number_format(abs($bankBalance[$b->id])) }})</td>
                                    @else
                                        <td class="text-right">
                                            {{ $bankBalance[$b->id] > 0 ? number_format($bankBalance[$b->id]) : '-' }}
                                        </td>
                                    @endif
                                </span></p>
                        @endif
                    @endforeach

                </div>
            </div>
        </div>
    </div>
    <div class="col-md-3 col-sm-6 info-color-box">
        <div class="white-box">
            <div class="media bg-success">
                <div class="media-body">

                    <h3 class="info-count">{{ number_format(abs($accountReceivable)) }} <span class="pull-right"><i
                                class="mdi mdi-comment-text-outline"></i></span></h3>
                    <p class="info-text font-12">Accounts Receivable</p>
                    <p class="info-ot font-15"></p>

                </div>
            </div>
        </div>
    </div>
    <div class="col-md-3 col-sm-6 info-color-box">
        <div class="white-box">
            <div class="media bg-danger">
                <div class="media-body">

                    <h3 class="info-count">{{ number_format(abs($accountPayable)) }} <span class="pull-right"><i
                                class="mdi mdi-coin"></i></span></h3>
                    <p class="info-text font-12">Accounts Payable</p>
                    <p class="info-ot font-15"></p>

                </div>
            </div>
        </div>
    </div>

</div>  
<div class="row">
    <div class="col-sm-12">
        <label style="font-weight: 900;">Closing Report : </label>
        <form target="_blank" method="post" action="{{ route('account-closing-report') }}">
            {{ csrf_field() }}
            <input type='hidden' name='multipro_id' id='multipro_id_input' value='all'>
            <div class="col-sm-4">
                <div class="input-group" style="width:100%">
                    <select class="form-control chosen-select" name="bank_id" id="bank_id">
                        @foreach ($banks as $b)
                            <option value="{{ $b->id }}">{{ $b->number }} - {{ $b->name }}
                            </option>
                        @endforeach
                    </select>



                </div>

            </div>

            <div class="col-sm-4">
                <div class="input-group" style="width:100%">

                    <input type="text" class="form-control "id="daterange-btn" value='{{ old('date_range') }}'
                        name='date_range'>
                </div>
            </div>

            <div class="col-sm-3">
                <div class="input-group" style="width:100%">

                    <span class="input-group-btn">
                        <button type="submit" id="check-minutes"
                            class="btn waves-effect waves-light btn-success">Generate</button>
                    </span>
                </div>
            </div>


        </form>
    </div>


</div>

<br>


<!-- /row -->
<div class="row" id="update-table">
    <div class="col-sm-12">
        <div class="white-box">
            <div class="pull-right">

            </div>
            <h3 class="box-title">List of unPosted Entries</h3>

            <div class="table-responsive">
                <table id="myTable" class="table table-striped table-bordered">
                    <thead>
                        <tr>
                            <th>Type</th>
                            <th>Checked</th>
                            <th>Posted</th>
                            <th>Date</th>
                            <!-- <th>Entry No.</th> -->
                            <th>Cheque No.</th>
                            <th>Account</th>
                            <!-- <th>Memo</th> -->
                            <!-- <th>Class</th> -->
                            <th>Debit/Credit (+/-)</th>
                            <th>Action</th>

                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($allEntries as $entry)
                            <tr ondblclick="showEntry('{{ $entry->entry_no }}')">

                                @if ($entry->voucher_type == \App\GeneralJournalEntry::CRV)
                                    <td>CRV-{{ $entry->voucher_no }}</td>
                                @elseif($entry->voucher_type == \App\GeneralJournalEntry::BRV)
                                    <td>BRV-{{ $entry->voucher_no }}</td>
                                @elseif($entry->voucher_type == \App\GeneralJournalEntry::CPV)
                                    <td>CPV-{{ $entry->voucher_no }}</td>
                                @elseif($entry->voucher_type == \App\GeneralJournalEntry::BPV)
                                    <td>BPV-{{ $entry->voucher_no }}</td>
                                @elseif($entry->voucher_type == \App\GeneralJournalEntry::JV)
                                    <td>JV-{{ $entry->voucher_no }}</td>
                                @else
                                    <td></td>
                                @endif

                                <td>
                                    @if ($entry->is_check)
                                        <i class="fa fa-check" style="color:green"></i>
                                    @else
                                        <i class="fa fa-close" style="color: red;"></i>
                                    @endif

                                <td>
                                    @if ($entry->is_post)
                                        <i class="fa fa-check" style="color:green"></i>
                                    @else
                                        <i class="fa fa-close" style="color: red;"></i>
                                    @endif
                                </td>

                                <td>{{ date('d/m/Y', strtotime($entry->date)) }}</td>
                                <!--  <td>Cehk nyumber</td>  -->
                                <td>
                                    {{ $entry->cheaque_no ? $entry->cheaque_no : '' }}
                                </td>
                                <td>{{ $entry->account ? $entry->account->name : '' }}</td>
                                <!-- <td>{{ $entry->memo }}</td> -->
                                <!-- <td>{{ $entry->class ? $entry->class->name : '' }}</td> -->
                                <td class="text-right">{{ number_format($totalAmount[$entry->entry_no]) }}</td>
                                <td>
                                    <!-- <span onclick="showEntry('{{ $entry->entry_no }}')" style="cursor: pointer;" class="btn btn-sm btn-primary"> Show</span> -->

                                    <a href="{{ route('voucher-detail', ['id' => $entry->entry_no]) }}"
                                        class="btn btn-default">View</a>

                                    @if (!$entry->is_approved)
                                        <br><br>
                                        <span onclick="approveEntryModal('{{ $entry->entry_no }}')"
                                            style="cursor: pointer;" class="btn btn-default btn-sm"> Approve</span>
                                    @endif

                                </td>
                            </tr>
                        @endforeach

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!-- /.row -->




<br>


<!--.row-->


<div class="row" id="update-table">

</div>
<!-- /.row -->
<!-- /row -->



<!-- /.container-fluid -->

@section('js')
 


@stop