mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Will no longer recognise transactions of type "opening balance".
This commit is contained in:
parent
83b7c9aa32
commit
3649b595df
@ -70,7 +70,7 @@ class TransactionJournal extends Model
|
|||||||
'description' => 'required|between:1,1024',
|
'description' => 'required|between:1,1024',
|
||||||
'completed' => 'required|boolean',
|
'completed' => 'required|boolean',
|
||||||
'date' => 'required|date',
|
'date' => 'required|date',
|
||||||
'encrypted' => 'required|boolean'
|
'encrypted' => 'required|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -522,7 +522,11 @@ class TransactionJournal extends Model
|
|||||||
public static function routeBinder($value, $route)
|
public static function routeBinder($value, $route)
|
||||||
{
|
{
|
||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
$object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first();
|
$validTypes = [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER];
|
||||||
|
$object = TransactionJournal::where('transaction_journals.id', $value)
|
||||||
|
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||||
|
->whereIn('transaction_types.type', $validTypes)
|
||||||
|
->where('user_id', Auth::user()->id)->first(['transaction_journals.*']);
|
||||||
if ($object) {
|
if ($object) {
|
||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user