<?php $__env->startSection('page_title'); ?>
  Accounts
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_header_title'); ?>
  Manage Account
<?php $__env->stopSection(); ?>



<?php $__env->startSection('page_body'); ?>
<?php echo e(Breadcrumbs::render('head')); ?>


<?php $__currentLoopData = $chart_of_account; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
  <div class="row">
      <div class="col-lg-12 col-xl-12">
        <div class="card card-collapse card-collapsed">
          <div class="card-header">
                <a style="vertical-align: middle; text-decoration: none; margin-top: 3px;" href="#" class="card-options-link  cls_collapsed" >
                  <i class="icon fe fe-plus nature-color">&nbsp;&nbsp;</i>
                </a>
              <h3 class="card-title nature-color">  <?php echo e($rows['code']); ?> - <?php echo e($rows['nature']); ?></h3>

              <?php ($balance = $journal->getClosingBalance(['nature' => $rows['nature']])); ?>

              <small class="nature-color" style="margin-left: 10px;">
                <?php if($balance < 0 && in_array($rows['nature'],['Capital / Equity','Long-term Liability','Short-term Liability','Revenue'])): ?>
                   (<?php echo e(EF::numberFormat(abs($balance))); ?>)
                <?php else: ?>
                    <?php echo e(EF::numberFormat(($balance))); ?>

                <?php endif; ?>
              </small>
              

              <div class="card-options">
                <?php ($head_tag = str_replace(' ','_',strtolower('head_'.$rows['nature']))); ?>
               
                <?php if(Auth::user()->hasAnyPermission(['All','Add Head'])): ?>
                <abbr title="Add Head">
                <a href="javascript:void(0)" data-toggle="modal" data-target="#md_add_head"  onclick="showHeadModel(event,'<?php echo e($head_tag); ?>','<?php echo e($rows['nature']); ?>')" class="btn btn-sm btn-primary "><i class=" fe fe-plus"></i></a>
                </abbr>
                <?php endif; ?>

              </div>

          </div>
          
          <div class="card-body">

            <div id="<?php echo e($head_tag); ?>">
            
              <?php ($head_data['head_list']   = $rows['head_list']); ?>

              <?php ($head_data['accountObj']  = $accountObj); ?>

              <?php ($head_data['nature']  = $rows['nature']); ?>

              <?php ($head_data['journal']  = $journal); ?>


              <?php ($head_view = view('components.head.head_tabs',$head_data)); ?>

              <?php echo $head_view; ?>


           </div>
            
          
          </div>
        </div>
      </div>
    </div>
  <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>




<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_modal'); ?>

<?php if(Auth::user()->hasAnyPermission(['All','Add Head'])): ?>
  <?php echo $__env->make('accounts.modals.add_head', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endif; ?>

<?php if(Auth::user()->hasAnyPermission(['All','Update Head'])): ?>
  <?php echo $__env->make('accounts.modals.update_head', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php endif; ?>

  <div id="add_subhead_modal"></div>
  <div id="update_subhead_modal"></div>


  <?php echo $__env->make('bank.modals.add_bank', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>


<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_script'); ?>

  <?php echo $__env->make('scripts.head', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <?php echo $__env->make('scripts.subhead', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <?php echo $__env->make('scripts.bank', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
  
<?php $__env->stopSection(); ?>

  
<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/accounts/manage_head.blade.php ENDPATH**/ ?>