mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
🤖 Auto commit for release 'develop' on 2025-04-20
This commit is contained in:
@@ -68,7 +68,7 @@ class PiggyBankFactory
|
|||||||
public function store(array $data): PiggyBank
|
public function store(array $data): PiggyBank
|
||||||
{
|
{
|
||||||
|
|
||||||
$piggyBankData = $data;
|
$piggyBankData = $data;
|
||||||
|
|
||||||
// unset some fields
|
// unset some fields
|
||||||
unset($piggyBankData['object_group_title'], $piggyBankData['transaction_currency_code'], $piggyBankData['transaction_currency_id'], $piggyBankData['accounts'], $piggyBankData['object_group_id'], $piggyBankData['notes']);
|
unset($piggyBankData['object_group_title'], $piggyBankData['transaction_currency_code'], $piggyBankData['transaction_currency_id'], $piggyBankData['accounts'], $piggyBankData['object_group_id'], $piggyBankData['notes']);
|
||||||
@@ -92,11 +92,11 @@ class PiggyBankFactory
|
|||||||
|
|
||||||
throw new FireflyException('400005: Could not store new piggy bank.', 0, $e);
|
throw new FireflyException('400005: Could not store new piggy bank.', 0, $e);
|
||||||
}
|
}
|
||||||
$piggyBank = $this->setOrder($piggyBank, $data);
|
$piggyBank = $this->setOrder($piggyBank, $data);
|
||||||
$this->linkToAccountIds($piggyBank, $data['accounts']);
|
$this->linkToAccountIds($piggyBank, $data['accounts']);
|
||||||
$this->piggyBankRepository->updateNote($piggyBank, $data['notes']);
|
$this->piggyBankRepository->updateNote($piggyBank, $data['notes']);
|
||||||
|
|
||||||
$objectGroupTitle = $data['object_group_title'] ?? '';
|
$objectGroupTitle = $data['object_group_title'] ?? '';
|
||||||
if ('' !== $objectGroupTitle) {
|
if ('' !== $objectGroupTitle) {
|
||||||
$objectGroup = $this->findOrCreateObjectGroup($objectGroupTitle);
|
$objectGroup = $this->findOrCreateObjectGroup($objectGroupTitle);
|
||||||
if (null !== $objectGroup) {
|
if (null !== $objectGroup) {
|
||||||
@@ -104,7 +104,7 @@ class PiggyBankFactory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// try also with ID
|
// try also with ID
|
||||||
$objectGroupId = (int) ($data['object_group_id'] ?? 0);
|
$objectGroupId = (int) ($data['object_group_id'] ?? 0);
|
||||||
if (0 !== $objectGroupId) {
|
if (0 !== $objectGroupId) {
|
||||||
$objectGroup = $this->findObjectGroupById($objectGroupId);
|
$objectGroup = $this->findObjectGroupById($objectGroupId);
|
||||||
if (null !== $objectGroup) {
|
if (null !== $objectGroup) {
|
||||||
@@ -112,7 +112,7 @@ class PiggyBankFactory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::debug('Touch piggy bank');
|
Log::debug('Touch piggy bank');
|
||||||
$piggyBank->encrypted = false;
|
$piggyBank->encrypted = false;
|
||||||
$piggyBank->save();
|
$piggyBank->save();
|
||||||
$piggyBank->touch();
|
$piggyBank->touch();
|
||||||
|
|
||||||
@@ -145,10 +145,11 @@ class PiggyBankFactory
|
|||||||
// first find by ID:
|
// first find by ID:
|
||||||
if ($piggyBankId > 0) {
|
if ($piggyBankId > 0) {
|
||||||
$piggyBank = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
$piggyBank = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||||
->where('accounts.user_id', $this->user->id)
|
->where('accounts.user_id', $this->user->id)
|
||||||
->where('piggy_banks.id', $piggyBankId)
|
->where('piggy_banks.id', $piggyBankId)
|
||||||
->first(['piggy_banks.*']);
|
->first(['piggy_banks.*'])
|
||||||
|
;
|
||||||
if (null !== $piggyBank) {
|
if (null !== $piggyBank) {
|
||||||
return $piggyBank;
|
return $piggyBank;
|
||||||
}
|
}
|
||||||
@@ -169,16 +170,17 @@ class PiggyBankFactory
|
|||||||
public function findByName(string $name): ?PiggyBank
|
public function findByName(string $name): ?PiggyBank
|
||||||
{
|
{
|
||||||
return PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
return PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||||
->where('accounts.user_id', $this->user->id)
|
->where('accounts.user_id', $this->user->id)
|
||||||
->where('piggy_banks.name', $name)
|
->where('piggy_banks.name', $name)
|
||||||
->first(['piggy_banks.*']);
|
->first(['piggy_banks.*'])
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setOrder(PiggyBank $piggyBank, array $data): PiggyBank
|
private function setOrder(PiggyBank $piggyBank, array $data): PiggyBank
|
||||||
{
|
{
|
||||||
$this->resetOrder();
|
$this->resetOrder();
|
||||||
$order = $this->getMaxOrder() + 1;
|
$order = $this->getMaxOrder() + 1;
|
||||||
if (array_key_exists('order', $data)) {
|
if (array_key_exists('order', $data)) {
|
||||||
$order = $data['order'];
|
$order = $data['order'];
|
||||||
}
|
}
|
||||||
@@ -193,14 +195,15 @@ class PiggyBankFactory
|
|||||||
{
|
{
|
||||||
// TODO duplicate code
|
// TODO duplicate code
|
||||||
$set = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
$set = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||||
->where('accounts.user_id', $this->user->id)
|
->where('accounts.user_id', $this->user->id)
|
||||||
->with(
|
->with(
|
||||||
[
|
[
|
||||||
'objectGroups',
|
'objectGroups',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->orderBy('piggy_banks.order', 'ASC')->get(['piggy_banks.*']);
|
->orderBy('piggy_banks.order', 'ASC')->get(['piggy_banks.*'])
|
||||||
|
;
|
||||||
$current = 1;
|
$current = 1;
|
||||||
foreach ($set as $piggyBank) {
|
foreach ($set as $piggyBank) {
|
||||||
if ($piggyBank->order !== $current) {
|
if ($piggyBank->order !== $current) {
|
||||||
@@ -240,12 +243,13 @@ class PiggyBankFactory
|
|||||||
$account = $this->accountRepository->find((int) ($info['account_id'] ?? 0));
|
$account = $this->accountRepository->find((int) ($info['account_id'] ?? 0));
|
||||||
if (null === $account) {
|
if (null === $account) {
|
||||||
Log::debug(sprintf('Account #%d not found, skipping.', (int) ($info['account_id'] ?? 0)));
|
Log::debug(sprintf('Account #%d not found, skipping.', (int) ($info['account_id'] ?? 0)));
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (array_key_exists('current_amount', $info) && null !== $info['current_amount']) {
|
if (array_key_exists('current_amount', $info) && null !== $info['current_amount']) {
|
||||||
// an amount is set, first check out if there is a difference with the previous amount.
|
// an amount is set, first check out if there is a difference with the previous amount.
|
||||||
$previous = $toBeLinked[$account->id]['current_amount'] ?? '0';
|
$previous = $toBeLinked[$account->id]['current_amount'] ?? '0';
|
||||||
$diff = bcsub($info['current_amount'], $previous);
|
$diff = bcsub($info['current_amount'], $previous);
|
||||||
|
|
||||||
// create event for difference.
|
// create event for difference.
|
||||||
if (0 !== bccomp($diff, '0')) {
|
if (0 !== bccomp($diff, '0')) {
|
||||||
@@ -258,8 +262,8 @@ class PiggyBankFactory
|
|||||||
}
|
}
|
||||||
if (array_key_exists('current_amount', $info) && null === $info['current_amount']) {
|
if (array_key_exists('current_amount', $info) && null === $info['current_amount']) {
|
||||||
// an amount is set, first check out if there is a difference with the previous amount.
|
// an amount is set, first check out if there is a difference with the previous amount.
|
||||||
$previous = $toBeLinked[$account->id]['current_amount'] ?? '0';
|
$previous = $toBeLinked[$account->id]['current_amount'] ?? '0';
|
||||||
$diff = bcsub('0', $previous);
|
$diff = bcsub('0', $previous);
|
||||||
|
|
||||||
// create event for difference.
|
// create event for difference.
|
||||||
if (0 !== bccomp($diff, '0')) {
|
if (0 !== bccomp($diff, '0')) {
|
||||||
|
@@ -78,14 +78,14 @@ class EditController extends Controller
|
|||||||
$startDate = $piggyBank->start_date?->format('Y-m-d');
|
$startDate = $piggyBank->start_date?->format('Y-m-d');
|
||||||
|
|
||||||
$preFilled = [
|
$preFilled = [
|
||||||
'name' => $piggyBank->name,
|
'name' => $piggyBank->name,
|
||||||
'transaction_currency_id' => (int) $piggyBank->transaction_currency_id,
|
'transaction_currency_id' => (int) $piggyBank->transaction_currency_id,
|
||||||
'target_amount' => app('steam')->bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
|
'target_amount' => app('steam')->bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
|
||||||
'target_date' => $targetDate,
|
'target_date' => $targetDate,
|
||||||
'start_date' => $startDate,
|
'start_date' => $startDate,
|
||||||
'accounts' => [],
|
'accounts' => [],
|
||||||
'object_group' => null !== $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',
|
'object_group' => null !== $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',
|
||||||
'notes' => null === $note ? '' : $note->text,
|
'notes' => null === $note ? '' : $note->text,
|
||||||
];
|
];
|
||||||
foreach ($piggyBank->accounts as $account) {
|
foreach ($piggyBank->accounts as $account) {
|
||||||
$preFilled['accounts'][] = $account->id;
|
$preFilled['accounts'][] = $account->id;
|
||||||
|
@@ -32,12 +32,12 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
class TrustProxies extends Middleware
|
class TrustProxies extends Middleware
|
||||||
{
|
{
|
||||||
// After...
|
// After...
|
||||||
protected $headers = Request::HEADER_X_FORWARDED_FOR |
|
protected $headers = Request::HEADER_X_FORWARDED_FOR
|
||||||
Request::HEADER_X_FORWARDED_HOST |
|
| Request::HEADER_X_FORWARDED_HOST
|
||||||
Request::HEADER_X_FORWARDED_PORT |
|
| Request::HEADER_X_FORWARDED_PORT
|
||||||
Request::HEADER_X_FORWARDED_PROTO |
|
| Request::HEADER_X_FORWARDED_PROTO
|
||||||
Request::HEADER_X_FORWARDED_PREFIX |
|
| Request::HEADER_X_FORWARDED_PREFIX
|
||||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
| Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TrustProxies constructor.
|
* TrustProxies constructor.
|
||||||
|
@@ -49,13 +49,13 @@ class PiggyBankUpdateRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
$accounts = $this->get('accounts');
|
$accounts = $this->get('accounts');
|
||||||
$data = [
|
$data = [
|
||||||
'name' => $this->convertString('name'),
|
'name' => $this->convertString('name'),
|
||||||
'start_date' => $this->getCarbonDate('start_date'),
|
'start_date' => $this->getCarbonDate('start_date'),
|
||||||
'target_amount' => trim($this->convertString('target_amount')),
|
'target_amount' => trim($this->convertString('target_amount')),
|
||||||
'target_date' => $this->getCarbonDate('target_date'),
|
'target_date' => $this->getCarbonDate('target_date'),
|
||||||
'transaction_currency_id' => $this->convertInteger('transaction_currency_id'),
|
'transaction_currency_id' => $this->convertInteger('transaction_currency_id'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
'object_group_title' => $this->convertString('object_group'),
|
'object_group_title' => $this->convertString('object_group'),
|
||||||
];
|
];
|
||||||
if (!is_array($accounts)) {
|
if (!is_array($accounts)) {
|
||||||
$accounts = [];
|
$accounts = [];
|
||||||
@@ -110,7 +110,7 @@ class PiggyBankUpdateRequest extends FormRequest
|
|||||||
if ($accountCurrency->id !== $currency->id && 'true' !== $isMultiCurrency) {
|
if ($accountCurrency->id !== $currency->id && 'true' !== $isMultiCurrency) {
|
||||||
$validator->errors()->add('accounts', trans('validation.invalid_account_currency'));
|
$validator->errors()->add('accounts', trans('validation.invalid_account_currency'));
|
||||||
}
|
}
|
||||||
$type = $account->accountType->type;
|
$type = $account->accountType->type;
|
||||||
if (!in_array($type, $types, true)) {
|
if (!in_array($type, $types, true)) {
|
||||||
$validator->errors()->add('accounts', trans('validation.invalid_account_type'));
|
$validator->errors()->add('accounts', trans('validation.invalid_account_type'));
|
||||||
}
|
}
|
||||||
|
@@ -69,9 +69,9 @@ trait ModifiesPiggyBanks
|
|||||||
$pivot->native_current_amount = null;
|
$pivot->native_current_amount = null;
|
||||||
|
|
||||||
// also update native_current_amount.
|
// also update native_current_amount.
|
||||||
$userCurrency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
|
$userCurrency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
|
||||||
if ($userCurrency->id !== $piggyBank->transaction_currency_id) {
|
if ($userCurrency->id !== $piggyBank->transaction_currency_id) {
|
||||||
$converter = new ExchangeRateConverter();
|
$converter = new ExchangeRateConverter();
|
||||||
$converter->setIgnoreSettings(true);
|
$converter->setIgnoreSettings(true);
|
||||||
$pivot->native_current_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $pivot->current_amount);
|
$pivot->native_current_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $pivot->current_amount);
|
||||||
}
|
}
|
||||||
@@ -92,9 +92,9 @@ trait ModifiesPiggyBanks
|
|||||||
$pivot->native_current_amount = null;
|
$pivot->native_current_amount = null;
|
||||||
|
|
||||||
// also update native_current_amount.
|
// also update native_current_amount.
|
||||||
$userCurrency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
|
$userCurrency = app('amount')->getNativeCurrencyByUserGroup($this->user->userGroup);
|
||||||
if ($userCurrency->id !== $piggyBank->transaction_currency_id) {
|
if ($userCurrency->id !== $piggyBank->transaction_currency_id) {
|
||||||
$converter = new ExchangeRateConverter();
|
$converter = new ExchangeRateConverter();
|
||||||
$converter->setIgnoreSettings(true);
|
$converter->setIgnoreSettings(true);
|
||||||
$pivot->native_current_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $pivot->current_amount);
|
$pivot->native_current_amount = $converter->convert($piggyBank->transactionCurrency, $userCurrency, today(), $pivot->current_amount);
|
||||||
}
|
}
|
||||||
@@ -126,8 +126,8 @@ trait ModifiesPiggyBanks
|
|||||||
Log::debug(sprintf('Maximum amount: %s', $maxAmount));
|
Log::debug(sprintf('Maximum amount: %s', $maxAmount));
|
||||||
}
|
}
|
||||||
|
|
||||||
$compare = bccomp($amount, $maxAmount);
|
$compare = bccomp($amount, $maxAmount);
|
||||||
$result = $compare <= 0;
|
$result = $compare <= 0;
|
||||||
|
|
||||||
Log::debug(sprintf('Compare <= 0? %d, so canAddAmount is %s', $compare, var_export($result, true)));
|
Log::debug(sprintf('Compare <= 0? %d, so canAddAmount is %s', $compare, var_export($result, true)));
|
||||||
|
|
||||||
@@ -161,11 +161,11 @@ trait ModifiesPiggyBanks
|
|||||||
|
|
||||||
public function setCurrentAmount(PiggyBank $piggyBank, string $amount): PiggyBank
|
public function setCurrentAmount(PiggyBank $piggyBank, string $amount): PiggyBank
|
||||||
{
|
{
|
||||||
$repetition = $this->getRepetition($piggyBank);
|
$repetition = $this->getRepetition($piggyBank);
|
||||||
if (null === $repetition) {
|
if (null === $repetition) {
|
||||||
return $piggyBank;
|
return $piggyBank;
|
||||||
}
|
}
|
||||||
$max = $piggyBank->target_amount;
|
$max = $piggyBank->target_amount;
|
||||||
if (1 === bccomp($amount, $max) && 0 !== bccomp($piggyBank->target_amount, '0')) {
|
if (1 === bccomp($amount, $max) && 0 !== bccomp($piggyBank->target_amount, '0')) {
|
||||||
$amount = $max;
|
$amount = $max;
|
||||||
}
|
}
|
||||||
@@ -208,14 +208,14 @@ trait ModifiesPiggyBanks
|
|||||||
|
|
||||||
public function update(PiggyBank $piggyBank, array $data): PiggyBank
|
public function update(PiggyBank $piggyBank, array $data): PiggyBank
|
||||||
{
|
{
|
||||||
$piggyBank = $this->updateProperties($piggyBank, $data);
|
$piggyBank = $this->updateProperties($piggyBank, $data);
|
||||||
if (array_key_exists('notes', $data)) {
|
if (array_key_exists('notes', $data)) {
|
||||||
$this->updateNote($piggyBank, (string) $data['notes']);
|
$this->updateNote($piggyBank, (string) $data['notes']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the order of the piggy bank:
|
// update the order of the piggy bank:
|
||||||
$oldOrder = $piggyBank->order;
|
$oldOrder = $piggyBank->order;
|
||||||
$newOrder = (int) ($data['order'] ?? $oldOrder);
|
$newOrder = (int) ($data['order'] ?? $oldOrder);
|
||||||
if ($oldOrder !== $newOrder) {
|
if ($oldOrder !== $newOrder) {
|
||||||
$this->setOrder($piggyBank, $newOrder);
|
$this->setOrder($piggyBank, $newOrder);
|
||||||
}
|
}
|
||||||
@@ -317,7 +317,7 @@ trait ModifiesPiggyBanks
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$dbNote = $piggyBank->notes()->first();
|
$dbNote = $piggyBank->notes()->first();
|
||||||
if (null === $dbNote) {
|
if (null === $dbNote) {
|
||||||
$dbNote = new Note();
|
$dbNote = new Note();
|
||||||
$dbNote->noteable()->associate($piggyBank);
|
$dbNote->noteable()->associate($piggyBank);
|
||||||
@@ -328,15 +328,16 @@ trait ModifiesPiggyBanks
|
|||||||
|
|
||||||
public function setOrder(PiggyBank $piggyBank, int $newOrder): bool
|
public function setOrder(PiggyBank $piggyBank, int $newOrder): bool
|
||||||
{
|
{
|
||||||
$oldOrder = $piggyBank->order;
|
$oldOrder = $piggyBank->order;
|
||||||
// Log::debug(sprintf('Will move piggy bank #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
// Log::debug(sprintf('Will move piggy bank #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
||||||
if ($newOrder > $oldOrder) {
|
if ($newOrder > $oldOrder) {
|
||||||
PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||||
->where('accounts.user_id', $this->user->id)
|
->where('accounts.user_id', $this->user->id)
|
||||||
->where('piggy_banks.order', '<=', $newOrder)->where('piggy_banks.order', '>', $oldOrder)
|
->where('piggy_banks.order', '<=', $newOrder)->where('piggy_banks.order', '>', $oldOrder)
|
||||||
->where('piggy_banks.id', '!=', $piggyBank->id)
|
->where('piggy_banks.id', '!=', $piggyBank->id)
|
||||||
->distinct()->decrement('piggy_banks.order');
|
->distinct()->decrement('piggy_banks.order')
|
||||||
|
;
|
||||||
|
|
||||||
$piggyBank->order = $newOrder;
|
$piggyBank->order = $newOrder;
|
||||||
Log::debug(sprintf('[1] Order of piggy #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
Log::debug(sprintf('[1] Order of piggy #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
||||||
@@ -345,11 +346,12 @@ trait ModifiesPiggyBanks
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||||
->where('accounts.user_id', $this->user->id)
|
->where('accounts.user_id', $this->user->id)
|
||||||
->where('piggy_banks.order', '>=', $newOrder)->where('piggy_banks.order', '<', $oldOrder)
|
->where('piggy_banks.order', '>=', $newOrder)->where('piggy_banks.order', '<', $oldOrder)
|
||||||
->where('piggy_banks.id', '!=', $piggyBank->id)
|
->where('piggy_banks.id', '!=', $piggyBank->id)
|
||||||
->distinct()->increment('piggy_banks.order');
|
->distinct()->increment('piggy_banks.order')
|
||||||
|
;
|
||||||
|
|
||||||
$piggyBank->order = $newOrder;
|
$piggyBank->order = $newOrder;
|
||||||
Log::debug(sprintf('[2] Order of piggy #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
Log::debug(sprintf('[2] Order of piggy #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder));
|
||||||
@@ -370,7 +372,7 @@ trait ModifiesPiggyBanks
|
|||||||
}
|
}
|
||||||
// if this account contains less than the amount, remove the current amount, update the amount and continue.
|
// if this account contains less than the amount, remove the current amount, update the amount and continue.
|
||||||
$this->removeAmount($piggyBank, $account, $current);
|
$this->removeAmount($piggyBank, $account, $current);
|
||||||
$amount = bcsub($amount, $current);
|
$amount = bcsub($amount, $current);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
changelog.md
10
changelog.md
@@ -7,11 +7,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- #9755
|
- [Issue 9755](https://github.com/firefly-iii/firefly-iii/issues/9755) (Unable to create transactions with non-native currency accounts when "display amounts in native currency" is enabled) reported by @dicksonleong
|
||||||
- #9867
|
- [Issue 9867](https://github.com/firefly-iii/firefly-iii/issues/9867) (Transactions from Jan 31 being counted in February) reported by @edbingo
|
||||||
- #9878
|
- [Issue 9878](https://github.com/firefly-iii/firefly-iii/issues/9878) (Piggy bank currency - wrong setting displayed or setting not saved) reported by @dethegeek
|
||||||
- #10068
|
- [Issue 10068](https://github.com/firefly-iii/firefly-iii/issues/10068) (Export Data isn't exporting all transactions in the data) reported by @firsttiger
|
||||||
- #10162
|
- [Discussion 10162](https://github.com/orgs/firefly-iii/discussions/10162) (Reverse proxy and `X-Forwarded-Prefix` header) started by @frenchu
|
||||||
|
|
||||||
## 6.2.11 - 2025-04-21
|
## 6.2.11 - 2025-04-21
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ return [
|
|||||||
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
|
||||||
// see cer.php for exchange rates feature flag.
|
// see cer.php for exchange rates feature flag.
|
||||||
],
|
],
|
||||||
'version' => '6.2.11',
|
'version' => 'develop/2025-04-20',
|
||||||
'api_version' => '2.1.0', // field is no longer used.
|
'api_version' => '2.1.0', // field is no longer used.
|
||||||
'db_version' => 25,
|
'db_version' => 25,
|
||||||
|
|
||||||
|
@@ -20,12 +20,8 @@
|
|||||||
"/public/v1/js/app.js.LICENSE.txt": "/public/v1/js/app.js.LICENSE.txt",
|
"/public/v1/js/app.js.LICENSE.txt": "/public/v1/js/app.js.LICENSE.txt",
|
||||||
"/public/v1/js/app_vue.js": "/public/v1/js/app_vue.js",
|
"/public/v1/js/app_vue.js": "/public/v1/js/app_vue.js",
|
||||||
"/public/v1/js/app_vue.js.LICENSE.txt": "/public/v1/js/app_vue.js.LICENSE.txt",
|
"/public/v1/js/app_vue.js.LICENSE.txt": "/public/v1/js/app_vue.js.LICENSE.txt",
|
||||||
"/public/v1/js/create.js": "/public/v1/js/create.js",
|
|
||||||
"/public/v1/js/create.js.LICENSE.txt": "/public/v1/js/create.js.LICENSE.txt",
|
|
||||||
"/public/v1/js/create_transaction.js": "/public/v1/js/create_transaction.js",
|
"/public/v1/js/create_transaction.js": "/public/v1/js/create_transaction.js",
|
||||||
"/public/v1/js/create_transaction.js.LICENSE.txt": "/public/v1/js/create_transaction.js.LICENSE.txt",
|
"/public/v1/js/create_transaction.js.LICENSE.txt": "/public/v1/js/create_transaction.js.LICENSE.txt",
|
||||||
"/public/v1/js/edit.js": "/public/v1/js/edit.js",
|
|
||||||
"/public/v1/js/edit.js.LICENSE.txt": "/public/v1/js/edit.js.LICENSE.txt",
|
|
||||||
"/public/v1/js/edit_transaction.js": "/public/v1/js/edit_transaction.js",
|
"/public/v1/js/edit_transaction.js": "/public/v1/js/edit_transaction.js",
|
||||||
"/public/v1/js/edit_transaction.js.LICENSE.txt": "/public/v1/js/edit_transaction.js.LICENSE.txt",
|
"/public/v1/js/edit_transaction.js.LICENSE.txt": "/public/v1/js/edit_transaction.js.LICENSE.txt",
|
||||||
"/public/v1/js/exchange-rates/index.js": "/public/v1/js/exchange-rates/index.js",
|
"/public/v1/js/exchange-rates/index.js": "/public/v1/js/exchange-rates/index.js",
|
||||||
@@ -100,8 +96,6 @@
|
|||||||
"/public/v1/js/ff/transactions/mass/edit-bulk.js": "/public/v1/js/ff/transactions/mass/edit-bulk.js",
|
"/public/v1/js/ff/transactions/mass/edit-bulk.js": "/public/v1/js/ff/transactions/mass/edit-bulk.js",
|
||||||
"/public/v1/js/ff/transactions/mass/edit.js": "/public/v1/js/ff/transactions/mass/edit.js",
|
"/public/v1/js/ff/transactions/mass/edit.js": "/public/v1/js/ff/transactions/mass/edit.js",
|
||||||
"/public/v1/js/ff/transactions/show.js": "/public/v1/js/ff/transactions/show.js",
|
"/public/v1/js/ff/transactions/show.js": "/public/v1/js/ff/transactions/show.js",
|
||||||
"/public/v1/js/index.js": "/public/v1/js/index.js",
|
|
||||||
"/public/v1/js/index.js.LICENSE.txt": "/public/v1/js/index.js.LICENSE.txt",
|
|
||||||
"/public/v1/js/lib/Chart.bundle.min.js": "/public/v1/js/lib/Chart.bundle.min.js",
|
"/public/v1/js/lib/Chart.bundle.min.js": "/public/v1/js/lib/Chart.bundle.min.js",
|
||||||
"/public/v1/js/lib/accounting.min.js": "/public/v1/js/lib/accounting.min.js",
|
"/public/v1/js/lib/accounting.min.js": "/public/v1/js/lib/accounting.min.js",
|
||||||
"/public/v1/js/lib/bootstrap-multiselect.js": "/public/v1/js/lib/bootstrap-multiselect.js",
|
"/public/v1/js/lib/bootstrap-multiselect.js": "/public/v1/js/lib/bootstrap-multiselect.js",
|
||||||
@@ -126,7 +120,6 @@
|
|||||||
"/public/v1/js/lib/moment/en_US.js": "/public/v1/js/lib/moment/en_US.js",
|
"/public/v1/js/lib/moment/en_US.js": "/public/v1/js/lib/moment/en_US.js",
|
||||||
"/public/v1/js/lib/moment/es_ES.js": "/public/v1/js/lib/moment/es_ES.js",
|
"/public/v1/js/lib/moment/es_ES.js": "/public/v1/js/lib/moment/es_ES.js",
|
||||||
"/public/v1/js/lib/moment/es_MX.js": "/public/v1/js/lib/moment/es_MX.js",
|
"/public/v1/js/lib/moment/es_MX.js": "/public/v1/js/lib/moment/es_MX.js",
|
||||||
"/public/v1/js/lib/moment/fa_IR.js": "/public/v1/js/lib/moment/fa_IR.js",
|
|
||||||
"/public/v1/js/lib/moment/fi_FI.js": "/public/v1/js/lib/moment/fi_FI.js",
|
"/public/v1/js/lib/moment/fi_FI.js": "/public/v1/js/lib/moment/fi_FI.js",
|
||||||
"/public/v1/js/lib/moment/fr_FR.js": "/public/v1/js/lib/moment/fr_FR.js",
|
"/public/v1/js/lib/moment/fr_FR.js": "/public/v1/js/lib/moment/fr_FR.js",
|
||||||
"/public/v1/js/lib/moment/hu_HU.js": "/public/v1/js/lib/moment/hu_HU.js",
|
"/public/v1/js/lib/moment/hu_HU.js": "/public/v1/js/lib/moment/hu_HU.js",
|
||||||
@@ -150,7 +143,6 @@
|
|||||||
"/public/v1/js/lib/moment/vi_VN.js": "/public/v1/js/lib/moment/vi_VN.js",
|
"/public/v1/js/lib/moment/vi_VN.js": "/public/v1/js/lib/moment/vi_VN.js",
|
||||||
"/public/v1/js/lib/moment/zh_CN.js": "/public/v1/js/lib/moment/zh_CN.js",
|
"/public/v1/js/lib/moment/zh_CN.js": "/public/v1/js/lib/moment/zh_CN.js",
|
||||||
"/public/v1/js/lib/moment/zh_TW.js": "/public/v1/js/lib/moment/zh_TW.js",
|
"/public/v1/js/lib/moment/zh_TW.js": "/public/v1/js/lib/moment/zh_TW.js",
|
||||||
"/public/v1/js/lib/moment-tz.js": "/public/v1/js/lib/moment-tz.js",
|
|
||||||
"/public/v1/js/lib/moment.min.js": "/public/v1/js/lib/moment.min.js",
|
"/public/v1/js/lib/moment.min.js": "/public/v1/js/lib/moment.min.js",
|
||||||
"/public/v1/js/lib/respond.min.js": "/public/v1/js/lib/respond.min.js",
|
"/public/v1/js/lib/respond.min.js": "/public/v1/js/lib/respond.min.js",
|
||||||
"/public/v1/js/lib/typeahead/bloodhound.js": "/public/v1/js/lib/typeahead/bloodhound.js",
|
"/public/v1/js/lib/typeahead/bloodhound.js": "/public/v1/js/lib/typeahead/bloodhound.js",
|
||||||
@@ -162,8 +154,6 @@
|
|||||||
"/public/v1/js/lib/vue.js": "/public/v1/js/lib/vue.js",
|
"/public/v1/js/lib/vue.js": "/public/v1/js/lib/vue.js",
|
||||||
"/public/v1/js/profile.js": "/public/v1/js/profile.js",
|
"/public/v1/js/profile.js": "/public/v1/js/profile.js",
|
||||||
"/public/v1/js/profile.js.LICENSE.txt": "/public/v1/js/profile.js.LICENSE.txt",
|
"/public/v1/js/profile.js.LICENSE.txt": "/public/v1/js/profile.js.LICENSE.txt",
|
||||||
"/public/v1/js/show.js": "/public/v1/js/show.js",
|
|
||||||
"/public/v1/js/show.js.LICENSE.txt": "/public/v1/js/show.js.LICENSE.txt",
|
|
||||||
"/public/v1/js/webhooks/create.js": "/public/v1/js/webhooks/create.js",
|
"/public/v1/js/webhooks/create.js": "/public/v1/js/webhooks/create.js",
|
||||||
"/public/v1/js/webhooks/create.js.LICENSE.txt": "/public/v1/js/webhooks/create.js.LICENSE.txt",
|
"/public/v1/js/webhooks/create.js.LICENSE.txt": "/public/v1/js/webhooks/create.js.LICENSE.txt",
|
||||||
"/public/v1/js/webhooks/edit.js": "/public/v1/js/webhooks/edit.js",
|
"/public/v1/js/webhooks/edit.js": "/public/v1/js/webhooks/edit.js",
|
||||||
|
Reference in New Issue
Block a user