diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 727bf19a36..98a003841c 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -185,7 +185,7 @@ class ReportQuery implements ReportQueryInterface } /** - * See ReportQueryInterface::incomeInPeriodCorrected + * See ReportQueryInterface::incomeInPeriod * * This method returns all "expense" journals in a certain period, which are both transfers to a shared account * and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does diff --git a/app/Helpers/Report/ReportQueryInterface.php b/app/Helpers/Report/ReportQueryInterface.php index 7805542a3f..8579c52926 100644 --- a/app/Helpers/Report/ReportQueryInterface.php +++ b/app/Helpers/Report/ReportQueryInterface.php @@ -16,7 +16,7 @@ interface ReportQueryInterface { /** - * See ReportQueryInterface::incomeInPeriodCorrected + * See ReportQueryInterface::incomeInPeriod * * This method returns all "expense" journals in a certain period, which are both transfers to a shared account * and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index c03885ef74..55cc8ef56d 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -113,7 +113,7 @@ class BudgetController extends Controller /* * Sum of expenses on this day: */ - $sum = $repository->expensesOnDayCorrected($budget, $start); + $sum = $repository->expensesOnDay($budget, $start); $amount = bcadd($amount, $sum); $entries->push([clone $start, $amount]); $start->addDay(); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index 15dcbc14f7..7bb2699fb0 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -107,7 +107,7 @@ class CategoryController extends Controller return Response::json($cache->get()); // @codeCoverageIgnore } - $array = $repository->getCategoriesAndExpensesCorrected($start, $end); + $array = $repository->getCategoriesAndExpenses($start, $end); // sort by callback: uasort( $array, @@ -151,8 +151,8 @@ class CategoryController extends Controller while ($start <= $end) { - $spent = $repository->spentOnDaySumCorrected($category, $start); - $earned = $repository->earnedOnDaySumCorrected($category, $start); + $spent = $repository->spentOnDaySum($category, $start); + $earned = $repository->earnedOnDaySum($category, $start); $date = Navigation::periodShow($start, '1D'); $entries->push([clone $start, $date, $spent, $earned]); $start->addDay(); @@ -194,8 +194,8 @@ class CategoryController extends Controller while ($start <= $end) { - $spent = $repository->spentOnDaySumCorrected($category, $start); - $earned = $repository->earnedOnDaySumCorrected($category, $start); + $spent = $repository->spentOnDaySum($category, $start); + $earned = $repository->earnedOnDaySum($category, $start); $theDate = Navigation::periodShow($start, '1D'); $entries->push([clone $start, $theDate, $spent, $earned]); $start->addDay(); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index 90e6a642b7..c9c24eef89 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -52,7 +52,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return float */ - public function expensesOnDayCorrected(Budget $budget, Carbon $date) + public function expensesOnDay(Budget $budget, Carbon $date) { bcscale(2); $sum = $budget->transactionjournals()->transactionTypes([TransactionType::WITHDRAWAL])->onDate($date)->get(['transaction_journals.*'])->sum('amount'); diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index ac4e0af7aa..9594f2d2bc 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -35,7 +35,7 @@ interface BudgetRepositoryInterface * * @return float */ - public function expensesOnDayCorrected(Budget $budget, Carbon $date); + public function expensesOnDay(Budget $budget, Carbon $date); /** * @return Collection diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index 95e76fda6d..924104fcba 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -67,7 +67,7 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito * * @return array */ - public function getCategoriesAndExpensesCorrected(Carbon $start, Carbon $end) + public function getCategoriesAndExpenses(Carbon $start, Carbon $end) { $set = Auth::user()->transactionjournals() ->leftJoin( @@ -212,7 +212,7 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito * * @return string */ - public function spentOnDaySumCorrected(Category $category, Carbon $date) + public function spentOnDaySum(Category $category, Carbon $date) { return $category->transactionjournals()->transactionTypes([TransactionType::WITHDRAWAL])->onDate($date)->get(['transaction_journals.*'])->sum('amount'); } @@ -381,7 +381,7 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito * * @return float */ - public function earnedOnDaySumCorrected(Category $category, Carbon $date) + public function earnedOnDaySum(Category $category, Carbon $date) { return $category->transactionjournals()->transactionTypes([TransactionType::DEPOSIT])->onDate($date)->get(['transaction_journals.*'])->sum('amount'); } diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index 62a4516d7b..81719876f8 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -47,7 +47,7 @@ interface CategoryRepositoryInterface * * @return array */ - public function getCategoriesAndExpensesCorrected(Carbon $start, Carbon $end); + public function getCategoriesAndExpenses(Carbon $start, Carbon $end); /** * @param Category $category @@ -156,7 +156,7 @@ interface CategoryRepositoryInterface * * @return float */ - public function spentOnDaySumCorrected(Category $category, Carbon $date); + public function spentOnDaySum(Category $category, Carbon $date); /** * @@ -167,7 +167,7 @@ interface CategoryRepositoryInterface * * @return float */ - public function earnedOnDaySumCorrected(Category $category, Carbon $date); + public function earnedOnDaySum(Category $category, Carbon $date); /** * @param array $data diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php index cac102a0a2..a67313513c 100644 --- a/app/Support/Twig/Budget.php +++ b/app/Support/Twig/Budget.php @@ -23,10 +23,10 @@ class Budget extends Twig_Extension { $functions = []; $functions[] = new Twig_SimpleFunction( - 'spentInRepetitionCorrected', function (LimitRepetition $repetition) { + 'spentInRepetition', function (LimitRepetition $repetition) { $cache = new CacheProperties; $cache->addProperty($repetition->id); - $cache->addProperty('spentInRepetitionCorrected'); + $cache->addProperty('spentInRepetition'); if ($cache->has()) { return $cache->get(); // @codeCoverageIgnore } diff --git a/resources/twig/budgets/show.twig b/resources/twig/budgets/show.twig index 63f1e90c32..21a9fd9c6e 100644 --- a/resources/twig/budgets/show.twig +++ b/resources/twig/budgets/show.twig @@ -50,7 +50,7 @@ {% for limit in limits %} {% for rep in limit.limitRepetitions %} - {% set spentInRep = spentInRepetitionCorrected(rep) %} + {% set spentInRep = spentInRepetition(rep) %}