mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-03-17 10:59:52 +00:00
Compare commits
11 Commits
main
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
859fea532d | ||
|
|
75261a46d9 | ||
|
|
a4a99310ea | ||
|
|
8de0844e55 | ||
|
|
e7a6dd792f | ||
|
|
395ccf8f75 | ||
|
|
dfbfdb6aa2 | ||
|
|
a367ee96bd | ||
|
|
b6b1261df5 | ||
|
|
52b611d7b3 | ||
|
|
bbc96f457b |
@@ -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);
|
||||
$spent = $this->opsRepository->sumExpenses($start, $end, null, $budgets, null, true);
|
||||
$days = (int) $today->diffInDays($end, true) + 1;
|
||||
$currencies = [];
|
||||
|
||||
|
||||
@@ -955,9 +955,9 @@ 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.zoomLevel as tag_zoom_level';
|
||||
// $this->fields[] = 'tags.latitude as tag_latitude';
|
||||
// $this->fields[] = 'tags.longitude as tag_longitude';
|
||||
// $this->fields[] = 'tags.zoomLevel as tag_zoom_level';
|
||||
|
||||
$this->joinTagTables();
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ final class EditController extends Controller
|
||||
];
|
||||
$optionalFields['external_url'] ??= false;
|
||||
$optionalFields['location'] ??= false;
|
||||
$optionalFields['location'] = $optionalFields['location']
|
||||
$optionalFields['location'] = true === $optionalFields['location']
|
||||
&& true === FireflyConfig::get('enable_external_map', config('firefly.enable_external_map'))->data;
|
||||
|
||||
// map info voor v2:
|
||||
|
||||
@@ -638,9 +638,10 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
|
||||
/** @var Bill $bill */
|
||||
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,
|
||||
@@ -649,13 +650,14 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
'decimal_places' => $currency->decimal_places,
|
||||
'sum' => '0',
|
||||
];
|
||||
$setAmount = '0';
|
||||
// Log::debug(sprintf('Created a new array for currency #%d', $currency->id));
|
||||
|
||||
/** @var TransactionJournal $transactionJournal */
|
||||
foreach ($set as $transactionJournal) {
|
||||
// grab currency from transaction.
|
||||
$transactionCurrency = $transactionJournal->transactionCurrency;
|
||||
$return[(int) $transactionCurrency->id] ??= [
|
||||
// grab currency from journal.
|
||||
$transactionCurrency = $transactionJournal->transactionCurrency;
|
||||
$currencyId = (int) $transactionCurrency->id;
|
||||
$return[$currencyId] ??= [
|
||||
'id' => (string) $transactionCurrency->id,
|
||||
'name' => $transactionCurrency->name,
|
||||
'symbol' => $transactionCurrency->symbol,
|
||||
@@ -663,19 +665,12 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
'decimal_places' => $transactionCurrency->decimal_places,
|
||||
'sum' => '0',
|
||||
];
|
||||
|
||||
$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.
|
||||
$return[(int) $transactionCurrency->id]['sum'] = bcadd(
|
||||
$return[(int) $transactionCurrency->id]['sum'],
|
||||
Amount::getAmountFromJournalObject($transactionJournal)
|
||||
);
|
||||
|
||||
// $setAmount = bcadd($setAmount, Amount::getAmountFromJournalObject($transactionJournal));
|
||||
$return[$currencyId]['sum'] = bcadd($return[$currencyId]['sum'], $amountFromJournal);
|
||||
}
|
||||
|
||||
// Log::debug(sprintf('Bill #%d ("%s") with %d transaction(s) and sum %s %s', $bill->id, $bill->name, $set->count(), $currency->code, $setAmount));
|
||||
// $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $setAmount);
|
||||
// Log::debug(sprintf('Total sum is now %s', $return[$currency->id]['sum']));
|
||||
}
|
||||
// remove empty sets
|
||||
$final = [];
|
||||
|
||||
@@ -225,21 +225,27 @@ class Amount
|
||||
*/
|
||||
public function getAmountFromJournalObject(TransactionJournal $journal): string
|
||||
{
|
||||
// Log::debug(sprintf('Get amount from journal #%d', $journal->id));
|
||||
$convertToPrimary = $this->convertToPrimary();
|
||||
$currency = $this->getPrimaryCurrency();
|
||||
$field = $convertToPrimary && $currency->id !== $journal->transaction_currency_id ? 'pc_amount' : 'amount';
|
||||
$field = $convertToPrimary && $currency->id !== $journal->transaction_currency_id ? 'native_amount' : 'amount';
|
||||
|
||||
/** @var null|Transaction $sourceTransaction */
|
||||
$sourceTransaction = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
if (null === $sourceTransaction) {
|
||||
// Log::debug('Return zero!');
|
||||
return '0';
|
||||
}
|
||||
$amount = $sourceTransaction->{$field} ?? '0';
|
||||
// Log::debug(sprintf('Amount is %s', $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;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Csv\AbstractCsv;
|
||||
use League\Csv\CannotInsertRecord;
|
||||
use League\Csv\Exception;
|
||||
use League\Csv\Writer;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
@@ -284,7 +284,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -353,7 +353,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -412,7 +412,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -457,7 +457,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -537,7 +537,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -704,7 +704,7 @@ class ExportDataGenerator
|
||||
}
|
||||
}
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -851,7 +851,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -883,7 +883,7 @@ 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);
|
||||
@@ -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 = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
@@ -1103,7 +1103,7 @@ class ExportDataGenerator
|
||||
}
|
||||
|
||||
// load the CSV document from a string
|
||||
$csv = AbstractCsv::fromString();
|
||||
$csv = Writer::fromString();
|
||||
|
||||
// insert the header
|
||||
try {
|
||||
|
||||
33
changelog.md
33
changelog.md
@@ -3,6 +3,39 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v6.5.7 - 2026-03-xx
|
||||
|
||||
<!-- summary: If you can read this I forgot to update the summary! -->
|
||||
|
||||
### Added
|
||||
|
||||
- Initial release.
|
||||
|
||||
### Changed
|
||||
|
||||
- Initial release.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- Initial release.
|
||||
|
||||
### Removed
|
||||
|
||||
- Initial release.
|
||||
|
||||
### Fixed
|
||||
|
||||
- [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
|
||||
|
||||
- Initial release.
|
||||
|
||||
### API
|
||||
|
||||
- Initial release.
|
||||
|
||||
## v6.5.6 - 2026-03-16
|
||||
|
||||
<!-- summary: This release takes note of some security issues, and fixes interesting bugs. -->
|
||||
|
||||
60
composer.lock
generated
60
composer.lock
generated
@@ -8,16 +8,16 @@
|
||||
"packages": [
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
"version": "v3.0.3",
|
||||
"version": "v3.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Bacon/BaconQrCode.git",
|
||||
"reference": "36a1cb2b81493fa5b82e50bf8068bf84d1542563"
|
||||
"reference": "3feed0e212b8412cc5d2612706744789b0615824"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/36a1cb2b81493fa5b82e50bf8068bf84d1542563",
|
||||
"reference": "36a1cb2b81493fa5b82e50bf8068bf84d1542563",
|
||||
"url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/3feed0e212b8412cc5d2612706744789b0615824",
|
||||
"reference": "3feed0e212b8412cc5d2612706744789b0615824",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -57,9 +57,9 @@
|
||||
"homepage": "https://github.com/Bacon/BaconQrCode",
|
||||
"support": {
|
||||
"issues": "https://github.com/Bacon/BaconQrCode/issues",
|
||||
"source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.3"
|
||||
"source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.4"
|
||||
},
|
||||
"time": "2025-11-19T17:15:36+00:00"
|
||||
"time": "2026-03-16T01:01:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "beberlei/assert",
|
||||
@@ -3242,20 +3242,20 @@
|
||||
},
|
||||
{
|
||||
"name": "league/uri",
|
||||
"version": "7.8.0",
|
||||
"version": "7.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/uri.git",
|
||||
"reference": "4436c6ec8d458e4244448b069cc572d088230b76"
|
||||
"reference": "08cf38e3924d4f56238125547b5720496fac8fd4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri/zipball/4436c6ec8d458e4244448b069cc572d088230b76",
|
||||
"reference": "4436c6ec8d458e4244448b069cc572d088230b76",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4",
|
||||
"reference": "08cf38e3924d4f56238125547b5720496fac8fd4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/uri-interfaces": "^7.8",
|
||||
"league/uri-interfaces": "^7.8.1",
|
||||
"php": "^8.1",
|
||||
"psr/http-factory": "^1"
|
||||
},
|
||||
@@ -3328,7 +3328,7 @@
|
||||
"docs": "https://uri.thephpleague.com",
|
||||
"forum": "https://thephpleague.slack.com",
|
||||
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||
"source": "https://github.com/thephpleague/uri/tree/7.8.0"
|
||||
"source": "https://github.com/thephpleague/uri/tree/7.8.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3336,20 +3336,20 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-14T17:24:56+00:00"
|
||||
"time": "2026-03-15T20:22:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/uri-interfaces",
|
||||
"version": "7.8.0",
|
||||
"version": "7.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/uri-interfaces.git",
|
||||
"reference": "c5c5cd056110fc8afaba29fa6b72a43ced42acd4"
|
||||
"reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/c5c5cd056110fc8afaba29fa6b72a43ced42acd4",
|
||||
"reference": "c5c5cd056110fc8afaba29fa6b72a43ced42acd4",
|
||||
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928",
|
||||
"reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3412,7 +3412,7 @@
|
||||
"docs": "https://uri.thephpleague.com",
|
||||
"forum": "https://thephpleague.slack.com",
|
||||
"issues": "https://github.com/thephpleague/uri-src/issues",
|
||||
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.0"
|
||||
"source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3420,7 +3420,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-15T06:54:53+00:00"
|
||||
"time": "2026-03-08T20:05:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mailersend/laravel-driver",
|
||||
@@ -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",
|
||||
|
||||
@@ -78,8 +78,8 @@ return [
|
||||
'running_balance_column' => (bool)envDefaultWhenEmpty(env('USE_RUNNING_BALANCE'), true), // this is only the default value, is not used.
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => '6.5.6',
|
||||
'build_time' => 1773592406,
|
||||
'version' => 'develop/2026-03-16',
|
||||
'build_time' => 1773691523,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 28, // field is no longer used.
|
||||
|
||||
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user