mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-26 02:40:43 -06:00
Cleaning up
This commit is contained in:
parent
27cabb398e
commit
5eb0e18cae
@ -3,7 +3,6 @@
|
||||
namespace FireflyIII\Helpers\Collection;
|
||||
|
||||
use FireflyIII\Models\Budget as BudgetModel;
|
||||
use FireflyIII\Models\LimitRepetition;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@ -45,24 +44,19 @@ class BalanceLine
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return Collection
|
||||
*/
|
||||
public function getTitle()
|
||||
public function getBalanceEntries()
|
||||
{
|
||||
if ($this->getBudget() instanceof BudgetModel) {
|
||||
return $this->getBudget()->name;
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_DEFAULTROLE) {
|
||||
return trans('firefly.noBudget');
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_TAGROLE) {
|
||||
return trans('firefly.coveredWithTags');
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_DIFFROLE) {
|
||||
return trans('firefly.leftUnbalanced');
|
||||
}
|
||||
return $this->balanceEntries;
|
||||
}
|
||||
|
||||
return '';
|
||||
/**
|
||||
* @param Collection $balanceEntries
|
||||
*/
|
||||
public function setBalanceEntries($balanceEntries)
|
||||
{
|
||||
$this->balanceEntries = $balanceEntries;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,6 +91,27 @@ class BalanceLine
|
||||
$this->role = $role;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
if ($this->getBudget() instanceof BudgetModel) {
|
||||
return $this->getBudget()->name;
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_DEFAULTROLE) {
|
||||
return trans('firefly.noBudget');
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_TAGROLE) {
|
||||
return trans('firefly.coveredWithTags');
|
||||
}
|
||||
if ($this->getRole() == self::ROLE_DIFFROLE) {
|
||||
return trans('firefly.leftUnbalanced');
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* If a BalanceLine has a budget/repetition, each BalanceEntry in this BalanceLine
|
||||
* should have a "spent" value, which is the amount of money that has been spent
|
||||
@ -115,20 +130,4 @@ class BalanceLine
|
||||
|
||||
return $start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getBalanceEntries()
|
||||
{
|
||||
return $this->balanceEntries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $balanceEntries
|
||||
*/
|
||||
public function setBalanceEntries($balanceEntries)
|
||||
{
|
||||
$this->balanceEntries = $balanceEntries;
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,6 @@ namespace FireflyIII\Helpers\Report;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\TransactionType;
|
||||
use Illuminate\Database\Query\JoinClause;
|
||||
use Illuminate\Support\Collection;
|
||||
|
@ -3,8 +3,6 @@
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Budget;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
@ -16,16 +14,16 @@ interface ReportQueryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* This method returns all the "in" transaction journals for the given account and given period. The amount
|
||||
* is stored in "journalAmount".
|
||||
* 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 Collection
|
||||
* @return array
|
||||
*/
|
||||
public function income(Collection $accounts, Carbon $start, Carbon $end);
|
||||
public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* This method returns all the "out" transaction journals for the given account and given period. The amount
|
||||
@ -40,16 +38,16 @@ interface ReportQueryInterface
|
||||
public function expense(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'
|
||||
* This method returns all the "in" transaction journals for the given account and given period. The amount
|
||||
* is stored in "journalAmount".
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
* @return Collection
|
||||
*/
|
||||
public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
||||
public function income(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)
|
||||
@ -61,7 +59,7 @@ interface ReportQueryInterface
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
||||
public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end);
|
||||
|
||||
|
||||
}
|
||||
|
@ -17,8 +17,6 @@ interface BudgetRepositoryInterface
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@ -97,8 +95,8 @@ interface BudgetRepositoryInterface
|
||||
* from the given users accounts..
|
||||
*
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -61,6 +61,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user