Skip to content

Firefly III: a personal finances manager

Add subscriptions, over bills.

James Cole5e6e932e7e12
diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php
index 331420344c..6abe4a2307 100644
--- a/app/Console/Commands/Export/ExportsData.php
+++ b/app/Console/Commands/Export/ExportsData.php
@@ -57,7 +57,7 @@ class ExportsData extends Command
{--export-tags : Create a file with all your tags and some meta data.}
{--export-recurring : Create a file with all your recurring transactions and some meta data.}
{--export-rules : Create a file with all your rules and some meta data.}
- {--export-bills : Create a file with all your bills and some meta data.}
+ {--export-subscriptions : Create a file with all your subscriptions and some meta data.}
{--export-piggies : Create a file with all your piggy banks and some meta data.}
{--force : Force overwriting of previous exports if found.}';
private AccountRepositoryInterface $accountRepository;
@@ -106,7 +106,7 @@ class ExportsData extends Command
$exporter->setExportTags($options['export']['tags']);
$exporter->setExportRecurring($options['export']['recurring']);
$exporter->setExportRules($options['export']['rules']);
- $exporter->setExportBills($options['export']['bills']);
+ $exporter->setExportBills($options['export']['subscriptions']);
$exporter->setExportPiggies($options['export']['piggies']);
$data = $exporter->export();
if (0 === count($data)) {
@@ -157,7 +157,7 @@ class ExportsData extends Command
'tags' => $this->option('export-tags'),
'recurring' => $this->option('export-recurring'),
'rules' => $this->option('export-rules'),
- 'bills' => $this->option('export-bills'),
+ 'bills' => $this->option('export-subscriptions'),
'piggies' => $this->option('export-piggies'),
],
'start' => $start,
diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php
index 0e3f084934..e3889993fc 100644
--- a/app/Http/Controllers/Chart/AccountController.php
+++ b/app/Http/Controllers/Chart/AccountController.php
@@ -139,7 +139,7 @@ class AccountController extends Controller
}
// Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance));
$searchCode = $this->convertToNative ? $this->defaultCurrency->code : $key;
- $searchCode = 3 !== strlen($searchCode) ? $this->defaultCurrency->code : $searchCode;
+ $searchCode = 'balance' === $searchCode || 'native_balance' === $searchCode ? $this->defaultCurrency->code : $searchCode;
// Log::debug(sprintf('Search code is %s', $searchCode));
// see if there is an accompanying start amount.
// grab the difference and find the currency.
@@ -603,7 +603,7 @@ class AccountController extends Controller
}
// Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance));
$searchCode = $this->convertToNative ? $this->defaultCurrency->code : $key;
- $searchCode = 3 !== strlen($searchCode) ? $this->defaultCurrency->code : $searchCode;
+ $searchCode = 'balance' === $searchCode || 'native_balance' === $searchCode ? $this->defaultCurrency->code : $searchCode;
// Log::debug(sprintf('Search code is %s', $searchCode));
// see if there is an accompanying start amount.
// grab the difference and find the currency.
diff --git a/config/search.php b/config/search.php
index 770e167b2f..d8678733ff 100644
--- a/config/search.php
+++ b/config/search.php
@@ -110,6 +110,11 @@ return [
'bill' => ['alias' => true, 'alias_for' => 'bill_contains', 'needs_context' => true],
'bill_ends' => ['alias' => false, 'needs_context' => true],
'bill_starts' => ['alias' => false, 'needs_context' => true],
+ 'subscription_is' => ['alias' => true, 'alias_for' => 'bill_is', 'needs_context' => true],
+ 'subscription_contains' => ['alias' => true, 'alias_for' => 'bill_contains', 'needs_context' => true],
+ 'subscription' => ['alias' => true, 'alias_for' => 'bill_contains', 'needs_context' => true],
+ 'subscription_ends' => ['alias' => true, 'alias_for' => 'bill_ends', 'needs_context' => true],
+ 'subscription_starts' => ['alias' => true, 'alias_for' => 'bill_starts', 'needs_context' => true],
'external_id_is' => ['alias' => false, 'needs_context' => true],
'external_id_contains' => ['alias' => false, 'needs_context' => true],
'external_id' => ['alias' => true, 'alias_for' => 'external_id_contains', 'needs_context' => true],