mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
🤖 Auto commit for release 'develop' on 2025-07-30
This commit is contained in:
@@ -280,17 +280,18 @@ class BudgetController extends Controller
|
||||
$amount = '0';
|
||||
$limit = null;
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
/** @var BudgetLimit $current */
|
||||
foreach ($limits as $current) {
|
||||
if(true === $this->convertToNative) {
|
||||
if($current->transaction_currency_id === $this->nativeCurrency->id) {
|
||||
if (true === $this->convertToNative) {
|
||||
if ($current->transaction_currency_id === $this->nativeCurrency->id) {
|
||||
// simply add it.
|
||||
$amount = bcadd($amount, (string)$current->amount);
|
||||
Log::debug(sprintf('Set amount in limit to %s' , $amount));
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
}
|
||||
if($current->transaction_currency_id !== $this->nativeCurrency->id) {
|
||||
if ($current->transaction_currency_id !== $this->nativeCurrency->id) {
|
||||
// convert and then add it.
|
||||
$converted = $converter->convert($current->transactionCurrency,$this->nativeCurrency, $limit->start_date, $limit->amount);
|
||||
$converted = $converter->convert($current->transactionCurrency, $this->nativeCurrency, $limit->start_date, $limit->amount);
|
||||
$amount = bcadd($amount, $converted);
|
||||
Log::debug(sprintf('Budgeted in limit #%d: %s %s, converted to %s %s', $current->id, $current->transactionCurrency->code, $current->amount, $this->nativeCurrency->code, $converted));
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
@@ -300,7 +301,7 @@ class BudgetController extends Controller
|
||||
$limit = $current;
|
||||
}
|
||||
}
|
||||
if(null !== $limit && true === $this->convertToNative) {
|
||||
if (null !== $limit && true === $this->convertToNative) {
|
||||
// convert and add all amounts.
|
||||
$limit->amount = app('steam')->positive($amount);
|
||||
Log::debug(sprintf('Final amount in limit with converted amount %s', $limit->amount));
|
||||
|
@@ -145,7 +145,7 @@ class CategoryController extends Controller
|
||||
$return = array_values($return);
|
||||
|
||||
// order by amount
|
||||
usort($return, static fn(array $a, array $b) => (float)$a['amount'] < (float)$b['amount'] ? 1 : -1);
|
||||
usort($return, static fn (array $a, array $b) => (float)$a['amount'] < (float)$b['amount'] ? 1 : -1);
|
||||
|
||||
return response()->json($this->clean($return));
|
||||
}
|
||||
|
@@ -164,8 +164,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$currencyCode = $journal['currency_code'];
|
||||
$currencyDecimalPlaces = $journal['currency_decimal_places'];
|
||||
}
|
||||
if(true === $convertToNative && $journalCurrencyId !== $currencyId) {
|
||||
$currencies[$journalCurrencyId]??= TransactionCurrency::find($journalCurrencyId);
|
||||
if (true === $convertToNative && $journalCurrencyId !== $currencyId) {
|
||||
$currencies[$journalCurrencyId] ??= TransactionCurrency::find($journalCurrencyId);
|
||||
$amount = $converter->convert($currencies[$journalCurrencyId], $nativeCurrency, $journal['date'], $amount);
|
||||
}
|
||||
|
||||
@@ -231,8 +231,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
?Collection $budgets = null,
|
||||
?TransactionCurrency $currency = null,
|
||||
bool $convertToNative = false
|
||||
): array
|
||||
{
|
||||
): array {
|
||||
Log::debug(sprintf('Start of %s(date, date, array, array, "%s", %s).', __METHOD__, $currency?->code, var_export($convertToNative, true)));
|
||||
// this collector excludes all transfers TO liabilities (which are also withdrawals)
|
||||
// because those expenses only become expenses once they move from the liability to the friend.
|
||||
@@ -255,7 +254,8 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
$collector->setUser($this->user)
|
||||
->setRange($start, $end)
|
||||
// ->excludeDestinationAccounts($selection)
|
||||
->setTypes([TransactionTypeEnum::WITHDRAWAL->value]);
|
||||
->setTypes([TransactionTypeEnum::WITHDRAWAL->value])
|
||||
;
|
||||
|
||||
if ($accounts instanceof Collection) {
|
||||
$collector->setAccounts($accounts);
|
||||
|
@@ -79,7 +79,7 @@ return [
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2025-07-30',
|
||||
'build_time' => 1753858473,
|
||||
'build_time' => 1753878970,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 26,
|
||||
|
||||
|
Reference in New Issue
Block a user