BBnepal-Accounts/account/application/views/accounts/balances/bygroup.php
Sampanna Rimal 16246fbdeb changes
2024-08-11 17:29:32 +05:45

78 lines
4.0 KiB
PHP

<?php
$drWidth = 250;
$crWidth = 250;
$AccountCategories = $this->myaccounts->getChildAccountCategories();
?>
<style>
.expandable {
text-decoration: underline;
}
</style>
<div class="content-wrapper">
<div class="container-fluid">
</div>
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<div class="card-header">
<h5 class="m-0"><?php echo $pageTitle; ?> </h5>
</div>
<div class="card-body">
<table class="table table-bordered longdataTable">
<thead>
<tr>
<th>Account</th>
<th width="<?php echo $drWidth; ?>">Dr</th>
<th width="<?php echo $crWidth; ?>">Cr</th>
<th class="col-1 text-center">Balance</th>
<th class="col-1 text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$drTotal = 0;
$crTotal = 0;
foreach ($AccountCategories as $AccountCategory) :
$drTotal += $AccountCategory->dr;
$crTotal += $AccountCategory->cr;
?>
<!-- <?php //print_r($AccountCategory);die; ?> -->
<tr>
<td>
<a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>">
<?php echo $AccountCategory->accategory_name; ?>
</a>
</td>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($AccountCategory->dr); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($AccountCategory->cr); ?></td>
<td class="text-right"><?php echo myCurrency($AccountCategory->Balance); ?></td>
<td class="text-center"><a href="<?php echo site_url("accounts/reports/balance_by_ledger") . "?group=" . $AccountCategory->accategory_id; ?>" class="btn btn-info btn-xs"><i class="fas fa-eye"></i> </a></td>
</tr>
<?php endforeach; ?>
</tbody>
<thead>
<tr>
<th>Total</th>
<td width="<?php echo $drWidth; ?>"><?php echo myCurrency($drTotal); ?></td>
<td width="<?php echo $crWidth; ?>"><?php echo myCurrency($crTotal); ?></td>
<td ></td>
<td ></td>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<script>
function toggleSubTable(row) {
var subTable = row.nextElementSibling;
subTable.style.display = subTable.style.display === 'none' ? 'table-row' : 'none';
}
</script>
</div>