Update some code, add security txt file.

This commit is contained in:
James Cole
2018-03-28 19:37:59 +02:00
parent 720dcb0fe5
commit be5c44af61
34 changed files with 80 additions and 40 deletions

View File

@@ -244,6 +244,15 @@ class BoxController extends Controller
if ($currencyId !== 0) {
$accountCurrency = $currencyRepos->findNull($currencyId);
}
// if the account is a credit card, subtract the virtual balance from the balance,
// to better reflect that this is not money that is actually "yours".
$role = (string)$repository->getMetaValue($account, 'accountRole');
$virtualBalance = (string)$account->virtual_balance;
if ($role === 'ccAsset' && $virtualBalance !== '' && (float)$virtualBalance > 0) {
$balance = bcsub($balance, $virtualBalance);
}
if (!isset($netWorth[$accountCurrency->id])) {
$netWorth[$accountCurrency->id]['currency'] = $accountCurrency;
$netWorth[$accountCurrency->id]['sum'] = '0';