Skip to content

Firefly III: a personal finances manager

🤖 Auto commit for release 'develop' on 2026-03-16

JC575261a46d9cb
diff --git a/app/Api/V1/Controllers/Summary/BasicController.php b/app/Api/V1/Controllers/Summary/BasicController.php
index 23bcb8621f..a557f35188 100644
--- a/app/Api/V1/Controllers/Summary/BasicController.php
+++ b/app/Api/V1/Controllers/Summary/BasicController.php
@@ -323,7 +323,7 @@ final class BasicController extends Controller
$today = today(config('app.timezone'));
$available = $this->abRepository->getAvailableBudgetWithCurrency($start, $end);
$budgets = $this->budgetRepository->getActiveBudgets();
- $spent = $this->opsRepository->sumExpenses($start, $end, null, $budgets,null, true);
+ $spent = $this->opsRepository->sumExpenses($start, $end, null, $budgets, null, true);
$days = (int) $today->diffInDays($end, true) + 1;
$currencies = [];
@@ -440,6 +440,7 @@ final class BasicController extends Controller
// ),
// ];
}
+
return array_values($return);
}
diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php
index ed30548fb3..9efffe7fb8 100644
--- a/app/Helpers/Collector/Extensions/MetaCollection.php
+++ b/app/Helpers/Collector/Extensions/MetaCollection.php
@@ -955,8 +955,8 @@ trait MetaCollection
$this->fields[] = 'tags.tag as tag_name';
$this->fields[] = 'tags.date as tag_date';
$this->fields[] = 'tags.description as tag_description';
-// $this->fields[] = 'tags.latitude as tag_latitude';
-// $this->fields[] = 'tags.longitude as tag_longitude';
+ // $this->fields[] = 'tags.latitude as tag_latitude';
+ // $this->fields[] = 'tags.longitude as tag_longitude';
// $this->fields[] = 'tags.zoomLevel as tag_zoom_level';
$this->joinTagTables();
diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php
index ace92246c7..cd25e11202 100644
--- a/app/Http/Controllers/Transaction/EditController.php
+++ b/app/Http/Controllers/Transaction/EditController.php
@@ -115,7 +115,8 @@ final class EditController extends Controller
];
$optionalFields['external_url'] ??= false;
$optionalFields['location'] ??= false;
- $optionalFields['location'] = true === $optionalFields['location'] && true === FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
+ $optionalFields['location'] = true === $optionalFields['location']
+ && true === FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
// map info voor v2:
$longitude = config('firefly.default_location.longitude');
diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php
index 8305626201..3db5576b2e 100644
--- a/app/Repositories/Bill/BillRepository.php
+++ b/app/Repositories/Bill/BillRepository.php
@@ -640,8 +640,8 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
foreach ($bills as $bill) {
// Log::debug(sprintf('Bill #%d ("%s")', $bill->id, $bill->name));
/** @var Collection $set */
- $set = $bill->transactionJournals()->after($start)->before($end)->get(['transaction_journals.*']);
- $currency = $convertToPrimary && $bill->transactionCurrency->id !== $primary->id ? $primary : $bill->transactionCurrency;
+ $set = $bill->transactionJournals()->after($start)->before($end)->get(['transaction_journals.*']);
+ $currency = $convertToPrimary && $bill->transactionCurrency->id !== $primary->id ? $primary : $bill->transactionCurrency;
$return[(int) $currency->id] ??= [
'id' => (string) $currency->id,
'name' => $currency->name,
@@ -655,8 +655,8 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
/** @var TransactionJournal $transactionJournal */
foreach ($set as $transactionJournal) {
// grab currency from journal.
- $transactionCurrency = $transactionJournal->transactionCurrency;
- $currencyId = (int) $transactionCurrency->id;
+ $transactionCurrency = $transactionJournal->transactionCurrency;
+ $currencyId = (int) $transactionCurrency->id;
$return[$currencyId] ??= [
'id' => (string) $transactionCurrency->id,
'name' => $transactionCurrency->name,
@@ -665,7 +665,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
'decimal_places' => $transactionCurrency->decimal_places,
'sum' => '0',
];
- $amountFromJournal = Amount::getAmountFromJournalObject($transactionJournal);
+ $amountFromJournal = Amount::getAmountFromJournalObject($transactionJournal);
// Log::debug(sprintf('Created a (new) array for currency #%d', $currencyId));
// Log::debug(sprintf('Amount to add is %s', $amountFromJournal));
// get currency from transaction as well.
diff --git a/app/Support/Amount.php b/app/Support/Amount.php
index 94a8093610..f1b732d852 100644
--- a/app/Support/Amount.php
+++ b/app/Support/Amount.php
@@ -241,8 +241,10 @@ class Amount
if ((int) $sourceTransaction->foreign_currency_id === $currency->id) {
// use foreign amount instead!
$amount = (string) $sourceTransaction->foreign_amount; // hard coded to be foreign amount.
+
// Log::debug(sprintf('Amount is now %s', $amount));
}
+
// Log::debug(sprintf('Final return is %s', $amount));
return $amount;
}
diff --git a/app/Support/Export/ExportDataGenerator.php b/app/Support/Export/ExportDataGenerator.php
index 24d46ce87b..580cb8f2eb 100644
--- a/app/Support/Export/ExportDataGenerator.php
+++ b/app/Support/Export/ExportDataGenerator.php
@@ -76,18 +76,18 @@ class ExportDataGenerator
private const string EXPORT_ERR = 'Could not export to string: %s';
private Collection $accounts;
- private Carbon $end;
- private bool $exportAccounts = false;
- private bool $exportBills = false;
- private bool $exportBudgets = false;
- private bool $exportCategories = false;
- private bool $exportPiggies = false;
- private bool $exportRecurring = false;
- private bool $exportRules = false;
- private bool $exportTags = false;
- private bool $exportTransactions = false;
- private Carbon $start;
- private User $user;
+ private Carbon $end;
+ private bool $exportAccounts = false;
+ private bool $exportBills = false;
+ private bool $exportBudgets = false;
+ private bool $exportCategories = false;
+ private bool $exportPiggies = false;
+ private bool $exportRecurring = false;
+ private bool $exportRules = false;
+ private bool $exportTags = false;
+ private bool $exportTransactions = false;
+ private Carbon $start;
+ private User $user;
// private UserGroup $userGroup;
@@ -96,7 +96,7 @@ class ExportDataGenerator
$this->accounts = new Collection();
$this->start = today(config('app.timezone'));
$this->start->subYear();
- $this->end = today(config('app.timezone'));
+ $this->end = today(config('app.timezone'));
}
/**
@@ -233,7 +233,7 @@ class ExportDataGenerator
*/
private function exportAccounts(): string
{
- $header = [
+ $header = [
'user_id',
'account_id',
'created_at',
@@ -254,7 +254,7 @@ class ExportDataGenerator
];
/** @var AccountRepositoryInterface $repository */
- $repository = app(AccountRepositoryInterface::class);
+ $repository = app(AccountRepositoryInterface::class);
$repository->setUser($this->user);
$allAccounts = $repository->getAccountsByType([]);
$records = [];
@@ -284,7 +284,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -317,8 +317,8 @@ class ExportDataGenerator
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->setUser($this->user);
- $bills = $repository->getBills();
- $header = [
+ $bills = $repository->getBills();
+ $header = [
'user_id',
'bill_id',
'created_at',
@@ -332,7 +332,7 @@ class ExportDataGenerator
'skip',
'active',
];
- $records = [];
+ $records = [];
/** @var Bill $bill */
foreach ($bills as $bill) {
@@ -353,7 +353,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -383,13 +383,13 @@ class ExportDataGenerator
*/
private function exportBudgets(): string
{
- $header = ['user_id', 'budget_id', 'name', 'active', 'order', 'start_date', 'end_date', 'currency_code', 'amount'];
+ $header = ['user_id', 'budget_id', 'name', 'active', 'order', 'start_date', 'end_date', 'currency_code', 'amount'];
$budgetRepos = app(BudgetRepositoryInterface::class);
$budgetRepos->setUser($this->user);
- $limitRepos = app(BudgetLimitRepositoryInterface::class);
- $budgets = $budgetRepos->getBudgets();
- $records = [];
+ $limitRepos = app(BudgetLimitRepositoryInterface::class);
+ $budgets = $budgetRepos->getBudgets();
+ $records = [];
/** @var Budget $budget */
foreach ($budgets as $budget) {
@@ -412,7 +412,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -442,10 +442,10 @@ class ExportDataGenerator
*/
private function exportCategories(): string
{
- $header = ['user_id', 'category_id', 'created_at', 'updated_at', 'name'];
+ $header = ['user_id', 'category_id', 'created_at', 'updated_at', 'name'];
/** @var CategoryRepositoryInterface $catRepos */
- $catRepos = app(CategoryRepositoryInterface::class);
+ $catRepos = app(CategoryRepositoryInterface::class);
$catRepos->setUser($this->user);
$records = [];
@@ -457,7 +457,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -488,14 +488,14 @@ class ExportDataGenerator
private function exportPiggies(): string
{
/** @var PiggyBankRepositoryInterface $piggyRepos */
- $piggyRepos = app(PiggyBankRepositoryInterface::class);
+ $piggyRepos = app(PiggyBankRepositoryInterface::class);
$piggyRepos->setUser($this->user);
/** @var AccountRepositoryInterface $accountRepos */
$accountRepos = app(AccountRepositoryInterface::class);
$accountRepos->setUser($this->user);
- $header = [
+ $header = [
'user_id',
'piggy_bank_id',
'created_at',
@@ -511,8 +511,8 @@ class ExportDataGenerator
'order',
'active',
];
- $records = [];
- $piggies = $piggyRepos->getPiggyBanks();
+ $records = [];
+ $piggies = $piggyRepos->getPiggyBanks();
/** @var PiggyBank $piggy */
foreach ($piggies as $piggy) {
@@ -537,7 +537,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -570,7 +570,7 @@ class ExportDataGenerator
/** @var RecurringRepositoryInterface $recurringRepos */
$recurringRepos = app(RecurringRepositoryInterface::class);
$recurringRepos->setUser($this->user);
- $header = [
+ $header = [
// recurrence:
'user_id',
'recurrence_id',
@@ -606,8 +606,8 @@ class ExportDataGenerator
'piggy_bank',
'tags',
];
- $records = [];
- $recurrences = $recurringRepos->get();
+ $records = [];
+ $recurrences = $recurringRepos->get();
/** @var Recurrence $recurrence */
foreach ($recurrences as $recurrence) {
@@ -664,7 +664,7 @@ class ExportDataGenerator
$piggyBankId = $recurringRepos->getPiggyBank($transaction);
$tags = $recurringRepos->getTags($transaction);
- $records[] = [
+ $records[] = [
// recurrence
$this->user->id,
$recurrence->id,
@@ -704,7 +704,7 @@ class ExportDataGenerator
}
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -760,8 +760,8 @@ class ExportDataGenerator
];
$ruleRepos = app(RuleRepositoryInterface::class);
$ruleRepos->setUser($this->user);
- $rules = $ruleRepos->getAll();
- $records = [];
+ $rules = $ruleRepos->getAll();
+ $records = [];
/** @var Rule $rule */
foreach ($rules as $rule) {
@@ -851,7 +851,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -883,12 +883,12 @@ class ExportDataGenerator
*/
private function exportTags(): string
{
- $header = ['user_id', 'tag_id', 'created_at', 'updated_at', 'tag', 'date', 'description', ]; // 'latitude', 'longitude', 'zoom_level'
+ $header = ['user_id', 'tag_id', 'created_at', 'updated_at', 'tag', 'date', 'description']; // 'latitude', 'longitude', 'zoom_level'
$tagRepos = app(TagRepositoryInterface::class);
$tagRepos->setUser($this->user);
- $tags = $tagRepos->get();
- $records = [];
+ $tags = $tagRepos->get();
+ $records = [];
/** @var Tag $tag */
foreach ($tags as $tag) {
@@ -900,14 +900,14 @@ class ExportDataGenerator
$tag->tag,
$tag->date?->format('Y-m-d'),
$tag->description,
-// $tag->latitude,
-// $tag->longitude,
-// $tag->zoomLevel,
+ // $tag->latitude,
+ // $tag->longitude,
+ // $tag->zoomLevel,
];
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
@@ -939,7 +939,7 @@ class ExportDataGenerator
{
Log::debug('Will now export transactions.');
// TODO better place for keys?
- $header = [
+ $header = [
'user_id',
'group_id',
'journal_id',
@@ -974,7 +974,7 @@ class ExportDataGenerator
$header = array_merge($header, $metaFields);
$primary = Amount::getPrimaryCurrency();
- $collector = app(GroupCollectorInterface::class);
+ $collector = app(GroupCollectorInterface::class);
$collector->setUser($this->user);
$collector
->setRange($this->start, $this->end)
@@ -983,18 +983,19 @@ class ExportDataGenerator
->withBillInformation()
->withBudgetInformation()
->withTagInformation()
- ->withNotes();
+ ->withNotes()
+ ;
if (0 !== $this->accounts->count()) {
$collector->setAccounts($this->accounts);
}
- $journals = $collector->getExtractedJournals();
+ $journals = $collector->getExtractedJournals();
// get repository for meta data:
$repository = app(TransactionGroupRepositoryInterface::class);
$repository->setUser($this->user);
- $records = [];
+ $records = [];
/** @var array $journal */
foreach ($journals as $journal) {
@@ -1034,7 +1035,7 @@ class ExportDataGenerator
: Steam::bcround(Steam::negative($journal['pc_foreign_amount']), $primary->decimal_places);
}
- $records[] = [
+ $records[] = [
$journal['user_id'],
$journal['transaction_group_id'],
$journal['transaction_journal_id'],
@@ -1102,7 +1103,7 @@ class ExportDataGenerator
}
// load the CSV document from a string
- $csv = Writer::fromString();
+ $csv = Writer::fromString();
// insert the header
try {
diff --git a/changelog.md b/changelog.md
index 15ddb9f5b1..feedd9c40e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -25,8 +25,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
-- #11964
-- #11966
+- [Issue 11964](https://github.com/firefly-iii/firefly-iii/issues/11964) ("Left to spend" is not taking into account non-main currency withdrawals (when displaying in primary currency)) reported by @absdjfh
+- [Issue 11966](https://github.com/firefly-iii/firefly-iii/issues/11966) (Error when trying to export data in CSV (Export data via front end)) reported by @jgmm81
### Security
diff --git a/composer.lock b/composer.lock
index dce149fd60..e79749bc05 100644
--- a/composer.lock
+++ b/composer.lock
@@ -11430,11 +11430,11 @@
},
{
"name": "phpstan/phpstan",
- "version": "2.1.40",
+ "version": "2.1.41",
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b",
- "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2eae8f20856b3afe74bf1f9726ce8c11438e300",
+ "reference": "a2eae8f20856b3afe74bf1f9726ce8c11438e300",
"shasum": ""
},
"require": {
@@ -11479,7 +11479,7 @@
"type": "github"
}
],
- "time": "2026-02-23T15:04:35+00:00"
+ "time": "2026-03-16T18:24:10+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
@@ -12036,21 +12036,21 @@
},
{
"name": "rector/rector",
- "version": "2.3.8",
+ "version": "2.3.9",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
- "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c"
+ "reference": "917842143fd9f5331a2adefc214b8d7143bd32c4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/rectorphp/rector/zipball/bbd37aedd8df749916cffa2a947cfc4714d1ba2c",
- "reference": "bbd37aedd8df749916cffa2a947cfc4714d1ba2c",
+ "url": "https://api.github.com/repos/rectorphp/rector/zipball/917842143fd9f5331a2adefc214b8d7143bd32c4",
+ "reference": "917842143fd9f5331a2adefc214b8d7143bd32c4",
"shasum": ""
},
"require": {
"php": "^7.4|^8.0",
- "phpstan/phpstan": "^2.1.38"
+ "phpstan/phpstan": "^2.1.40"
},
"conflict": {
"rector/rector-doctrine": "*",
@@ -12084,7 +12084,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
- "source": "https://github.com/rectorphp/rector/tree/2.3.8"
+ "source": "https://github.com/rectorphp/rector/tree/2.3.9"
},
"funding": [
{
@@ -12092,7 +12092,7 @@
"type": "github"
}
],
- "time": "2026-02-22T09:45:50+00:00"
+ "time": "2026-03-16T09:43:55+00:00"
},
{
"name": "sebastian/cli-parser",
diff --git a/config/firefly.php b/config/firefly.php
index 450ab97b61..bec9be0dc5 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -79,7 +79,7 @@ return [
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-03-16',
- 'build_time' => 1773633747,
+ 'build_time' => 1773691523,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.
diff --git a/package-lock.json b/package-lock.json
index df4cadf5d0..e1269ec585 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -11004,9 +11004,9 @@
}
},
"node_modules/terser": {
- "version": "5.46.0",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.0.tgz",
- "integrity": "sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg==",
+ "version": "5.46.1",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.46.1.tgz",
+ "integrity": "sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {