mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Remove dead code.
This commit is contained in:
@@ -40,10 +40,6 @@ class BalanceLine
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public const ROLE_TAGROLE = 2;
|
public const ROLE_TAGROLE = 2;
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public const ROLE_DIFFROLE = 3;
|
|
||||||
|
|
||||||
/** @var Collection */
|
/** @var Collection */
|
||||||
protected $balanceEntries;
|
protected $balanceEntries;
|
||||||
@@ -167,9 +163,6 @@ class BalanceLine
|
|||||||
if (self::ROLE_TAGROLE === $this->getRole()) {
|
if (self::ROLE_TAGROLE === $this->getRole()) {
|
||||||
return (string)trans('firefly.coveredWithTags');
|
return (string)trans('firefly.coveredWithTags');
|
||||||
}
|
}
|
||||||
if (self::ROLE_DIFFROLE === $this->getRole()) {
|
|
||||||
return (string)trans('firefly.leftUnbalanced');
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
@@ -36,33 +36,6 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class PopupReport implements PopupReportInterface
|
class PopupReport implements PopupReportInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @param $account
|
|
||||||
* @param $attributes
|
|
||||||
*
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function balanceDifference($account, $attributes): Collection
|
|
||||||
{
|
|
||||||
// row that displays difference
|
|
||||||
/** @var JournalCollectorInterface $collector */
|
|
||||||
$collector = app(JournalCollectorInterface::class);
|
|
||||||
$collector
|
|
||||||
->setAccounts(new Collection([$account]))
|
|
||||||
->setTypes([TransactionType::WITHDRAWAL])
|
|
||||||
->setRange($attributes['startDate'], $attributes['endDate'])
|
|
||||||
->withoutBudget();
|
|
||||||
$journals = $collector->getJournals();
|
|
||||||
|
|
||||||
return $journals->filter(
|
|
||||||
function (Transaction $transaction) {
|
|
||||||
$tags = $transaction->transactionJournal->tags()->where('tagMode', 'balancingAct')->count();
|
|
||||||
|
|
||||||
return 0 === $tags;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
|
@@ -32,14 +32,6 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
interface PopupReportInterface
|
interface PopupReportInterface
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @param $account
|
|
||||||
* @param $attributes
|
|
||||||
*
|
|
||||||
* @return Collection
|
|
||||||
*/
|
|
||||||
public function balanceDifference($account, $attributes): Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Budget $budget
|
* @param Budget $budget
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
|
@@ -127,6 +127,7 @@ class ReportController extends Controller
|
|||||||
$budget = $this->budgetRepository->findNull((int)$attributes['budgetId']);
|
$budget = $this->budgetRepository->findNull((int)$attributes['budgetId']);
|
||||||
$account = $this->accountRepository->findNull((int)$attributes['accountId']);
|
$account = $this->accountRepository->findNull((int)$attributes['accountId']);
|
||||||
|
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case BalanceLine::ROLE_DEFAULTROLE === $role && null !== $budget->id:
|
case BalanceLine::ROLE_DEFAULTROLE === $role && null !== $budget->id:
|
||||||
// normal row with a budget:
|
// normal row with a budget:
|
||||||
@@ -137,10 +138,6 @@ class ReportController extends Controller
|
|||||||
$journals = $this->popupHelper->balanceForNoBudget($account, $attributes);
|
$journals = $this->popupHelper->balanceForNoBudget($account, $attributes);
|
||||||
$budget->name = (string)trans('firefly.no_budget');
|
$budget->name = (string)trans('firefly.no_budget');
|
||||||
break;
|
break;
|
||||||
case BalanceLine::ROLE_DIFFROLE === $role:
|
|
||||||
$journals = $this->popupHelper->balanceDifference($account, $attributes);
|
|
||||||
$budget->name = (string)trans('firefly.leftUnbalanced');
|
|
||||||
break;
|
|
||||||
case BalanceLine::ROLE_TAGROLE === $role:
|
case BalanceLine::ROLE_TAGROLE === $role:
|
||||||
// row with tag info.
|
// row with tag info.
|
||||||
throw new FireflyException('Firefly cannot handle this type of info-button (BalanceLine::TagRole)');
|
throw new FireflyException('Firefly cannot handle this type of info-button (BalanceLine::TagRole)');
|
||||||
|
@@ -900,7 +900,6 @@ return [
|
|||||||
'balanceEnd' => 'Balance at end of period',
|
'balanceEnd' => 'Balance at end of period',
|
||||||
'splitByAccount' => 'Split by account',
|
'splitByAccount' => 'Split by account',
|
||||||
'coveredWithTags' => 'Covered with tags',
|
'coveredWithTags' => 'Covered with tags',
|
||||||
'leftUnbalanced' => 'Left unbalanced',
|
|
||||||
'leftInBudget' => 'Left in budget',
|
'leftInBudget' => 'Left in budget',
|
||||||
'sumOfSums' => 'Sum of sums',
|
'sumOfSums' => 'Sum of sums',
|
||||||
'noCategory' => '(no category)',
|
'noCategory' => '(no category)',
|
||||||
|
Reference in New Issue
Block a user