mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Make sure sorting doesnt break opening balance.
This commit is contained in:
@@ -162,6 +162,27 @@ trait AccountServiceTrait
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the data in the array is submitted but empty.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmptyOBData(array $data): bool
|
||||
{
|
||||
if (!isset($data['opening_balance']) && !isset($data['opening_balance_date'])) {
|
||||
// not set, so false.
|
||||
return false;
|
||||
}
|
||||
// if isset, but is empty:
|
||||
if ('' === $data['opening_balance'] && '' === $data['opening_balance_date']) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param array $data
|
||||
|
||||
Reference in New Issue
Block a user