mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Remove deprecated methods.
This commit is contained in:
parent
70d936bb8f
commit
782a6f289c
@ -44,7 +44,8 @@ class ConnectJournalToPiggyBank
|
||||
|
||||
$amount = TransactionJournal::amountPositive($journal);
|
||||
// if piggy account matches source account, the amount is positive
|
||||
if ($piggyBank->account_id == TransactionJournal::sourceAccount($journal)->id) {
|
||||
$sources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray();
|
||||
if (in_array($piggyBank->account_id, $sources)) {
|
||||
$amount = bcmul($amount, '-1');
|
||||
}
|
||||
|
||||
|
@ -131,33 +131,6 @@ class TransactionJournalSupport extends Model
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function destinationAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
$account = $transaction->account;
|
||||
$cache->store($account);
|
||||
} else {
|
||||
$account = new Account;
|
||||
}
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@ -183,31 +156,6 @@ class TransactionJournalSupport extends Model
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function destinationAccountTypeStr(TransactionJournal $journal): string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('destination-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
|
||||
$account = self::destinationAccount($journal);
|
||||
$type = $account->accountType ? $account->accountType->type : '(unknown)';
|
||||
$cache->store($type);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@ -275,33 +223,6 @@ class TransactionJournalSupport extends Model
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return Account
|
||||
*/
|
||||
public static function sourceAccount(TransactionJournal $journal): Account
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
$transaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
if (!is_null($transaction)) {
|
||||
$account = $transaction->account;
|
||||
$cache->store($account);
|
||||
} else {
|
||||
$account = new Account;
|
||||
}
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
@ -327,30 +248,6 @@ class TransactionJournalSupport extends Model
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function sourceAccountTypeStr(TransactionJournal $journal): string
|
||||
{
|
||||
$cache = new CacheProperties;
|
||||
$cache->addProperty($journal->id);
|
||||
$cache->addProperty('transaction-journal');
|
||||
$cache->addProperty('source-account-type-str');
|
||||
if ($cache->has()) {
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$account = self::sourceAccount($journal);
|
||||
$type = $account->accountType ? $account->accountType->type : '(unknown)';
|
||||
$cache->store($type);
|
||||
|
||||
return $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user