mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-09-03 20:52:58 -05:00
🤖 Auto commit for release 'develop' on 2026-07-11
This commit is contained in:
@@ -158,7 +158,10 @@ final class TagController extends Controller
|
|||||||
'currency_id' => (string) $foreignCurrencyId,
|
'currency_id' => (string) $foreignCurrencyId,
|
||||||
'currency_code' => $journal['foreign_currency_code'],
|
'currency_code' => $journal['foreign_currency_code'],
|
||||||
];
|
];
|
||||||
$response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
|
$response[$foreignKey]['difference'] = bcadd(
|
||||||
|
(string) $response[$foreignKey]['difference'],
|
||||||
|
Steam::positive($journal['foreign_amount'])
|
||||||
|
);
|
||||||
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference'];
|
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,10 @@ final class TagController extends Controller
|
|||||||
'currency_id' => (string) $foreignCurrencyId,
|
'currency_id' => (string) $foreignCurrencyId,
|
||||||
'currency_code' => $journal['foreign_currency_code'],
|
'currency_code' => $journal['foreign_currency_code'],
|
||||||
];
|
];
|
||||||
$response[$foreignKey]['difference'] = bcadd((string) $response[$foreignKey]['difference'], Steam::positive($journal['foreign_amount']));
|
$response[$foreignKey]['difference'] = bcadd(
|
||||||
|
(string) $response[$foreignKey]['difference'],
|
||||||
|
Steam::positive($journal['foreign_amount'])
|
||||||
|
);
|
||||||
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
|
$response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,13 @@ final class BudgetLimitController extends Controller
|
|||||||
if ($request->expectsJson()) {
|
if ($request->expectsJson()) {
|
||||||
$array = $limit->toArray();
|
$array = $limit->toArray();
|
||||||
// add some extra metadata:
|
// add some extra metadata:
|
||||||
$spentArr = $this->opsRepository->sumExpenses($limit->start_date, $limit->end_date, null, new Collection()->push($budget), $currency);
|
$spentArr = $this->opsRepository->sumExpenses(
|
||||||
|
$limit->start_date,
|
||||||
|
$limit->end_date,
|
||||||
|
null,
|
||||||
|
new Collection()->push($budget),
|
||||||
|
$currency
|
||||||
|
);
|
||||||
$array['spent'] = $spentArr[$currency->id]['sum'] ?? '0';
|
$array['spent'] = $spentArr[$currency->id]['sum'] ?? '0';
|
||||||
$array['left_formatted'] = Amount::formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount']));
|
$array['left_formatted'] = Amount::formatAnything($limit->transactionCurrency, bcadd($array['spent'], (string) $array['amount']));
|
||||||
$array['amount_formatted'] = Amount::formatAnything($limit->transactionCurrency, $limit['amount']);
|
$array['amount_formatted'] = Amount::formatAnything($limit->transactionCurrency, $limit['amount']);
|
||||||
|
|||||||
@@ -284,7 +284,10 @@ final class IndexController extends Controller
|
|||||||
|
|
||||||
if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) {
|
if (array_key_exists($currency->id, $spentArr) && array_key_exists('sum', $spentArr[$currency->id])) {
|
||||||
$array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum'];
|
$array['spent'][$currency->id]['spent'] = $spentArr[$currency->id]['sum'];
|
||||||
$array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub($spentInLimits[$currency->id], $spentArr[$currency->id]['sum']));
|
$array['spent'][$currency->id]['spent_outside'] = Steam::negative(bcsub(
|
||||||
|
$spentInLimits[$currency->id],
|
||||||
|
$spentArr[$currency->id]['sum']
|
||||||
|
));
|
||||||
$array['spent'][$currency->id]['currency_id'] = $currency->id;
|
$array['spent'][$currency->id]['currency_id'] = $currency->id;
|
||||||
$array['spent'][$currency->id]['currency_symbol'] = $currency->symbol;
|
$array['spent'][$currency->id]['currency_symbol'] = $currency->symbol;
|
||||||
$array['spent'][$currency->id]['currency_decimal_places'] = $currency->decimal_places;
|
$array['spent'][$currency->id]['currency_decimal_places'] = $currency->decimal_places;
|
||||||
|
|||||||
@@ -539,7 +539,13 @@ final class BudgetController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get spent amount in this period for this currency.
|
// get spent amount in this period for this currency.
|
||||||
$sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection()->push($budget), $currency);
|
$sum = $this->opsRepository->sumExpenses(
|
||||||
|
$currentStart,
|
||||||
|
$currentEnd,
|
||||||
|
$accounts,
|
||||||
|
new Collection()->push($budget),
|
||||||
|
$currency
|
||||||
|
);
|
||||||
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||||
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
|
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
|||||||
// if has one, calculate expenses and use that as a base.
|
// if has one, calculate expenses and use that as a base.
|
||||||
$repository = app(OperationsRepositoryInterface::class);
|
$repository = app(OperationsRepositoryInterface::class);
|
||||||
$repository->setUser($autoBudget->budget->user);
|
$repository->setUser($autoBudget->budget->user);
|
||||||
$spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
|
$spent = $repository->sumExpenses(
|
||||||
|
$previousStart,
|
||||||
|
$previousEnd,
|
||||||
|
null,
|
||||||
|
new Collection()->push($autoBudget->budget),
|
||||||
|
$autoBudget->transactionCurrency
|
||||||
|
);
|
||||||
$currencyId = $autoBudget->transaction_currency_id;
|
$currencyId = $autoBudget->transaction_currency_id;
|
||||||
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
|
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
|
||||||
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
|
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
|
||||||
@@ -212,7 +218,13 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
|||||||
// if has one, calculate expenses and use that as a base.
|
// if has one, calculate expenses and use that as a base.
|
||||||
$repository = app(OperationsRepositoryInterface::class);
|
$repository = app(OperationsRepositoryInterface::class);
|
||||||
$repository->setUser($autoBudget->budget->user);
|
$repository->setUser($autoBudget->budget->user);
|
||||||
$spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection()->push($autoBudget->budget), $autoBudget->transactionCurrency);
|
$spent = $repository->sumExpenses(
|
||||||
|
$previousStart,
|
||||||
|
$previousEnd,
|
||||||
|
null,
|
||||||
|
new Collection()->push($autoBudget->budget),
|
||||||
|
$autoBudget->transactionCurrency
|
||||||
|
);
|
||||||
$currencyId = $autoBudget->transaction_currency_id;
|
$currencyId = $autoBudget->transaction_currency_id;
|
||||||
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
|
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
|
||||||
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
|
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
|
||||||
|
|||||||
@@ -222,7 +222,14 @@ trait AugumentData
|
|||||||
$currentEnd->addMonth();
|
$currentEnd->addMonth();
|
||||||
}
|
}
|
||||||
// primary currency amount.
|
// primary currency amount.
|
||||||
$expenses = $opsRepository->sumExpenses($currentStart, $currentEnd, null, $budgetCollection, $entry->transactionCurrency, $this->convertToPrimary);
|
$expenses = $opsRepository->sumExpenses(
|
||||||
|
$currentStart,
|
||||||
|
$currentEnd,
|
||||||
|
null,
|
||||||
|
$budgetCollection,
|
||||||
|
$entry->transactionCurrency,
|
||||||
|
$this->convertToPrimary
|
||||||
|
);
|
||||||
$spent = $expenses[$currency->id]['sum'] ?? '0';
|
$spent = $expenses[$currency->id]['sum'] ?? '0';
|
||||||
$entry->pc_spent = $spent;
|
$entry->pc_spent = $spent;
|
||||||
|
|
||||||
|
|||||||
@@ -354,7 +354,11 @@ class RecurringEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
/** @var RecurrenceRepetition $repetition */
|
/** @var RecurrenceRepetition $repetition */
|
||||||
foreach ($set as $repetition) {
|
foreach ($set as $repetition) {
|
||||||
$recurrence = $this->collection->filter(static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id)->first();
|
$recurrence = $this->collection->filter(
|
||||||
|
static fn (Recurrence $item): bool => (int) $item->id === (int) $repetition->recurrence_id
|
||||||
|
)
|
||||||
|
->first()
|
||||||
|
;
|
||||||
$fromDate = clone ($recurrence->latest_date ?? $recurrence->first_date);
|
$fromDate = clone ($recurrence->latest_date ?? $recurrence->first_date);
|
||||||
$recurrenceId = (int) $repetition->recurrence_id;
|
$recurrenceId = (int) $repetition->recurrence_id;
|
||||||
$repId = (int) $repetition->id;
|
$repId = (int) $repetition->id;
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ return [
|
|||||||
// see cer.php for exchange rates feature flag.
|
// see cer.php for exchange rates feature flag.
|
||||||
],
|
],
|
||||||
'version' => 'develop/2026-07-11',
|
'version' => 'develop/2026-07-11',
|
||||||
'build_time' => 1783745203,
|
'build_time' => 1783749925,
|
||||||
'api_version' => '2.1.0', // field is no longer used.
|
'api_version' => '2.1.0', // field is no longer used.
|
||||||
'db_version' => 28, // field is no longer used.
|
'db_version' => 28, // field is no longer used.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user