Refactor names.

This commit is contained in:
James Cole
2015-12-13 09:41:22 +01:00
parent a2f852fecf
commit 59f57c96e9
7 changed files with 39 additions and 39 deletions

View File

@@ -60,8 +60,8 @@ class ReportController extends Controller
$month = clone $start;
$month->endOfMonth();
// total income and total expenses:
$incomeSum = $query->incomeInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive');
$expenseSum = $query->expenseInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive');
$incomeSum = $query->incomeInPeriod($start, $month, $accounts)->sum('amount_positive');
$expenseSum = $query->expenseInPeriod($start, $month, $accounts)->sum('amount_positive');
$entries->push([clone $start, $incomeSum, $expenseSum]);
@@ -109,8 +109,8 @@ class ReportController extends Controller
$month = clone $start;
$month->endOfMonth();
// total income and total expenses:
$currentIncome = $query->incomeInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive');
$currentExpense = $query->expenseInPeriodCorrectedForList($start, $month, $accounts)->sum('amount_positive');
$currentIncome = $query->incomeInPeriod($start, $month, $accounts)->sum('amount_positive');
$currentExpense = $query->expenseInPeriod($start, $month, $accounts)->sum('amount_positive');
$income = bcadd($income, $currentIncome);
$expense = bcadd($expense, $currentExpense);

View File

@@ -192,7 +192,7 @@ class JsonController extends Controller
return Response::json($cache->get()); // @codeCoverageIgnore
}
$accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']);
$amount = $reportQuery->incomeInPeriodCorrectedForList($start, $end, $accounts)->sum('amount');
$amount = $reportQuery->incomeInPeriod($start, $end, $accounts)->sum('amount');
$data = ['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount];
$cache->store($data);
@@ -221,7 +221,7 @@ class JsonController extends Controller
return Response::json($cache->get()); // @codeCoverageIgnore
}
$amount = $reportQuery->expenseInPeriodCorrectedForList($start, $end, $accounts)->sum('amount');
$amount = $reportQuery->expenseInPeriod($start, $end, $accounts)->sum('amount');
$amount = $amount * -1;
$data = ['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount];

View File

@@ -75,9 +75,9 @@ class ReportController extends Controller
$incomeTopLength = 8;
$expenseTopLength = 8;
$accountReport = $this->helper->getAccountReportForList($start, $end, $accounts);
$incomes = $this->helper->getIncomeReportForList($start, $end, $accounts);
$expenses = $this->helper->getExpenseReportForList($start, $end, $accounts);
$accountReport = $this->helper->getAccountReport($start, $end, $accounts);
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
Session::flash('gaEventCategory', 'report');
Session::flash('gaEventAction', 'year');
@@ -118,13 +118,13 @@ class ReportController extends Controller
$expenseTopLength = 8;
// get report stuff!
$accountReport = $this->helper->getAccountReportForList($start, $end, $accounts);
$incomes = $this->helper->getIncomeReportForList($start, $end, $accounts);
$expenses = $this->helper->getExpenseReportForList($start, $end, $accounts);
$budgets = $this->helper->getBudgetReportForList($start, $end, $accounts);
$categories = $this->helper->getCategoryReportForList($start, $end, $accounts);
$balance = $this->helper->getBalanceReportForList($start, $end, $accounts);
$bills = $this->helper->getBillReportForList($start, $end, $accounts);
$accountReport = $this->helper->getAccountReport($start, $end, $accounts);
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
$budgets = $this->helper->getBudgetReport($start, $end, $accounts);
$categories = $this->helper->getCategoryReport($start, $end, $accounts);
$balance = $this->helper->getBalanceReport($start, $end, $accounts);
$bills = $this->helper->getBillReport($start, $end, $accounts);
// and some id's, joined:
$accountIds = [];