mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code reordering and reformatting. I should really start employing style CI.
This commit is contained in:
@@ -35,31 +35,6 @@ use Log;
|
||||
trait LiabilityValidation
|
||||
{
|
||||
|
||||
/**
|
||||
* Source of an liability credit must be a liability.
|
||||
*
|
||||
* @param string|null $accountName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validateLCSource(?string $accountName): bool
|
||||
{
|
||||
$result = true;
|
||||
Log::debug(sprintf('Now in validateLCDestination("%s")', $accountName));
|
||||
if ('' === $accountName || null === $accountName) {
|
||||
$result = false;
|
||||
}
|
||||
if (true === $result) {
|
||||
// set the source to be a (dummy) revenue account.
|
||||
$account = new Account;
|
||||
$accountType = AccountType::whereType(AccountType::LIABILITY_CREDIT)->first();
|
||||
$account->accountType = $accountType;
|
||||
$this->source = $account;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|null $accountId
|
||||
*
|
||||
@@ -96,4 +71,29 @@ trait LiabilityValidation
|
||||
return $result ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source of an liability credit must be a liability.
|
||||
*
|
||||
* @param string|null $accountName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validateLCSource(?string $accountName): bool
|
||||
{
|
||||
$result = true;
|
||||
Log::debug(sprintf('Now in validateLCDestination("%s")', $accountName));
|
||||
if ('' === $accountName || null === $accountName) {
|
||||
$result = false;
|
||||
}
|
||||
if (true === $result) {
|
||||
// set the source to be a (dummy) revenue account.
|
||||
$account = new Account;
|
||||
$accountType = AccountType::whereType(AccountType::LIABILITY_CREDIT)->first();
|
||||
$account->accountType = $accountType;
|
||||
$this->source = $account;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user