

                                       

                                          <table id="" class="table table-bordered table-striped">
                                            <thead>
                                                <tr>
                                                    <th><b>Category</b></th>
                                                    <th><?php

                                                       echo $type;
                                                    ?></th>
                                                    <th></th>
                                                    <th></th>
                                                    <th></th>
                                                    <th></th>
                                                  </tr>
                                            </thead>
                                            <thead>
                                                <tr>
                                                   
                                                    <th></th>

                                                    <th></th>
                                                    <th></th>
                                                    <th></th>
                                                    <th></th>
                                                    <th></th>
                                                  </tr>
                                            </thead>
                                            <thead>
                                                <tr>
                                                    <th><b>Date</b></th>
                                                    <th><b>Account Name</b></th>
                                                    <th><b>Description</b></th>
                                                    <th><b>Requested By</b></th>
                                                    <th><b>Category</b></th>
                                                    <th><b>Amount Disbursed</b></th>
                                                  </tr>
                                            </thead>
                                            <tbody>
                                                     <tr style="color: red;">
                                                        <td>Start Date: <?php echo e(date('F d, Y',strtotime($start_date))); ?> </td>
                                                        <td></td>
                                                        <td></td>
                                                        <td><?php $totalBal = 0; ?></td>
                                                     </tr>
                                                <?php $__currentLoopData = $account_journal_entries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    <tr>
                                                        <td><?php echo e(date('F d, Y',strtotime($entry->created_at))); ?></td>
                                                        <td>
                                                            <?php

                                                        $entry_account = DB::table('general_ledgers')
                                                                        ->select('general_ledgers.*')
                                                                        ->where('general_ledgers.reference', $entry->reference)
                                                                        //->where('general_ledgers.account', '!=', $entry->account)
                                                                        ->orderBy('id','asc')
                                                                        ->first();

                                                        $get_account = DB::table('bank_accounts')
                                                                    ->select('bank_accounts.*')
                                                                    ->where('account_number',  $entry_account->account)
                                                                    ->first();

                                                        $get_sub_account = DB::table('sub_bank_accounts')
                                                                    ->select('sub_bank_accounts.*')
                                                                    ->where('account_number',  $entry_account->account)
                                                                    ->first();

                                                        $get_more_accounts = DB::table('more_account_belows')
                                                                    ->select('more_account_belows.*')
                                                                    ->where('account_number',  $entry_account->account)
                                                                    ->first();

                                                        $get_last_accounts = DB::table('last_bank_accounts')
                                                                    ->select('last_bank_accounts.*')
                                                                    ->where('account_number',  $entry_account->account)
                                                                    ->first();

                                                        if(!empty($get_account->name)){
                                                        echo $get_account->name;
                                                        }

                                                        if(!empty($get_sub_account->name)){
                                                        echo $get_sub_account->name;
                                                        }

                                                        if(!empty($get_more_accounts->name)){
                                                        echo $get_more_accounts->name;
                                                        }

                                                        if(!empty($get_last_accounts->name)){
                                                        echo $get_last_accounts->name;
                                                        }

                                                            ?>
                                                        </td>
                                                        <td><?php echo e($entry->details); ?></td>

                                                        <td><?php echo e($entry->requested_by); ?></td>
                                                        <td><?php echo e($entry->category); ?></td>
                                                        <td>
                                                            <?php if($entry->debit == null): ?>

                                                            <?php else: ?>
                                                                <?php echo e(number_format($entry->debit)); ?>

                                                            <?php endif; ?>
                                                            <?php if($entry->credit == null): ?>

                                                            <?php else: ?>
                                                                <?php echo e(number_format($entry->credit)); ?>

                                                            <?php endif; ?>
                                                            <?php
                                                                if($entry->debit == null){
                                                                  $totalBal = $totalBal + $entry->credit ;
                                                                }else{
                                                                     $totalBal = $totalBal + $entry->debit ;
                                                                }

                                                            ?>
                                                        </td>
                                                       

                                                    </tr>
                                                    <?php $totalBal = $totalBal; ?>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <tr style="color: red;">
                                                    <td>End Date: <?php echo e(date('F d, Y',strtotime($end_date))); ?></td>
                                                    <td><b>Total:</b></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td></td>
                                                    <td><b><?php echo e(number_format( $totalBal )); ?></b></td>
                                                 </tr>
                                                </tbody>
                                          </table><?php /**PATH D:\xamp\htdocs\esp_manager\resources\views/chartofaccounts/excelcategorycode.blade.php ENDPATH**/ ?>