mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-02 02:18:20 +00:00
Remove some stuff, mark as deprecated.
This commit is contained in:
@@ -227,8 +227,7 @@ class Account extends Model
|
|||||||
*/
|
*/
|
||||||
public function getOpeningBalance(): TransactionJournal
|
public function getOpeningBalance(): TransactionJournal
|
||||||
{
|
{
|
||||||
$journal = TransactionJournal::sortCorrectly()
|
$journal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
|
||||||
->where('transactions.account_id', $this->id)
|
->where('transactions.account_id', $this->id)
|
||||||
->transactionTypes([TransactionType::OPENING_BALANCE])
|
->transactionTypes([TransactionType::OPENING_BALANCE])
|
||||||
->first(['transaction_journals.*']);
|
->first(['transaction_journals.*']);
|
||||||
|
@@ -135,24 +135,6 @@ class Tag extends Model
|
|||||||
return Crypt::decrypt($value);
|
return Crypt::decrypt($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Save the model to the database.
|
|
||||||
*
|
|
||||||
* @param array $options
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function save(array $options = [])
|
|
||||||
{
|
|
||||||
foreach ($this->transactionJournals()->get() as $journal) {
|
|
||||||
$count = $journal->tags()->count();
|
|
||||||
$journal->tag_count = $count;
|
|
||||||
$journal->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
return parent::save($options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
|
@@ -141,7 +141,7 @@ class TransactionJournal extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
* @deprecated
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -155,6 +155,7 @@ class TransactionJournal extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
|
*
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
*/
|
*/
|
||||||
public function destinationJournalLinks(): HasMany
|
public function destinationJournalLinks(): HasMany
|
||||||
@@ -297,22 +298,6 @@ class TransactionJournal extends Model
|
|||||||
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
return $this->hasMany('FireflyIII\Models\PiggyBankEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
* Save the model to the database.
|
|
||||||
*
|
|
||||||
* @param array $options
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function save(array $options = []): bool
|
|
||||||
{
|
|
||||||
$count = $this->tags()->count();
|
|
||||||
$this->tag_count = $count;
|
|
||||||
|
|
||||||
return parent::save($options);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
@@ -339,18 +324,6 @@ class TransactionJournal extends Model
|
|||||||
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00'));
|
return $query->where('transaction_journals.date', '<=', $date->format('Y-m-d 00:00:00'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @codeCoverageIgnore
|
|
||||||
*
|
|
||||||
* @param EloquentBuilder $query
|
|
||||||
*/
|
|
||||||
public function scopeSortCorrectly(EloquentBuilder $query)
|
|
||||||
{
|
|
||||||
$query->orderBy('transaction_journals.date', 'DESC');
|
|
||||||
$query->orderBy('transaction_journals.order', 'ASC');
|
|
||||||
$query->orderBy('transaction_journals.id', 'DESC');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*
|
*
|
||||||
@@ -380,6 +353,8 @@ class TransactionJournal extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param $value
|
* @param $value
|
||||||
*
|
*
|
||||||
|
@@ -118,7 +118,7 @@ trait TransactionJournalTrait
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* @deprecated
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -126,6 +126,7 @@ trait TransactionJournalTrait
|
|||||||
abstract public function getMeta(string $name);
|
abstract public function getMeta(string $name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
abstract public function isDeposit(): bool;
|
abstract public function isDeposit(): bool;
|
||||||
|
Reference in New Issue
Block a user