
                <div class="row text-center" >
                                       <h3><strong>{{env('APP_NAME')}}</strong></h3>
                                       <h4><strong>General Ledger</strong></h4>
                                       <h6>{{date('M d,Y',strtotime($from))}} - {{date('M d,Y',strtotime($to))}}</h6>
                                       <h4><strong><u> {{$account->number}} - {{$account->name}} ({{$account->type->name}})</u></strong></h4> 
                                    </div>

                <!-- /row -->
                <div class="row">
                   
                    <div class="col-sm-12">
                        <div class="white-box">
                            <!-- <h3 class="box-title">{{$account->number}} - {{$account->name}} ({{$account->type->name}})</h3>
                            <hr> -->
                                    <div class="table-responsive">
                                        @if($account->type->name == 'Bank' || $account->type->name == 'Fixed Asset' || $account->type->name == 'Other CurrentAsset' || $account->type->name == 'Other Asset' || $account->type->name == 'Non-Current Asset' || $account->type->name == 'Expense' || $account->type->name == 'Direct Cost' || $account->type->name == 'Income')
                                        <table  class="table bdr table-bordered tbl" >
                                            <thead>
                                                <tr>
                                                    <th  style="text-align: center;">Date</th>
                                                    <th  style="text-align: center;">Voucher No</th>
                                                    <th  style="text-align: center;">Cheque No</th>
                                                    <th   style="text-align: center;" >Party</th>
                                                    <th  style="width: 40%;" style="text-align: center;" >Narration</th>
                                                    <th  style="text-align: center;">Debit</th>
                                                    <th  style="text-align: center;">Credit</th>
                                                    <th  style="text-align: center;">Balance</th>
                                                </tr>
                                                
                                            </thead>
                                            <tbody>
                                                <?php $balance = $openingBalance;$debit = 0; $credit = 0;$monthlyDebit = 0;$monthlyCredit = 0;?>

                                                <tr>
                                                    <td ></td>
                                                    <td></td>
                                                    <td  ></td>
                                                    <td  ></td>
                                                    <td >&nbsp;&nbsp;Opening Balance</td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right">{{$balance != 0? number_format($balance) : '-'}}</td>
                                                    
                                                </tr>

                                                @foreach($entries as $entry)
                                                <tr>
                                                    <td >&nbsp;&nbsp; {{date('d/m/Y',strtotime($entry->date))}}</td>
                                                    
                                                    <td data-id="{{$entry->entry_no}}" style="cursor:pointer;color: #afaff7;text-align: center;" onclick="return openThisVoucher(this);">
                                                    
                                                    
                                                    @if($entry->voucher_type == \App\GeneralJournalEntry::CRV)
                                                    CRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BRV)
                                                    BRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::CPV)
                                                    CPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BPV)
                                                    BPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::JV)
                                                    JV-{{$entry->voucher_no}}
                                                    @else
                                                    
                                                    @endif
                                                    
                                                    
                                                    </td>
                                                     <td>
                                                        {{$entry->cheaque_no }}
                                                    </td>
                                                    <td  >&nbsp;&nbsp; 
                                                        {{$entry->controlAccount ? $entry->controlAccount->name : ''}}
                                                    </td>
                                                    <td >&nbsp;{{$entry->memo}}</td>
                                                    <td class="text-right">{{$entry->amount > 0 ? number_format(abs($entry->amount)) : ''}}

                                                        <?php $debit += $entry->amount > 0 ? $entry->amount : 0;?>
                                                    </td>
                                                    <td class="text-right">{{$entry->amount < 0 ? number_format(abs($entry->amount)) : ''}}

                                                    <?php $credit += $entry->amount < 0 ? abs($entry->amount) : 0;?>
                                                        
                                                    </td>
                                                    <?php $balance +=$entry->amount;?>
                                                    @if($balance < 0)
                                                    <td class="text-right">({{number_format(abs($balance))}})</td>
                                                    @else
                                                    <td class="text-right">{{$balance > 0? number_format($balance) : '-'}}</td>
                                                    @endif
                                                </tr>
                                                
                                                @endforeach
                                                <!-- <tr>
                                                    <td colspan="4" class="text-right"><b>Monthly Total</b></td>
                                                    <td class="text-right"><b>150000</b></td>
                                                    <td class="text-right"><b>200000</b></td>
                                                    <td class="text-right"><b>250000</b></td>
                                                </tr> -->
                                                <tr>
                                                    <td style="border-right: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td  class="text-right"><b>Grand Total</b></td>

                                                    <td class="text-right" ><b style="border-bottom:1px solid black;">{{$debit !=0 ? number_format($debit) : '-'}}</b></td>
                                                    <td class="text-right"><b style="border-bottom:1px solid black;">{{$credit !=0 ? number_format($credit) : '-'}}</b></td>
                                                    @if($balance < 0)
                                                    <td class="text-right"><b style="border-bottom:1px solid black;">({{number_format(abs($balance))}})</b></td>
                                                    @else
                                                    <td class="text-right"><b style="border-bottom:1px solid black;">{{$balance > 0? number_format($balance) : '-'}}</b></td>
                                                    @endif
                                                </tr>
                                            </tbody>
                                        </table>
                                        <!-- <div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{number_format($balance)}}</div> -->
                                        @elseif($account->type->name == 'Accounts Receivable')
                                        <table  class="table bdr table-bordered tbl" >
                                            <thead>
                                                <tr>
                                                    <th  style="text-align: center;">DATE</th>
                                                    <th  style="text-align: center;">Voucher #</th>
                                                    <th  style="text-align: center;">Cheque No</th>
                                                    <th  style="width: 40%;" style="text-align: center;" >CUSTOMER</th>
                                                    <th  style="text-align: center;">Narration</th>
                                                    <th  style="text-align: center;">Debit</th>
                                                    <th  style="text-align: center;">Credit</th>
                                                    <th  style="text-align: center;"> Balance</th>
                                                </tr>
                                                
                                            </thead>
                                            <tbody>
                                            <?php $balance = $openingBalance;$debit = 0; $credit = 0;?>

                                                <tr>
                                                    <td ></td>
                                                    <td> 
                                                        
                                                    </td>
                                                    <td  >
                                                    </td>
                                                    <td  ></td>
                                                    <td >&nbsp;&nbsp;Opening Balance</td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right">{{$balance != 0 ? number_format($balance) : '-'}}</td>
                                                    
                                                </tr>
                                                @foreach($entries as $entry)
                                                <tr>
                                                    <td >{{date('d/m/Y',strtotime($entry->date))}}</td>
                                                    
                                        
                                        
                                        <td data-id="{{$entry->entry_no}}" style="font-size:11px;cursor:pointer;color: #afaff7;text-align: center;" onclick="return openThisVoucher(this);">
                                                    
                                                    
                                                    @if($entry->voucher_type == \App\GeneralJournalEntry::CRV)
                                                    CRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BRV)
                                                    BRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::CPV)
                                                    CPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BPV)
                                                    BPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::JV)
                                                    JV-{{$entry->voucher_no}}
                                                    @else
                                                    
                                                    @endif
                                                    
                                                    
                                                    </td>
                                                     <td>
                                                        {{$entry->cheaque_no }}
                                                    </td>
                                                    
                                                    <td  >
                                                        {{$entry->controlAccount ? $entry->controlAccount->name : ''}}
                                                    </td>
                                                    <td >{{$entry->memo}}</td>
                                                    <td class="text-right">{{$entry->amount > 0 ? number_format(abs($entry->amount)) : ''}}

                                                        <?php $debit += $entry->amount > 0 ? $entry->amount : 0;?>
                                                    </td>
                                                    <td class="text-right">{{$entry->amount < 0 ? number_format(abs($entry->amount)) : ''}}

                                                    <?php $credit += $entry->amount < 0 ? abs($entry->amount) : 0;?>
                                                        
                                                    </td>
                                                    <?php $balance += $entry->amount;?>
                                                    @if($balance < 0)
                                                    <td style="text-align: right;">({{number_format(abs($balance))}})</td>
                                                    @else
                                                    <td style="text-align: right;">{{$balance > 0 ? number_format($balance) : '-'}}</td>
                                                    @endif
                                                </tr>
                                                
                                                @endforeach
                                                <!-- <tr>
                                                    <td colspan="4" class="text-right"><b>Monthly Total</b></td>
                                                    <td class="text-right"><b>150000</b></td>
                                                    <td class="text-right"><b>200000</b></td>
                                                    <td class="text-right"><b>250000</b></td>
                                                </tr> -->
                                                <tr>
                                                    <td style="border-right: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td  class="text-right"><b>Grand Total</b></td>

                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$debit !=0 ? number_format($debit) : '-'}}</u></b></td>
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$credit !=0 ? number_format($credit) : '-'}}</u></b></td>
                                                    @if($balance < 0)
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>({{number_format(abs($balance))}})</u></b></td>
                                                    @else
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$balance > 0? number_format($balance) : '-'}}</u></b></td>
                                                    @endif
                                                </tr>
                                            </tbody>
                                        </table>

                                        <!--<div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{number_format($balance)}}</div>-->
                                        
                                        @elseif($account->type->name == 'Accounts Payable')
                                        <table  class="table bdr table-bordered tbl" >
                                            <thead>
                                                <tr>
                                                    <th  style="text-align: center;">DATE</th>
                                                    <th  style="text-align: center;">VOUCHER #</th>
                                                    <th  style="text-align: center;">Cheque No</th>
                                                    <th  style="text-align: center;" >VENDOR</th>
                                                    <th  style="width: 40%;" style="text-align: center;" >Narration</th>
                                                    <th  style="text-align: center;">Debit</th>
                                                    <th  style="text-align: center;">Credit</th>
                                                    <th  style="text-align: center;">Balance</th>
                                                </tr>
                                                
                                            </thead>
                                            <tbody>
                                            <?php $balance = $openingBalance;$debit = 0; $credit = 0;?>

                                                <tr>
                                                    <td ></td>
                                                    <td> 
                                                        
                                                    </td>
                                                    <td  >
                                                    </td>
                                                    <td  ></td>
                                                    <td >&nbsp;&nbsp;Opening Balance</td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right">{{$balance != 0? number_format($balance) : '-'}}</td>
                                                    
                                                </tr>
                                                @foreach($entries as $entry)
                                                <tr>
                                                    <td >{{date('d/m/Y',strtotime($entry->date))}}</td>
                                                    
                                        
                                        
                                         <td data-id="{{$entry->entry_no}}" style="font-size:11px;cursor:pointer;color: #afaff7;text-align: center;" onclick="return openThisVoucher(this);">
                                                    
                                                    
                                                    @if($entry->voucher_type == \App\GeneralJournalEntry::CRV)
                                                    CRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BRV)
                                                    BRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::CPV)
                                                    CPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BPV)
                                                    BPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::JV)
                                                    JV-{{$entry->voucher_no}}
                                                    @else
                                                    
                                                    @endif
                                                    
                                                    
                                                    </td>
                                                     <td>
                                                        {{$entry->cheaque_no }}
                                                    </td>
                                                    <td  >
                                                        {{$entry->controlAccount ? $entry->controlAccount->name : ''}}
                                                    </td>
                                                    <td style="font-size:11px">{{$entry->memo}}</td>
                                                    <td class="text-right">{{$entry->amount > 0 ? number_format(abs($entry->amount)) : ''}}

                                                        <?php $debit += $entry->amount > 0 ? $entry->amount : 0;?>
                                                    </td>
                                                    <td class="text-right">{{$entry->amount < 0 ? number_format(abs($entry->amount)) : ''}}

                                                    <?php $credit += $entry->amount < 0 ? abs($entry->amount) : 0;?>
                                                        
                                                    </td>
                                                    <?php $balance += $entry->amount ;?>
                                                    @if($balance < 0)
                                                    <td style="text-align: right;">({{number_format(abs($balance))}})</td>
                                                    @else
                                                    <td style="text-align: right;color: red;font-size: 11px;">{{$balance > 0? number_format($balance) : '-'}}</td>
                                                    @endif
                                                </tr>
                                                
                                                @endforeach
                                                <!-- <tr>
                                                    <td colspan="4" class="text-right"><b>Monthly Total</b></td>
                                                    <td class="text-right"><b>150000</b></td>
                                                    <td class="text-right"><b>200000</b></td>
                                                    <td class="text-right"><b>250000</b></td>
                                                </tr> -->
                                                <tr>
                                                    <td style="border-right: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td  class="text-right"><b>Grand Total</b></td>

                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$debit !=0 ? number_format($debit) : '-'}}</u></b></td>
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$credit !=0 ? number_format($credit) : '-'}}</u></b></td>
                                                    @if($balance < 0)
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>({{number_format(abs($balance))}})</u></b></td>
                                                    @else
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$balance > 0? number_format($balance) : '-'}}</u></b></td>
                                                    @endif
                                                </tr>
                                            </tbody>
                                        </table>
                                       <!--@if($balance < 0)-->
                                       <!-- <div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({{number_format(abs($balance))}})</div>-->
                                       <!-- @else-->
                                       <!-- <div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{number_format($balance)}}</div>-->
                                       
                                       <!-- @endif-->

                                        
                                        @elseif($account->type->name == 'Other Current Liability' || $account->type->name == 'Long Term Liability' || $account->type->name == 'Current Liability' || $account->type->name == 'Equity')
                                        <table  class="table bdr table-bordered tbl" >
                                            <thead>
                                                <tr>
                                                    <th  style="text-align: center;">Date</th>
                                                    <th  style="text-align: center;">Voucher #</th>
                                                    <th  style="text-align: center;">Cheque No</th>
                                                    <th   style="text-align: center;" >Payee</th>
                                                    <th  style="width: 40%;" style="text-align: center;" >Narration</th>
                                                    <th  style="text-align: center;">Debit</th>
                                                    <th  style="text-align: center;">Credit</th>
                                                    <th  style="text-align: center;">Balance</th>
                                                </tr>
                                                
                                            </thead>
                                            <tbody>
                                            <?php $balance = $openingBalance;$debit = 0; $credit = 0;?>

                                                <tr>
                                                    <td ></td>
                                                    <td> 
                                                        
                                                    </td>
                                                    <td  >
                                                    </td>
                                                    <td  ></td>
                                                    <td >&nbsp;&nbsp;Opening Balance</td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right"></td>
                                                    <td class="text-right">{{$balance != 0? number_format($balance) : '-'}}</td>
                                                    
                                                </tr>
                                                @foreach($entries as $entry)
                                                <tr>
                                                    <td >{{date('d/m/Y',strtotime($entry->date))}}</td>
                                                    <td data-id="{{$entry->entry_no}}" style="font-size:11px;cursor:pointer;color: #afaff7;text-align: center;" onclick="return openThisVoucher(this);">
                                                    
                                                    
                                                    @if($entry->voucher_type == \App\GeneralJournalEntry::CRV)
                                                    CRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BRV)
                                                    BRV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::CPV)
                                                    CPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::BPV)
                                                    BPV-{{$entry->voucher_no}}
                                                    @elseif($entry->voucher_type == \App\GeneralJournalEntry::JV)
                                                    JV-{{$entry->voucher_no}}
                                                    @else
                                                    
                                                    @endif
                                                    
                                                    
                                                    </td>
                                                     <td>
                                                        {{$entry->cheaque_no }}
                                                    </td>
                                                    <td >
                                                        {{$entry->controlAccount ? $entry->controlAccount->name : ''}}
                                                    </td>
                                                    <td style="font-size:11px">{{$entry->memo}}</td>
                                                    <td class="text-right">{{$entry->amount > 0 ? number_format(abs($entry->amount)) : ''}}

                                                        <?php $debit += $entry->amount > 0 ? $entry->amount : 0;?>
                                                    </td>
                                                    <td class="text-right">{{$entry->amount < 0 ? number_format(abs($entry->amount)) : ''}}

                                                    <?php $credit += $entry->amount < 0 ? abs($entry->amount) : 0;?>
                                                        
                                                    </td>
                                                    
                                                    <?php $balance += $entry->amount;?>

                                                    
                                                    @if($balance < 0)
                                                    <td class="text-right">({{number_format(abs($balance))}})</td>
                                                    @else
                                                    <td class="text-right">{{$balance > 0? number_format($balance) : '-'}}</td>
                                                    @endif
                                                </tr>
                                                
                                                @endforeach
                                                
                                                <tr>
                                                    <td style="border-right: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td style="border-right: none;border-left: none;"></td>
                                                    <td  class="text-right"><b>Grand Total</b></td>


                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$debit !=0 ? number_format($debit) : '-'}}</u></b></td>
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$credit !=0 ? number_format($credit) : '-'}}</u></b></td>
                                                    @if($balance < 0)
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>({{number_format(abs($balance))}})</u></b></td>
                                                    @else
                                                    <td class="text-right"><b style="border-bottom:1px solid black;"><u>{{$balance > 0? number_format($balance) : '-'}}</u></b></td>
                                                    @endif
                                                </tr>
                                            </tbody>
                                        </table>
                                        <!--@if($balance < 0)-->
                                        <!--<div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;({{number_format(abs($balance))}})</div>-->
                                        <!--@else-->
                                        <!--<div style="font-size: 18px;float: right;padding-right: 80px;"> Ending Balance : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{number_format($balance)}}</div>-->
                                       
                                        <!--@endif-->
                                        

                                        @else

                                        <table>7</table>
                                        @endif

                                    </div>

                        </div>
                    </div>
                

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


            