mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
94 lines
2.7 KiB
PHP
94 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace FireflyIII\Helpers\Report;
|
|
|
|
use Carbon\Carbon;
|
|
use FireflyIII\Models\Account;
|
|
use FireflyIII\Models\Budget;
|
|
use Illuminate\Support\Collection;
|
|
|
|
/**
|
|
* Interface ReportQueryInterface
|
|
*
|
|
* @package FireflyIII\Helpers\Report
|
|
*/
|
|
interface ReportQueryInterface
|
|
{
|
|
|
|
/**
|
|
* 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
|
|
* not group and returns different fields.
|
|
*
|
|
* @param Carbon $start
|
|
* @param Carbon $end
|
|
* @param Collection $accounts
|
|
*
|
|
* @return Collection
|
|
*
|
|
*/
|
|
public function expenseInPeriod(Carbon $start, Carbon $end, Collection $accounts);
|
|
|
|
// /**
|
|
// * This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results
|
|
// * will simply list the transaction journals only. This should allow any follow up counting to be accurate with
|
|
// * regards to tags. It will only get the incomes to the specified accounts.
|
|
// *
|
|
// * @param Carbon $start
|
|
// * @param Carbon $end
|
|
// * @param Collection $accounts
|
|
// *
|
|
// * @return Collection
|
|
// */
|
|
// public function incomeInPeriod(Carbon $start, Carbon $end, Collection $accounts);
|
|
|
|
/**
|
|
* Covers tags as well.
|
|
*
|
|
* @param Account $account
|
|
* @param Budget $budget
|
|
* @param Carbon $start
|
|
* @param Carbon $end
|
|
*
|
|
* @return float
|
|
*/
|
|
public function spentInBudget(Account $account, Budget $budget, Carbon $start, Carbon $end);
|
|
|
|
/**
|
|
* @param Account $account
|
|
* @param Carbon $start
|
|
* @param Carbon $end
|
|
*
|
|
* @return string
|
|
*/
|
|
public function spentNoBudget(Account $account, Carbon $start, Carbon $end);
|
|
|
|
/**
|
|
* Returns an array of the amount of money spent in the given accounts (on withdrawals, opening balances and transfers)
|
|
* grouped by month like so: "2015-01" => '123.45'
|
|
*
|
|
* @param Collection $accounts
|
|
* @param Carbon $start
|
|
* @param Carbon $end
|
|
*
|
|
* @return array
|
|
*/
|
|
public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
|
|
|
/**
|
|
* Returns an array of the amount of money spent in the given accounts (on withdrawals, opening balances and transfers)
|
|
* grouped by month like so: "2015-01" => '123.45'
|
|
*
|
|
* @param Collection $accounts
|
|
* @param Carbon $start
|
|
* @param Carbon $end
|
|
*
|
|
* @return array
|
|
*/
|
|
public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
|
|
|
|
|
}
|