load->library("NewAcc"); $Acc = new NewAcc(); $CI = &get_instance(); $txt = "SELECT g.acgroup_id AS group_id, g.acgroup_name AS group_name, cp.accategory_id AS parent_id, cp.acgroup_id AS group_id, cp.accategory_name AS parent_category_name, cc.accategory_id AS child_id, cc.accategory_name AS child_category_name, ccc.accategory_id AS child_child_id, ccc.accategory_name AS child_child_category_name, a.account_id, a.account_name FROM tbl_acgroups g LEFT JOIN tbl_accategories cp ON g.acgroup_id = cp.acgroup_id AND cp.parent_category_id = 0 LEFT JOIN tbl_accategories cc ON cp.accategory_id = cc.parent_category_id LEFT JOIN tbl_accategories ccc ON cc.accategory_id = ccc.parent_category_id LEFT JOIN tbl_accounts a ON ccc.accategory_id = a.accategory_id ORDER BY g.display_order, cp.accategory_id, cc.accategory_id, ccc.accategory_id; "; $AccountTree = $CI->db->query($txt)->result(); function displayAccountTree($accountTree, $parentCategory = 0) { echo ''; } $IncomeCategories = $Acc->getAccountCategories(3); $IncomeAccounts = $this->acc->getAccountsByGroup(3); $ExpenseAccounts = $this->acc->getAccountsByGroup(4); $IncomesTotal = $this->acc->getAccountBalanceByGroup(3); $ExpensesTotal = $this->acc->getAccountBalanceByGroup(4); $PL = $IncomesTotal - $ExpensesTotal; ?>
load->library("NewAcc"); $Acc = new NewAcc(); echo '
'; foreach ($categories as $category) { ?>
0) { echo '
'; } ?>
accategory_name; ?>
dr); ?>
cr); ?>
0) { echo '
'; } ?>
children = $Acc->getChildCategories($category->accategory_id); if (!empty($category->children)) { // Increase the level for child categories $childLevel = $level + 1; displayCategories($category->children, $childLevel); } ?>
'; } ?>
Profit & Loss Statement
Incomes Amount Expenses Amount
Net Loss:
Net Profit:
Total Loss: Total:
Total: Total:
balance) ?>
Account Balance
account_name; ?> balance)); ?>