private function _getTotalExpense($currentDate) { $itemExpenseService = new ItemExpenseService(); $totalItemExpense = $itemExpenseService->getTotalExpense($currentDate); $otherExpenseService = new OtherExpenseService(); $totalOtherExpense = $otherExpenseService->getTotalExpense($currentDate); return $totalItemExpense + $totalOtherExpense; }
/** * For now let's just show daily expense */ public function dailyexpense($dateParam = null) { $this->load->helper('My_date_helper'); $date = My_date_helper::getMysqlDate($dateParam); $itemExpenseService = new ItemExpenseService(); $itemExpenses = $itemExpenseService->fetchItemExpenses(ItemExpenseService::DAILY, $date); $otherExpenseService = new OtherExpenseService(); $otherExpenses = $otherExpenseService->fetchOtherExpenses(OtherExpenseService::DAILY, $date); $this->renderView('dailyexpense', array('itemExpenses' => $itemExpenses, 'otherExpenses' => $otherExpenses, 'date' => $date)); }