This commit is contained in:
Sampanna Rimal
2024-08-12 16:21:46 +05:45
parent 16246fbdeb
commit fe8786f03f
11 changed files with 195 additions and 112 deletions

View File

@ -26,9 +26,10 @@ function displayCategoryTree($tree)
{
echo '<table class="table table-bordered">';
foreach ($tree as $category) {
// print_r($category);die;
echo '<tr>';
echo '<td class="col-1">' . $category['accategory_id'] . '</td>';
echo '<td class="col-6"><a href="' . site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] . '">' . $category['accategory_name'] . '</a></td>';
echo '<td class="col-6">'. ($category['parent_category_id'] == 0 ? "<b>" : "") .'<a href="' . site_url("accounts/reports/balance_by_group") . "?category=" . $category['accategory_id'] . '">' . $category['accategory_name'] . '</a>' .( $category['parent_category_id'] == 0? "</b>" : "") . '</td>';
echo '<td class="col-2">' . myCurrency($category['dr']) . '</td>';
echo '<td class="col-2">' . myCurrency($category['cr']) . '</td>';
echo '</tr>';

View File

@ -1,6 +1,8 @@
<?php
$drWidth = 250;
$crWidth = 250;
$balanceWidth = 250;
$AccountCategories = $this->myaccounts->getChildAccountCategories();
?>
<style>
@ -34,9 +36,11 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
<?php
$drTotal = 0;
$crTotal = 0;
$balanceTotal = 0;
foreach ($AccountCategories as $AccountCategory) :
$drTotal += $AccountCategory->dr;
$crTotal += $AccountCategory->cr;
$balanceTotal += $AccountCategory->Balance
?>
<!-- <?php //print_r($AccountCategory);die; ?> -->
<tr>
@ -46,7 +50,7 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
</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 width="<?php echo $crWidth; ?>"><?php echo myCurrency(abs($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>
@ -56,8 +60,8 @@ $AccountCategories = $this->myaccounts->getChildAccountCategories();
<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 width="<?php echo $crWidth; ?>"><?php echo myCurrency(abs($crTotal)); ?></td>
<td class="text-right"><?php echo myCurrency($balanceTotal); ?></td>
<td ></td>
</tr>
</thead>