Remove ability to see balance.

This commit is contained in:
James Cole
2020-07-28 06:31:56 +02:00
parent ff9d8865d1
commit 012420c47d
2 changed files with 8 additions and 28 deletions

View File

@@ -47,7 +47,7 @@ class Steam
*
* @return string
*/
public function balance(Account $account, Carbon $date = null, ?TransactionCurrency $currency = null): string
public function balance(Account $account, Carbon $date, ?TransactionCurrency $currency = null): string
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
@@ -60,9 +60,6 @@ class Steam
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
if (null === $date) {
$date = Carbon::now()->endOfMonth();
}
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
if (null === $currency) {
@@ -260,14 +257,12 @@ class Steam
}
/**
* Gets balance at the end of current month by default
*
* @param \FireflyIII\Models\Account $account
* @param \Carbon\Carbon $date
*
* @return array
*/
public function balancePerCurrency(Account $account, Carbon $date = null): array
public function balancePerCurrency(Account $account, Carbon $date): array
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
@@ -280,9 +275,6 @@ class Steam
if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore
}
if (null === $date) {
$date = Carbon::now()->endOfMonth();
}
$query = $account->transactions()
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->where('transaction_journals.date', '<=', $date->format('Y-m-d 23:59:59'))
@@ -299,14 +291,14 @@ class Steam
}
/**
* This method always ignores the virtual balance. Gets balance at the end of current month by default
* This method always ignores the virtual balance.
*
* @param \Illuminate\Support\Collection $accounts
* @param \Carbon\Carbon $date
*
* @return array
*/
public function balancesByAccounts(Collection $accounts, Carbon $date = null): array
public function balancesByAccounts(Collection $accounts, Carbon $date): array
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));
@@ -334,14 +326,14 @@ class Steam
}
/**
* Same as above, but also groups per currency. Gets balance at the end of current month by default
* Same as above, but also groups per currency.
*
* @param \Illuminate\Support\Collection $accounts
* @param \Carbon\Carbon $date
*
* @return array
*/
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date = null): array
public function balancesPerCurrencyByAccounts(Collection $accounts, Carbon $date): array
{
if ('testing' === config('app.env')) {
Log::warning(sprintf('%s should NOT be called in the TEST environment!', __METHOD__));