Update meta files for new release.

This commit is contained in:
James Cole
2023-10-28 17:17:09 +02:00
parent 62458885ce
commit 78153c2aa4
39 changed files with 433 additions and 162 deletions

View File

@@ -226,16 +226,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.36.0", "version": "v3.37.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "e889301f276c6ce2c391d6aafae9a162e785b064" "reference": "d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/e889301f276c6ce2c391d6aafae9a162e785b064", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b",
"reference": "e889301f276c6ce2c391d6aafae9a162e785b064", "reference": "d5ccc3807fd496ac2b448e8e5e57aa0772f0d18b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -307,7 +307,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.36.0" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.0"
}, },
"funding": [ "funding": [
{ {
@@ -315,7 +315,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-10-27T10:12:29+00:00" "time": "2023-10-28T14:49:50+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",

View File

@@ -1,4 +1,25 @@
<?php <?php
/*
* IndexController.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Api\V2\Controllers\Model\Currency; namespace FireflyIII\Api\V2\Controllers\Model\Currency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* UpgradeCurrencyPreferences.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Console\Commands\Upgrade; namespace FireflyIII\Console\Commands\Upgrade;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* CreateController.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* DeleteController.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* EditController.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* IndexController.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency; namespace FireflyIII\Http\Controllers\TransactionCurrency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* CurrencyRepository.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Repositories\UserGroups\Currency; namespace FireflyIII\Repositories\UserGroups\Currency;

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* CurrencyRepositoryInterface.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Repositories\UserGroups\Currency; namespace FireflyIII\Repositories\UserGroups\Currency;

View File

@@ -126,25 +126,12 @@ class Amount
/** /**
* @param User $user * @param User $user
* * @deprecated use getDefaultCurrencyByUserGroup instead.
* @return TransactionCurrency * @return TransactionCurrency
*/ */
public function getDefaultCurrencyByUser(User $user): TransactionCurrency public function getDefaultCurrencyByUser(User $user): TransactionCurrency
{ {
$cache = new CacheProperties(); return $this->getDefaultCurrencyByUserGroup($user->userGroup);
$cache->addProperty('getDefaultCurrency');
$cache->addProperty($user->id);
if ($cache->has()) {
return $cache->get();
}
$default = $user->currencies()->where('user_default', true)->first();
if (null === $default) {
$default = $this->getSystemCurrency();
$user->currencies()->sync([$default->id => ['user_default' => true]]);
}
$cache->store($default);
return $default;
} }
/** /**

View File

@@ -57,11 +57,12 @@ class BillTransformer extends AbstractTransformer
*/ */
public function transform(Bill $bill): array public function transform(Bill $bill): array
{ {
$paidData = $this->paidData($bill); $paidData = $this->paidData($bill);
$payDates = $this->payDates($bill); $lastPaidDate = $this->getLastPaidDate($paidData);
$currency = $bill->transactionCurrency; $payDates = $this->payDates($bill, $lastPaidDate);
$notes = $this->repository->getNoteText($bill); $currency = $bill->transactionCurrency;
$notes = '' === $notes ? null : $notes; $notes = $this->repository->getNoteText($bill);
$notes = '' === $notes ? null : $notes;
$this->repository->setUser($bill->user); $this->repository->setUser($bill->user);
$objectGroupId = null; $objectGroupId = null;
@@ -86,8 +87,8 @@ class BillTransformer extends AbstractTransformer
$payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString(); $payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString();
} }
$nextExpectedMatch = null; $nextExpectedMatch = null;
if (null !== $paidData['next_expected_match']) { if (null !== ($payDates[0] ?? null)) {
$nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $paidData['next_expected_match'], config('app.timezone'))->toAtomString(); $nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $payDates[0], config('app.timezone'))->toAtomString();
} }
$nextExpectedMatchDiff = trans('firefly.not_expected_period'); $nextExpectedMatchDiff = trans('firefly.not_expected_period');
// converting back and forth is bad code but OK. // converting back and forth is bad code but OK.
@@ -182,31 +183,6 @@ class BillTransformer extends AbstractTransformer
$lastPaidDate = $this->lastPaidDate($set, $start); $lastPaidDate = $this->lastPaidDate($set, $start);
app('log')->debug(sprintf('Result of lastPaidDate is %s', $lastPaidDate->format('Y-m-d'))); app('log')->debug(sprintf('Result of lastPaidDate is %s', $lastPaidDate->format('Y-m-d')));
/*
* The next expected match (nextMatch) is, initially, the bill's date.
*/
$nextMatch = clone $bill->date;
/*
* Diff in months (or other period) between bill start and last paid date or $start.
*/
$steps = app('navigation')->diffInPeriods($bill->repeat_freq, $bill->skip, $start, $nextMatch);
$nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $steps);
if ($nextMatch->lt($lastPaidDate)) {
/*
* Add another period because it's before the last paid date
*/
app('log')->debug('Because the last paid date was before our next expected match, add another period.');
$nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $bill->skip);
}
if ($nextMatch->isSameDay($lastPaidDate)) {
/*
* Add another period because it's the same day as the last paid date.
*/
app('log')->debug('Because the last paid date was on the same day as our next expected match, add another day.');
$nextMatch = app('navigation')->addPeriod($nextMatch, $bill->repeat_freq, $bill->skip);
}
/* /*
* At this point the "next match" is exactly after the last time the bill was paid. * At this point the "next match" is exactly after the last time the bill was paid.
*/ */
@@ -219,11 +195,8 @@ class BillTransformer extends AbstractTransformer
]; ];
} }
app('log')->debug(sprintf('Next match: %s', $nextMatch->toIso8601String()));
return [ return [
'paid_dates' => $result, 'paid_dates' => $result
'next_expected_match' => $nextMatch->format('Y-m-d'),
]; ];
} }
@@ -253,12 +226,13 @@ class BillTransformer extends AbstractTransformer
/** /**
* @param Bill $bill * @param Bill $bill
* @param Carbon $lastPaidDate
* *
* @return array * @return array
*/ */
protected function payDates(Bill $bill): array protected function payDates(Bill $bill, ?Carbon $lastPaidDate): array
{ {
app('log')->debug(sprintf('Now in payDates() for bill #%d', $bill->id)); app('log')->debug(sprintf('Now in payDates(#%d, "%s")', $bill->id, $lastPaidDate?->format('Y-m-d')));
if (null === $this->parameters->get('start') || null === $this->parameters->get('end')) { if (null === $this->parameters->get('start') || null === $this->parameters->get('end')) {
app('log')->debug('No start or end date, give empty array.'); app('log')->debug('No start or end date, give empty array.');
@@ -303,7 +277,11 @@ class BillTransformer extends AbstractTransformer
} }
app('log')->debug(sprintf('Next expected match is %s', $nextExpectedMatch->format('Y-m-d'))); app('log')->debug(sprintf('Next expected match is %s', $nextExpectedMatch->format('Y-m-d')));
// add to set, if the date is ON or after the start parameter // add to set, if the date is ON or after the start parameter
if ($nextExpectedMatch->gte($this->parameters->get('start'))) { // AND date is after last paid date
if ($nextExpectedMatch->gte($this->parameters->get('start'))
&& (null === $lastPaidDate || $nextExpectedMatch->gt($lastPaidDate))
) {
app('log')->debug('Add date to set.');
$set->push(clone $nextExpectedMatch); $set->push(clone $nextExpectedMatch);
} }
@@ -315,7 +293,7 @@ class BillTransformer extends AbstractTransformer
$loop++; $loop++;
if ($loop > 4) { if ($loop > 12) {
break; break;
} }
} }
@@ -359,4 +337,30 @@ class BillTransformer extends AbstractTransformer
app('log')->debug(sprintf('Number of steps is %d, result is %s', $steps, $result->format('Y-m-d'))); app('log')->debug(sprintf('Number of steps is %d, result is %s', $steps, $result->format('Y-m-d')));
return $result; return $result;
} }
/**
* @param array $paidData
*
* @return Carbon|null
*/
private function getLastPaidDate(array $paidData): ?Carbon
{
app('log')->debug('getLastPaidDate()');
$return = null;
foreach ($paidData['paid_dates'] as $entry) {
if (null !== $return) {
$current = Carbon::createFromFormat('!Y-m-d', $entry['date'], config('app.timezone'));
if ($current->gt($return)) {
$return = clone $current;
}
app('log')->debug(sprintf('Last paid date is: %s', $return->format('Y-m-d')));
}
if (null === $return) {
$return = Carbon::createFromFormat('!Y-m-d', $entry['date'], config('app.timezone'));
app('log')->debug(sprintf('Last paid date is: %s', $return->format('Y-m-d')));
}
}
app('log')->debug(sprintf('Last paid date is: "%s"', $return?->format('Y-m-d')));
return $return;
}
} }

View File

@@ -358,6 +358,8 @@ class BillTransformer extends AbstractTransformer
* Given a bill and a date, this method will tell you at which moment this bill expects its next * Given a bill and a date, this method will tell you at which moment this bill expects its next
* transaction. Whether or not it is there already, is not relevant. * transaction. Whether or not it is there already, is not relevant.
* *
* TODO this method is bad compared to the v1 one.
*
* @param Bill $bill * @param Bill $bill
* @param Carbon $date * @param Carbon $date
* *

View File

@@ -3,40 +3,36 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## 6.0.28 - 2023-10-28 ## 6.0.28 - 2023-10-29
### Added ### Added
- #8076 Clone and edit button - [Issue 8076](https://github.com/firefly-iii/firefly-iii/issues/8076) Added a "Clone and edit"-button
- #7204 ability to - [Issue 7204](https://github.com/firefly-iii/firefly-iii/issues/7204) Added the ability to customize the URL protocol types Firefly III accepts
- [Issue 8098](https://github.com/firefly-iii/firefly-iii/issues/8098) More tests in the navigation class, thanks @tonicospinelli!
### Changed ### Changed
- New actions for GitHub - Refactored the Actions of GitHub
- Currencies are now linked to users, and can be enabled per user - The transaction currencies are now linked to users, and can be enabled per user
- Refactored upgrade commands - A few upgrade commands are refactored
- You can no longer edit vital parts of reconciled transactions - You can no longer edit vital parts of reconciled transactions
### Deprecated ### Deprecated
- Remove old v3 layout. - Remove old v3 layout.
### Removed
- Initial release.
### Fixed ### Fixed
- Bad math in the order of piggy banks - Bad math in the order of piggy banks
- #8084 @JoSchrader fixed an issue with a duplicate button - [Issue 8084](https://github.com/firefly-iii/firefly-iii/issues/8084) @JoSchrader fixed an issue with a duplicate button
- [Issue 8103](https://github.com/firefly-iii/firefly-iii/issues/8103) Bulk edit would not accept transaction descriptions longer than 255 characters
### Security - [Issue 8099](https://github.com/firefly-iii/firefly-iii/issues/8099) The bill index would never skip the number of periods you indicated
- [Issue 8069](https://github.com/firefly-iii/firefly-iii/issues/8069) Rule descriptions would always "1" as description. Thanks @Maxco10!
- Initial release.
### API ### API
- Initial release. - API will no longer accept changes to amount and account fields for reconciled transactions
## v6.0.27 - 2023-10-16 ## v6.0.27 - 2023-10-16

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* 2023_10_21_113213_add_currency_pivot_tables.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;

18
package-lock.json generated
View File

@@ -452,9 +452,9 @@
"dev": true "dev": true
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.5.1", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz",
"integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",
@@ -498,9 +498,9 @@
} }
}, },
"node_modules/bootstrap5-autocomplete": { "node_modules/bootstrap5-autocomplete": {
"version": "1.1.22", "version": "1.1.23",
"resolved": "https://registry.npmjs.org/bootstrap5-autocomplete/-/bootstrap5-autocomplete-1.1.22.tgz", "resolved": "https://registry.npmjs.org/bootstrap5-autocomplete/-/bootstrap5-autocomplete-1.1.23.tgz",
"integrity": "sha512-vn4/+j/MmupcfQB9dwoGFadyk3OorxZh2Eyo8YVSBiaJBcaM1u+FYl0lgOCHQWRqN3MXqM4YCebo8xiyFIW/fw==" "integrity": "sha512-jmqk7muFampKGPNzp6ABCAZWB38rfRpUyqx1vqn4Wssj88X1xODQGI+hnPAPGfePIjMLEK0Xhd1Is4kva1PUrg=="
}, },
"node_modules/braces": { "node_modules/braces": {
"version": "3.0.2", "version": "3.0.2",
@@ -932,9 +932,9 @@
} }
}, },
"node_modules/sass": { "node_modules/sass": {
"version": "1.69.4", "version": "1.69.5",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.69.4.tgz", "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz",
"integrity": "sha512-+qEreVhqAy8o++aQfCJwp0sklr2xyEzkm9Pp/Igu9wNPoe7EZEQ8X/MBvvXggI2ql607cxKg/RKOwDj6pp2XDA==", "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chokidar": ">=3.0.0 <4.0.0", "chokidar": ">=3.0.0 <4.0.0",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
{ {
"_load-translations-9a154502.js": { "_load-translations-87b32220.js": {
"file": "assets/load-translations-9a154502.js", "file": "assets/load-translations-87b32220.js",
"integrity": "sha384-itMUG9zYhmhBh14Fji0Z+b58lSGbj9NiOxl9TLL5hBuysuuj5MW45/qYEAoQnTuf" "integrity": "sha384-LUgquSUz4wVrMfbb+2ydJ62mkgPPdNzpRUho5uNkTiYfVX2htuR3SALdplVf/PkK"
}, },
"node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": { "node_modules/@fortawesome/fontawesome-free/webfonts/fa-brands-400.ttf": {
"file": "assets/fa-brands-400-003f1154.ttf", "file": "assets/fa-brands-400-003f1154.ttf",
@@ -34,22 +34,22 @@
"integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6" "integrity": "sha384-B73JAwYNSgI4rwb14zwxigHgAkg1Ms+j6+9sJoDpiL11+VW5RjQCLfIh0RVoi0h6"
}, },
"resources/assets/v2/pages/dashboard/dashboard.js": { "resources/assets/v2/pages/dashboard/dashboard.js": {
"file": "assets/dashboard-daa2fdbe.js", "file": "assets/dashboard-42661760.js",
"imports": [ "imports": [
"_load-translations-9a154502.js" "_load-translations-87b32220.js"
], ],
"isEntry": true, "isEntry": true,
"src": "resources/assets/v2/pages/dashboard/dashboard.js", "src": "resources/assets/v2/pages/dashboard/dashboard.js",
"integrity": "sha384-nf4KZ2V1EMO9ibJQVNxubCV1Mu6ZBoHiikFCS4qxGDEb8RgVOrHwiPsYz5IBAN/E" "integrity": "sha384-YDUMtay8vqXg8UEhHKPzu4HAobu10REigb/p5ljIF+hGupVods6Vc/wqxUxx0fqy"
}, },
"resources/assets/v2/pages/transactions/create.js": { "resources/assets/v2/pages/transactions/create.js": {
"file": "assets/create-baf83427.js", "file": "assets/create-1321af8a.js",
"imports": [ "imports": [
"_load-translations-9a154502.js" "_load-translations-87b32220.js"
], ],
"isEntry": true, "isEntry": true,
"src": "resources/assets/v2/pages/transactions/create.js", "src": "resources/assets/v2/pages/transactions/create.js",
"integrity": "sha384-GOua2oSQz4NG3Qzo673cdZhVsMZflu6vIgRlkZpHK4yqqbpyCoMdLOyQvWUoJpA0" "integrity": "sha384-IhP3MrZwa0yb46MNueQyisca3xFP0rXA14CDqZyFuZTj4SWixSkGcMpjxGIBz6QO"
}, },
"resources/assets/v2/sass/app.scss": { "resources/assets/v2/sass/app.scss": {
"file": "assets/app-28a195fd.css", "file": "assets/app-28a195fd.css",

View File

@@ -24,9 +24,9 @@
"expense_account": "Compte de despeses", "expense_account": "Compte de despeses",
"revenue_account": "Compte d'ingressos", "revenue_account": "Compte d'ingressos",
"budget": "Pressupost", "budget": "Pressupost",
"account_type_Asset account": "Asset account", "account_type_Asset account": "Compte d'actius",
"account_type_Expense account": "Expense account", "account_type_Expense account": "Compte de despeses",
"account_type_Revenue account": "Revenue account", "account_type_Revenue account": "Compte d'ingressos",
"account_type_Debt": "Deute", "account_type_Debt": "Deute",
"account_type_Loan": "Cr\u00e8dit", "account_type_Loan": "Cr\u00e8dit",
"account_type_Mortgage": "Hipoteca" "account_type_Mortgage": "Hipoteca"

View File

@@ -24,9 +24,9 @@
"expense_account": "Cuenta de gastos", "expense_account": "Cuenta de gastos",
"revenue_account": "Cuenta de ingresos", "revenue_account": "Cuenta de ingresos",
"budget": "Presupuesto", "budget": "Presupuesto",
"account_type_Asset account": "Asset account", "account_type_Asset account": "Cuenta de activos",
"account_type_Expense account": "Expense account", "account_type_Expense account": "Cuenta de gastos",
"account_type_Revenue account": "Revenue account", "account_type_Revenue account": "Cuenta de ingresos",
"account_type_Debt": "Deuda", "account_type_Debt": "Deuda",
"account_type_Loan": "Pr\u00e9stamo", "account_type_Loan": "Pr\u00e9stamo",
"account_type_Mortgage": "Hipoteca" "account_type_Mortgage": "Hipoteca"

View File

@@ -24,9 +24,9 @@
"expense_account": "Compte de d\u00e9penses", "expense_account": "Compte de d\u00e9penses",
"revenue_account": "Compte de recettes", "revenue_account": "Compte de recettes",
"budget": "Budget", "budget": "Budget",
"account_type_Asset account": "Asset account", "account_type_Asset account": "Compte d\u2019actif",
"account_type_Expense account": "Expense account", "account_type_Expense account": "Compte de d\u00e9penses",
"account_type_Revenue account": "Revenue account", "account_type_Revenue account": "Compte de recettes",
"account_type_Debt": "Dette", "account_type_Debt": "Dette",
"account_type_Loan": "Pr\u00eat", "account_type_Loan": "Pr\u00eat",
"account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire" "account_type_Mortgage": "Pr\u00eat hypoth\u00e9caire"

View File

@@ -9,7 +9,7 @@
"paid": "Pagati", "paid": "Pagati",
"unpaid": "Da pagare", "unpaid": "Da pagare",
"default_group_title_name_plain": "ungrouped", "default_group_title_name_plain": "ungrouped",
"subscriptions_in_group": "Subscriptions in group \"%{title}\"", "subscriptions_in_group": "Abbonamenti nel gruppo \"%{title}\"",
"subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period", "subscr_expected_x_times": "Expect to pay %{amount} %{times} times this period",
"overspent": "Speso troppo", "overspent": "Speso troppo",
"money_flowing_in": "Entrate", "money_flowing_in": "Entrate",

View File

@@ -24,9 +24,9 @@
"expense_account": "\u652f\u51fa\u53e3\u5ea7", "expense_account": "\u652f\u51fa\u53e3\u5ea7",
"revenue_account": "\u53ce\u5165\u53e3\u5ea7", "revenue_account": "\u53ce\u5165\u53e3\u5ea7",
"budget": "\u4e88\u7b97", "budget": "\u4e88\u7b97",
"account_type_Asset account": "Asset account", "account_type_Asset account": "\u8cc7\u7523\u53e3\u5ea7",
"account_type_Expense account": "Expense account", "account_type_Expense account": "\u652f\u51fa\u53e3\u5ea7",
"account_type_Revenue account": "Revenue account", "account_type_Revenue account": "\u53ce\u5165\u53e3\u5ea7",
"account_type_Debt": "\u501f\u91d1", "account_type_Debt": "\u501f\u91d1",
"account_type_Loan": "\u30ed\u30fc\u30f3", "account_type_Loan": "\u30ed\u30fc\u30f3",
"account_type_Mortgage": "\u4f4f\u5b85\u30ed\u30fc\u30f3" "account_type_Mortgage": "\u4f4f\u5b85\u30ed\u30fc\u30f3"

View File

@@ -24,9 +24,9 @@
"expense_account": "Conta de despesas", "expense_account": "Conta de despesas",
"revenue_account": "Conta de Receitas", "revenue_account": "Conta de Receitas",
"budget": "Or\u00e7amento", "budget": "Or\u00e7amento",
"account_type_Asset account": "Asset account", "account_type_Asset account": "Conta de ativos",
"account_type_Expense account": "Expense account", "account_type_Expense account": "Conta de despesas",
"account_type_Revenue account": "Revenue account", "account_type_Revenue account": "Conta de receitas",
"account_type_Debt": "D\u00edvida", "account_type_Debt": "D\u00edvida",
"account_type_Loan": "Empr\u00e9stimo", "account_type_Loan": "Empr\u00e9stimo",
"account_type_Mortgage": "Hipoteca" "account_type_Mortgage": "Hipoteca"

View File

@@ -0,0 +1,35 @@
/*
* list.js
* Copyright (c) 2022 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {api} from "../../../../boot/axios";
import format from "date-fns/format";
export default class Get {
/**
*
* @param params
* @returns {Promise<AxiosResponse<any>>}
*/
list(params) {
return api.get('/api/v2/currencies', {params: params});
}
}

View File

@@ -28,7 +28,7 @@ export default class Get {
* @param params * @param params
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
get(params) { list(params) {
return api.get('/api/v2/piggy-banks', {params: params}); return api.get('/api/v2/piggy-banks', {params: params});
} }

View File

@@ -28,7 +28,7 @@ export default class Get {
* @param params * @param params
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
get(params) { list(params) {
return api.get('/api/v2/subscriptions', {params: params}); return api.get('/api/v2/subscriptions', {params: params});
} }

View File

@@ -28,7 +28,7 @@ export default class Get {
* @param params * @param params
* @returns {Promise<AxiosResponse<any>>} * @returns {Promise<AxiosResponse<any>>}
*/ */
get(params) { list(params) {
return api.get('/api/v2/transactions', {params: params}); return api.get('/api/v2/transactions', {params: params});
} }
} }

View File

@@ -61,7 +61,7 @@ export default () => ({
const end = new Date(window.store.get('end')); const end = new Date(window.store.get('end'));
const cacheKey = getCacheKey(PIGGY_CACHE_KEY, start, end); const cacheKey = getCacheKey(PIGGY_CACHE_KEY, start, end);
const getter = new Get(); const getter = new Get();
getter.get(params).then((response) => { getter.list(params).then((response) => {
apiData = [...apiData, ...response.data.data]; apiData = [...apiData, ...response.data.data];
if (parseInt(response.data.meta.pagination.total_pages) > params.page) { if (parseInt(response.data.meta.pagination.total_pages) > params.page) {
params.page++; params.page++;

View File

@@ -318,7 +318,7 @@ export default () => ({
//console.log('Downloading page ' + params.page + '...'); //console.log('Downloading page ' + params.page + '...');
const getter = new Get(); const getter = new Get();
getter.get(params).then((response) => { getter.list(params).then((response) => {
transactions = [...transactions, ...response.data.data]; transactions = [...transactions, ...response.data.data];
//this.drawChart(this.generateOptions(response.data)); //this.drawChart(this.generateOptions(response.data));
//this.loading = false; //this.loading = false;

View File

@@ -36,7 +36,7 @@ let subscriptionData = {};
function downloadSubscriptions(params) { function downloadSubscriptions(params) {
const getter = new Get(); const getter = new Get();
return getter.get(params) return getter.list(params)
// first promise: parse the data: // first promise: parse the data:
.then((response) => { .then((response) => {
let data = response.data.data; let data = response.data.data;

View File

@@ -25,6 +25,7 @@ import {parseFromEntries} from "./shared/parse-from-entries.js";
import formatMoney from "../../util/format-money.js"; import formatMoney from "../../util/format-money.js";
import Autocomplete from "bootstrap5-autocomplete"; import Autocomplete from "bootstrap5-autocomplete";
import Post from "../../api/v2/model/transaction/post.js"; import Post from "../../api/v2/model/transaction/post.js";
import Get from "../../api/v2/model/currency/get.js";
import {getVariable} from "../../store/get-variable.js"; import {getVariable} from "../../store/get-variable.js";
import {I18n} from "i18n-js"; import {I18n} from "i18n-js";
import {loadTranslations} from "../../support/load-translations.js"; import {loadTranslations} from "../../support/load-translations.js";
@@ -45,6 +46,7 @@ let transactions = function () {
showErrorMessage: false, showErrorMessage: false,
entries: [], entries: [],
loadingCurrencies: true, loadingCurrencies: true,
defaultCurrency: {},
enabledCurrencies: [], enabledCurrencies: [],
nativeCurrencies: [], nativeCurrencies: [],
foreignCurrencies: [], foreignCurrencies: [],
@@ -52,6 +54,7 @@ let transactions = function () {
source: [], source: [],
destination: [], destination: [],
}, },
errorMessageText: '',
detectTransactionType() { detectTransactionType() {
const sourceType = this.entries[0].source_account.type ?? 'unknown'; const sourceType = this.entries[0].source_account.type ?? 'unknown';
const destType = this.entries[0].destination_account.type ?? 'unknown'; const destType = this.entries[0].destination_account.type ?? 'unknown';
@@ -129,6 +132,37 @@ let transactions = function () {
}, },
loadCurrencies() { loadCurrencies() {
console.log('Loading user currencies.'); console.log('Loading user currencies.');
let params = {
page: 1,
limit: 1337
};
let getter = new Get();
getter.list({}).then((response) => {
for(let i in response.data.data) {
if(response.data.data.hasOwnProperty(i)) {
let current = response.data.data[i];
if(current.attributes.enabled) {
let obj =
{
id: current.id,
name: current.attributes.name,
code: current.attributes.code,
default: current.attributes.default,
symbol: current.attributes.symbol,
decimal_places: current.attributes.decimal_places,
};
if(obj.default) {
this.defaultCurrency = obj;
}
this.enabledCurrencies.push(obj);
}
}
}
this.loadingCurrencies = false;
console.log(this.enabledCurrencies);
});
}, },
changeSourceAccount(item, ac) { changeSourceAccount(item, ac) {
if (typeof item === 'undefined') { if (typeof item === 'undefined') {
@@ -275,7 +309,7 @@ let transactions = function () {
this.showErrorMessage = true; this.showErrorMessage = true;
// todo create error banner. // todo create error banner.
// todo release form // todo release form
console.error(error); this.errorMessageText = error.response.data.message;
}); });
}, },
addSplit() { addSplit() {

View File

@@ -33,9 +33,16 @@ export function createEmptySplit() {
let formatted = format(now, 'yyyy-MM-dd HH:mm'); let formatted = format(now, 'yyyy-MM-dd HH:mm');
return { return {
description: '', description: '',
// amount information:
amount: '', amount: '',
currency_code: 'EUR',
// source and destination
source_account: getAccount(), source_account: getAccount(),
destination_account: getAccount(), destination_account: getAccount(),
// date and time
date: formatted date: formatted
}; };
} }

View File

@@ -35,6 +35,7 @@ export function parseFromEntries(entries, transactionType) {
current.destination_name = entry.destination_account.name; current.destination_name = entry.destination_account.name;
current.amount = entry.amount; current.amount = entry.amount;
current.date = entry.date; current.date = entry.date;
current.currency_code = entry.currency_code;
// if ID is set: // if ID is set:
if ('' !== entry.source_account.id.toString()) { if ('' !== entry.source_account.id.toString()) {

View File

@@ -17,10 +17,7 @@
</div> </div>
</template> </template>
<template x-if="showErrorMessage"> <template x-if="showErrorMessage">
<div class="alert alert-danger alert-dismissible fade show" role="alert"> <div class="alert alert-danger alert-dismissible fade show" role="alert" x-text="errorMessageText">
A simple ERROR alert with <a href="#" class="alert-link">an example link</a>. Give it a
click
if you like.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div> </div>
</template> </template>
@@ -38,7 +35,7 @@
type="button" role="tab" type="button" role="tab"
:aria-controls="'split-'+index+'-pane'" :aria-controls="'split-'+index+'-pane'"
aria-selected="true">{{ __('firefly.single_split') }} # aria-selected="true">{{ __('firefly.single_split') }} #
<span x-text="index"></span> <span x-text="index+1"></span>
</button> </button>
</li> </li>
</template> </template>
@@ -125,7 +122,7 @@
<i class="fa-solid fa-calendar"></i> <i class="fa-solid fa-calendar"></i>
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="datetime-local" class="form-control" id="date_0" <input type="datetime-local" class="form-control" :id="'date_' + index"
@change="detectTransactionType" @change="detectTransactionType"
x-model="transaction.date" x-model="transaction.date"
> >
@@ -148,16 +145,12 @@
<span class="form-control-plaintext"><em class="fa-solid fa-spinner fa-spin"></em></span> <span class="form-control-plaintext"><em class="fa-solid fa-spinner fa-spin"></em></span>
</template> </template>
<template x-if="!loadingCurrencies"> <template x-if="!loadingCurrencies">
<select class="form-control"> <select class="form-control" :id="'currency_code_' + index"
<option> x-model="transaction.currency_code"
Euro >
</option> <template x-for="currency in enabledCurrencies">
<option> <option :selected="currency.id == defaultCurrency.id" :label="currency.name" :value="currency.code" x-text="currency.name"></option>
Euro </template>
</option>
<option>
Euro
</option>
</select> </select>
</template> </template>
</div> </div>

View File

@@ -22,18 +22,6 @@
declare(strict_types=1); declare(strict_types=1);
/**
* V2 API route for TransactionSum API endpoints
* TODO what to do with these routes
*/
//Route::group(
// ['namespace' => 'FireflyIII\Api\V2\Controllers\Transaction\Sum', 'prefix' => 'v2/transaction/sum',
// 'as' => 'api.v2.transaction.sum.',],
// static function () {
// Route::get('bills/paid', ['uses' => 'BillController@paid', 'as' => 'bills.paid']);
// }
//);
/** /**
* V2 API route for Summary boxes * V2 API route for Summary boxes
*/ */
@@ -134,7 +122,7 @@ Route::group(
'as' => 'api.v2.subscriptions.', 'as' => 'api.v2.subscriptions.',
], ],
static function () { static function () {
Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
Route::get('{userGroupBill}', ['uses' => 'ShowController@show', 'as' => 'show']); Route::get('{userGroupBill}', ['uses' => 'ShowController@show', 'as' => 'show']);
Route::get('sum/paid', ['uses' => 'SumController@paid', 'as' => 'sum.paid']); Route::get('sum/paid', ['uses' => 'SumController@paid', 'as' => 'sum.paid']);
Route::get('sum/unpaid', ['uses' => 'SumController@unpaid', 'as' => 'sum.unpaid']); Route::get('sum/unpaid', ['uses' => 'SumController@unpaid', 'as' => 'sum.unpaid']);
@@ -151,7 +139,21 @@ Route::group(
'as' => 'api.v2.piggy-banks.', 'as' => 'api.v2.piggy-banks.',
], ],
static function () { static function () {
Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
}
);
/**
* V2 API route for transaction currencies
*/
Route::group(
[
'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Currency',
'prefix' => 'v2/currencies',
'as' => 'api.v2.currencies.',
],
static function () {
Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
} }
); );
@@ -179,12 +181,12 @@ Route::group(
'as' => 'api.v2.budgets', 'as' => 'api.v2.budgets',
], ],
static function () { static function () {
Route::get('', ['uses' => 'Budget\ListController@index', 'as' => 'index']); Route::get('', ['uses' => 'Budget\IndexController@index', 'as' => 'index']);
Route::get('{budget}', ['uses' => 'Budget\ShowController@show', 'as' => 'show']); Route::get('{budget}', ['uses' => 'Budget\ShowController@show', 'as' => 'show']);
Route::get('{budget}/limits', ['uses' => 'BudgetLimit\ListController@index', 'as' => 'budget-limits.index']); Route::get('{budget}/limits', ['uses' => 'BudgetLimit\IndexController@index', 'as' => 'budget-limits.index']);
Route::get('sum/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'sum.budgeted']); Route::get('sum/budgeted', ['uses' => 'Budget\IndexController@budgeted', 'as' => 'sum.budgeted']);
Route::get('sum/spent', ['uses' => 'Budget\SumController@spent', 'as' => 'sum.spent']); Route::get('sum/spent', ['uses' => 'Budget\IndexController@spent', 'as' => 'sum.spent']);
Route::get('{budget}/budgeted', ['uses' => 'Budget\SumController@budgeted', 'as' => 'budget.budgeted']); Route::get('{budget}/budgeted', ['uses' => 'Budget\ShowController@budgeted', 'as' => 'budget.budgeted']);
Route::get('{budget}/spent', ['uses' => 'Budget\ShowController@spent', 'as' => 'budget.spent']); Route::get('{budget}/spent', ['uses' => 'Budget\ShowController@spent', 'as' => 'budget.spent']);
} }
); );
@@ -213,7 +215,7 @@ Route::group(
'as' => 'api.v2.user-groups.', 'as' => 'api.v2.user-groups.',
], ],
static function () { static function () {
Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); Route::get('', ['uses' => 'IndexController@index', 'as' => 'index']);
Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']);
Route::get('{userGroup}', ['uses' => 'ShowController@show', 'as' => 'show']); Route::get('{userGroup}', ['uses' => 'ShowController@show', 'as' => 'show']);
Route::put('{userGroup}', ['uses' => 'UpdateController@update', 'as' => 'update']); Route::put('{userGroup}', ['uses' => 'UpdateController@update', 'as' => 'update']);

View File

@@ -1,5 +1,26 @@
<?php <?php
/*
* NavigationCustomEndOfPeriodTest.php
* Copyright (c) 2023 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1); declare(strict_types=1);
namespace Tests\integration\Support; namespace Tests\integration\Support;