Moved leftOnAccount()

This commit is contained in:
James Cole
2016-10-10 06:47:42 +02:00
parent ade1cf9c19
commit fcb5e4eabc
4 changed files with 31 additions and 46 deletions

View File

@@ -111,28 +111,6 @@ class AccountRepository implements AccountRepositoryInterface
return $transaction;
}
/**
*
* @param Account $account
* @param Carbon $date
*
* @return string
*/
public function leftOnAccount(Account $account, Carbon $date): string
{
$balance = Steam::balanceIgnoreVirtual($account, $date);
/** @var PiggyBank $p */
foreach ($account->piggyBanks()->get() as $p) {
$currentAmount = $p->currentRelevantRep()->currentamount ?? '0';
$balance = bcsub($balance, $currentAmount);
}
return $balance;
}
/**
* Returns the date of the very last transaction in this account.
*

View File

@@ -60,15 +60,6 @@ interface AccountRepositoryInterface
*/
public function getFirstTransaction(TransactionJournal $journal, Account $account): Transaction;
/**
*
* @param Account $account
* @param Carbon $date
*
* @return string
*/
public function leftOnAccount(Account $account, Carbon $date): string;
/**
* Returns the date of the very last transaction in this account.
*