mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Merge pull request #10721 from firefly-iii/release-1754589876
🤖 Automatically merge the PR into the develop branch.
This commit is contained in:
@@ -531,7 +531,7 @@ class BasicController extends Controller
|
|||||||
}
|
}
|
||||||
unset($leftToSpend);
|
unset($leftToSpend);
|
||||||
if (0 === count($return)) {
|
if (0 === count($return)) {
|
||||||
$days = (int) $start->diffInDays($end, true) + 1;
|
$days = (int) $start->diffInDays($end, true) + 1;
|
||||||
// a small trick to get every expense in this period, regardless of budget.
|
// a small trick to get every expense in this period, regardless of budget.
|
||||||
$spent = $this->opsRepository->sumExpenses($start, $end, null, new Collection());
|
$spent = $this->opsRepository->sumExpenses($start, $end, null, new Collection());
|
||||||
foreach ($spent as $row) {
|
foreach ($spent as $row) {
|
||||||
|
@@ -307,9 +307,9 @@ class BudgetController extends Controller
|
|||||||
foreach ($budget['transaction_journals'] as $journal) {
|
foreach ($budget['transaction_journals'] as $journal) {
|
||||||
// #10678
|
// #10678
|
||||||
// skip transactions between two asset / liability accounts.
|
// skip transactions between two asset / liability accounts.
|
||||||
if(
|
if (
|
||||||
in_array($journal['source_account_type'], config('firefly.valid_currency_account_types')) &&
|
in_array($journal['source_account_type'], config('firefly.valid_currency_account_types'), true)
|
||||||
in_array($journal['destination_account_type'], config('firefly.valid_currency_account_types'))
|
&& in_array($journal['destination_account_type'], config('firefly.valid_currency_account_types'), true)
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -53,24 +53,24 @@ use Override;
|
|||||||
*/
|
*/
|
||||||
class AccountEnrichment implements EnrichmentInterface
|
class AccountEnrichment implements EnrichmentInterface
|
||||||
{
|
{
|
||||||
private array $ids = [];
|
private array $ids = [];
|
||||||
private array $accountTypeIds = [];
|
private array $accountTypeIds = [];
|
||||||
private array $accountTypes = [];
|
private array $accountTypes = [];
|
||||||
private Collection $collection;
|
private Collection $collection;
|
||||||
private array $currencies = [];
|
private array $currencies = [];
|
||||||
private array $locations = [];
|
private array $locations = [];
|
||||||
private array $meta = [];
|
private array $meta = [];
|
||||||
private TransactionCurrency $primaryCurrency;
|
private TransactionCurrency $primaryCurrency;
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
private array $openingBalances = [];
|
private array $openingBalances = [];
|
||||||
private User $user;
|
private User $user;
|
||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
private array $lastActivities = [];
|
private array $lastActivities = [];
|
||||||
private ?Carbon $date = null;
|
private ?Carbon $date = null;
|
||||||
private bool $convertToPrimary;
|
private bool $convertToPrimary;
|
||||||
private array $balances = [];
|
private array $balances = [];
|
||||||
private array $objectGroups = [];
|
private array $objectGroups = [];
|
||||||
private array $mappedObjects = [];
|
private array $mappedObjects = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO The account enricher must do conversion from and to the primary currency.
|
* TODO The account enricher must do conversion from and to the primary currency.
|
||||||
@@ -138,9 +138,10 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectMetaData(): void
|
private function collectMetaData(): void
|
||||||
{
|
{
|
||||||
$set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt'])
|
$set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'BIC', 'liability_direction', 'interest', 'interest_period', 'current_debt'])
|
||||||
->whereIn('account_id', $this->ids)
|
->whereIn('account_id', $this->ids)
|
||||||
->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray();
|
->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray()
|
||||||
|
;
|
||||||
|
|
||||||
/** @var array $entry */
|
/** @var array $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
@@ -166,9 +167,10 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
private function collectNotes(): void
|
private function collectNotes(): void
|
||||||
{
|
{
|
||||||
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
||||||
->whereNotNull('notes.text')
|
->whereNotNull('notes.text')
|
||||||
->where('notes.text', '!=', '')
|
->where('notes.text', '!=', '')
|
||||||
->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray();
|
->where('noteable_type', Account::class)->get(['notes.noteable_id', 'notes.text'])->toArray()
|
||||||
|
;
|
||||||
foreach ($notes as $note) {
|
foreach ($notes as $note) {
|
||||||
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
||||||
}
|
}
|
||||||
@@ -178,14 +180,15 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
private function collectLocations(): void
|
private function collectLocations(): void
|
||||||
{
|
{
|
||||||
$locations = Location::query()->whereIn('locatable_id', $this->ids)
|
$locations = Location::query()->whereIn('locatable_id', $this->ids)
|
||||||
->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray();
|
->where('locatable_type', Account::class)->get(['locations.locatable_id', 'locations.latitude', 'locations.longitude', 'locations.zoom_level'])->toArray()
|
||||||
|
;
|
||||||
foreach ($locations as $location) {
|
foreach ($locations as $location) {
|
||||||
$this->locations[(int)$location['locatable_id']]
|
$this->locations[(int)$location['locatable_id']]
|
||||||
= [
|
= [
|
||||||
'latitude' => (float)$location['latitude'],
|
'latitude' => (float)$location['latitude'],
|
||||||
'longitude' => (float)$location['longitude'],
|
'longitude' => (float)$location['longitude'],
|
||||||
'zoom_level' => (int)$location['zoom_level'],
|
'zoom_level' => (int)$location['zoom_level'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Enrich with %d locations(s)', count($this->locations)));
|
Log::debug(sprintf('Enrich with %d locations(s)', count($this->locations)));
|
||||||
}
|
}
|
||||||
@@ -200,19 +203,20 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
->setUserGroup($this->userGroup)
|
->setUserGroup($this->userGroup)
|
||||||
->setAccounts($this->collection)
|
->setAccounts($this->collection)
|
||||||
->withAccountInformation()
|
->withAccountInformation()
|
||||||
->setTypes([TransactionTypeEnum::OPENING_BALANCE->value]);
|
->setTypes([TransactionTypeEnum::OPENING_BALANCE->value])
|
||||||
$journals = $collector->getExtractedJournals();
|
;
|
||||||
|
$journals = $collector->getExtractedJournals();
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$this->openingBalances[(int)$journal['source_account_id']]
|
$this->openingBalances[(int)$journal['source_account_id']]
|
||||||
= [
|
= [
|
||||||
'amount' => Steam::negative($journal['amount']),
|
'amount' => Steam::negative($journal['amount']),
|
||||||
'date' => $journal['date'],
|
'date' => $journal['date'],
|
||||||
];
|
];
|
||||||
$this->openingBalances[(int)$journal['destination_account_id']]
|
$this->openingBalances[(int)$journal['destination_account_id']]
|
||||||
= [
|
= [
|
||||||
'amount' => Steam::positive($journal['amount']),
|
'amount' => Steam::positive($journal['amount']),
|
||||||
'date' => $journal['date'],
|
'date' => $journal['date'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,28 +283,28 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
// add balances
|
// add balances
|
||||||
// get currencies:
|
// get currencies:
|
||||||
$currency = $this->primaryCurrency; // assume primary currency
|
$currency = $this->primaryCurrency; // assume primary currency
|
||||||
if (null !== $meta['currency']) {
|
if (null !== $meta['currency']) {
|
||||||
$currency = $meta['currency'];
|
$currency = $meta['currency'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the current balance:
|
// get the current balance:
|
||||||
$date = $this->getDate();
|
$date = $this->getDate();
|
||||||
// $finalBalance = Steam::finalAccountBalance($item, $date, $this->primaryCurrency, $this->convertToPrimary);
|
// $finalBalance = Steam::finalAccountBalance($item, $date, $this->primaryCurrency, $this->convertToPrimary);
|
||||||
$finalBalance = $this->balances[$id];
|
$finalBalance = $this->balances[$id];
|
||||||
Log::debug(sprintf('Call finalAccountBalance(%s) with date/time "%s"', var_export($this->convertToPrimary, true), $date->toIso8601String()), $finalBalance);
|
Log::debug(sprintf('Call finalAccountBalance(%s) with date/time "%s"', var_export($this->convertToPrimary, true), $date->toIso8601String()), $finalBalance);
|
||||||
|
|
||||||
// collect current balances:
|
// collect current balances:
|
||||||
$currentBalance = Steam::bcround($finalBalance[$currency->code] ?? '0', $currency->decimal_places);
|
$currentBalance = Steam::bcround($finalBalance[$currency->code] ?? '0', $currency->decimal_places);
|
||||||
$openingBalance = Steam::bcround($meta['opening_balance_amount'] ?? '0', $currency->decimal_places);
|
$openingBalance = Steam::bcround($meta['opening_balance_amount'] ?? '0', $currency->decimal_places);
|
||||||
$virtualBalance = Steam::bcround($account->virtual_balance ?? '0', $currency->decimal_places);
|
$virtualBalance = Steam::bcround($account->virtual_balance ?? '0', $currency->decimal_places);
|
||||||
$debtAmount = $meta['current_debt'] ?? null;
|
$debtAmount = $meta['current_debt'] ?? null;
|
||||||
|
|
||||||
// set some pc_ default values to NULL:
|
// set some pc_ default values to NULL:
|
||||||
$pcCurrentBalance = null;
|
$pcCurrentBalance = null;
|
||||||
$pcOpeningBalance = null;
|
$pcOpeningBalance = null;
|
||||||
$pcVirtualBalance = null;
|
$pcVirtualBalance = null;
|
||||||
$pcDebtAmount = null;
|
$pcDebtAmount = null;
|
||||||
|
|
||||||
// convert to primary currency if needed:
|
// convert to primary currency if needed:
|
||||||
if ($this->convertToPrimary && $currency->id !== $this->primaryCurrency->id) {
|
if ($this->convertToPrimary && $currency->id !== $this->primaryCurrency->id) {
|
||||||
@@ -323,7 +327,7 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
$openingBalance = null;
|
$openingBalance = null;
|
||||||
$pcOpeningBalance = null;
|
$pcOpeningBalance = null;
|
||||||
}
|
}
|
||||||
$meta['balances'] = [
|
$meta['balances'] = [
|
||||||
'current_balance' => $currentBalance,
|
'current_balance' => $currentBalance,
|
||||||
'pc_current_balance' => $pcCurrentBalance,
|
'pc_current_balance' => $pcCurrentBalance,
|
||||||
'opening_balance' => $openingBalance,
|
'opening_balance' => $openingBalance,
|
||||||
@@ -334,7 +338,7 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
'pc_debt_amount' => $pcDebtAmount,
|
'pc_debt_amount' => $pcDebtAmount,
|
||||||
];
|
];
|
||||||
// end add balances
|
// end add balances
|
||||||
$item->meta = $meta;
|
$item->meta = $meta;
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
@@ -352,12 +356,13 @@ class AccountEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectObjectGroups(): void
|
private function collectObjectGroups(): void
|
||||||
{
|
{
|
||||||
$set = DB::table('object_groupables')
|
$set = DB::table('object_groupables')
|
||||||
->whereIn('object_groupable_id', $this->ids)
|
->whereIn('object_groupable_id', $this->ids)
|
||||||
->where('object_groupable_type', Account::class)
|
->where('object_groupable_type', Account::class)
|
||||||
->get(['object_groupable_id', 'object_group_id']);
|
->get(['object_groupable_id', 'object_group_id'])
|
||||||
|
;
|
||||||
|
|
||||||
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
||||||
|
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
|
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
|
||||||
|
@@ -26,16 +26,16 @@ class BudgetEnrichment implements EnrichmentInterface
|
|||||||
private TransactionCurrency $primaryCurrency;
|
private TransactionCurrency $primaryCurrency;
|
||||||
private User $user;
|
private User $user;
|
||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
private array $ids = [];
|
private array $ids = [];
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
private array $autoBudgets = [];
|
private array $autoBudgets = [];
|
||||||
private array $currencies = [];
|
private array $currencies = [];
|
||||||
private ?Carbon $start = null;
|
private ?Carbon $start = null;
|
||||||
private ?Carbon $end = null;
|
private ?Carbon $end = null;
|
||||||
private array $spent = [];
|
private array $spent = [];
|
||||||
private array $pcSpent = [];
|
private array $pcSpent = [];
|
||||||
private array $objectGroups = [];
|
private array $objectGroups = [];
|
||||||
private array $mappedObjects = [];
|
private array $mappedObjects = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -89,9 +89,10 @@ class BudgetEnrichment implements EnrichmentInterface
|
|||||||
private function collectNotes(): void
|
private function collectNotes(): void
|
||||||
{
|
{
|
||||||
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
||||||
->whereNotNull('notes.text')
|
->whereNotNull('notes.text')
|
||||||
->where('notes.text', '!=', '')
|
->where('notes.text', '!=', '')
|
||||||
->where('noteable_type', Budget::class)->get(['notes.noteable_id', 'notes.text'])->toArray();
|
->where('noteable_type', Budget::class)->get(['notes.noteable_id', 'notes.text'])->toArray()
|
||||||
|
;
|
||||||
foreach ($notes as $note) {
|
foreach ($notes as $note) {
|
||||||
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
||||||
}
|
}
|
||||||
@@ -101,8 +102,8 @@ class BudgetEnrichment implements EnrichmentInterface
|
|||||||
private function appendCollectedData(): void
|
private function appendCollectedData(): void
|
||||||
{
|
{
|
||||||
$this->collection = $this->collection->map(function (Budget $item) {
|
$this->collection = $this->collection->map(function (Budget $item) {
|
||||||
$id = (int)$item->id;
|
$id = (int)$item->id;
|
||||||
$meta = [
|
$meta = [
|
||||||
'object_group_id' => null,
|
'object_group_id' => null,
|
||||||
'object_group_order' => null,
|
'object_group_order' => null,
|
||||||
'object_group_title' => null,
|
'object_group_title' => null,
|
||||||
@@ -154,7 +155,7 @@ class BudgetEnrichment implements EnrichmentInterface
|
|||||||
$opsRepository->setUserGroup($this->userGroup);
|
$opsRepository->setUserGroup($this->userGroup);
|
||||||
// $spent = $this->beautify();
|
// $spent = $this->beautify();
|
||||||
// $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection([$budget]))
|
// $set = $this->opsRepository->sumExpenses($start, $end, null, new Collection([$budget]))
|
||||||
$expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection, null);
|
$expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection, null);
|
||||||
foreach ($this->collection as $item) {
|
foreach ($this->collection as $item) {
|
||||||
$id = (int)$item->id;
|
$id = (int)$item->id;
|
||||||
$this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, false));
|
$this->spent[$id] = array_values($opsRepository->sumCollectedExpensesByBudget($expenses, $item, false));
|
||||||
@@ -175,12 +176,13 @@ class BudgetEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectObjectGroups(): void
|
private function collectObjectGroups(): void
|
||||||
{
|
{
|
||||||
$set = DB::table('object_groupables')
|
$set = DB::table('object_groupables')
|
||||||
->whereIn('object_groupable_id', $this->ids)
|
->whereIn('object_groupable_id', $this->ids)
|
||||||
->where('object_groupable_type', Budget::class)
|
->where('object_groupable_type', Budget::class)
|
||||||
->get(['object_groupable_id', 'object_group_id']);
|
->get(['object_groupable_id', 'object_group_id'])
|
||||||
|
;
|
||||||
|
|
||||||
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
$ids = array_unique($set->pluck('object_group_id')->toArray());
|
||||||
|
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
|
$this->mappedObjects[(int)$entry->object_groupable_id] = (int)$entry->object_group_id;
|
||||||
|
@@ -74,8 +74,8 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectIds(): void
|
private function collectIds(): void
|
||||||
{
|
{
|
||||||
$this->start = $this->collection->min('start_date');
|
$this->start = $this->collection->min('start_date');
|
||||||
$this->end = $this->collection->max('end_date');
|
$this->end = $this->collection->max('end_date');
|
||||||
|
|
||||||
/** @var BudgetLimit $limit */
|
/** @var BudgetLimit $limit */
|
||||||
foreach ($this->collection as $limit) {
|
foreach ($this->collection as $limit) {
|
||||||
@@ -92,9 +92,10 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
|||||||
private function collectNotes(): void
|
private function collectNotes(): void
|
||||||
{
|
{
|
||||||
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
$notes = Note::query()->whereIn('noteable_id', $this->ids)
|
||||||
->whereNotNull('notes.text')
|
->whereNotNull('notes.text')
|
||||||
->where('notes.text', '!=', '')
|
->where('notes.text', '!=', '')
|
||||||
->where('noteable_type', BudgetLimit::class)->get(['notes.noteable_id', 'notes.text'])->toArray();
|
->where('noteable_type', BudgetLimit::class)->get(['notes.noteable_id', 'notes.text'])->toArray()
|
||||||
|
;
|
||||||
foreach ($notes as $note) {
|
foreach ($notes as $note) {
|
||||||
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
||||||
}
|
}
|
||||||
@@ -126,9 +127,9 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
|||||||
$budgetIds = $this->collection->pluck('budget_id')->unique()->toArray();
|
$budgetIds = $this->collection->pluck('budget_id')->unique()->toArray();
|
||||||
$this->budgets = Budget::whereIn('id', $budgetIds)->get();
|
$this->budgets = Budget::whereIn('id', $budgetIds)->get();
|
||||||
|
|
||||||
$repository = app(OperationsRepository::class);
|
$repository = app(OperationsRepository::class);
|
||||||
$repository->setUser($this->user);
|
$repository->setUser($this->user);
|
||||||
$expenses = $repository->collectExpenses($this->start, $this->end, null, $this->budgets, null);
|
$expenses = $repository->collectExpenses($this->start, $this->end, null, $this->budgets, null);
|
||||||
|
|
||||||
/** @var BudgetLimit $budgetLimit */
|
/** @var BudgetLimit $budgetLimit */
|
||||||
foreach ($this->collection as $budgetLimit) {
|
foreach ($this->collection as $budgetLimit) {
|
||||||
|
@@ -25,15 +25,15 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
|||||||
private User $user;
|
private User $user;
|
||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
private Collection $collection;
|
private Collection $collection;
|
||||||
private array $ids = [];
|
private array $ids = [];
|
||||||
private array $currencyIds = [];
|
private array $currencyIds = [];
|
||||||
private array $currencies = [];
|
private array $currencies = [];
|
||||||
private array $accountIds = [];
|
private array $accountIds = [];
|
||||||
//private array $accountCurrencies = [];
|
// private array $accountCurrencies = [];
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
private array $mappedObjects = [];
|
private array $mappedObjects = [];
|
||||||
private TransactionCurrency $primaryCurrency;
|
private TransactionCurrency $primaryCurrency;
|
||||||
private array $amounts = [];
|
private array $amounts = [];
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -116,12 +116,12 @@ class PiggyBankEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
/** @var AccountMeta $item */
|
/** @var AccountMeta $item */
|
||||||
foreach ($set as $item) {
|
foreach ($set as $item) {
|
||||||
$accountId = (int)$item->account_id;
|
$accountId = (int)$item->account_id;
|
||||||
$currencyId = (int)$item->data;
|
$currencyId = (int)$item->data;
|
||||||
if (!array_key_exists($currencyId, $this->currencies)) {
|
if (!array_key_exists($currencyId, $this->currencies)) {
|
||||||
$this->currencies[$currencyId] = TransactionCurrency::find($currencyId);
|
$this->currencies[$currencyId] = TransactionCurrency::find($currencyId);
|
||||||
}
|
}
|
||||||
//$this->accountCurrencies[$accountId] = $this->currencies[$currencyId];
|
// $this->accountCurrencies[$accountId] = $this->currencies[$currencyId];
|
||||||
}
|
}
|
||||||
|
|
||||||
// get account info.
|
// get account info.
|
||||||
|
@@ -173,7 +173,7 @@ class RecurringEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
$this->transactions[$id][$transactionId] = [
|
$this->transactions[$id][$transactionId] = [
|
||||||
'id' => (string)$transactionId,
|
'id' => (string)$transactionId,
|
||||||
//'recurrence_id' => $id,
|
// 'recurrence_id' => $id,
|
||||||
'transaction_currency_id' => (int)$transaction->transaction_currency_id,
|
'transaction_currency_id' => (int)$transaction->transaction_currency_id,
|
||||||
'foreign_currency_id' => null === $transaction->foreign_currency_id ? null : (int)$transaction->foreign_currency_id,
|
'foreign_currency_id' => null === $transaction->foreign_currency_id ? null : (int)$transaction->foreign_currency_id,
|
||||||
'source_id' => (int)$transaction->source_id,
|
'source_id' => (int)$transaction->source_id,
|
||||||
|
@@ -28,14 +28,14 @@ class SubscriptionEnrichment implements EnrichmentInterface
|
|||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
private Collection $collection;
|
private Collection $collection;
|
||||||
private bool $convertToPrimary;
|
private bool $convertToPrimary;
|
||||||
private ?Carbon $start = null;
|
private ?Carbon $start = null;
|
||||||
private ?Carbon $end = null;
|
private ?Carbon $end = null;
|
||||||
private array $subscriptionIds = [];
|
private array $subscriptionIds = [];
|
||||||
private array $objectGroups = [];
|
private array $objectGroups = [];
|
||||||
private array $mappedObjects = [];
|
private array $mappedObjects = [];
|
||||||
private array $paidDates = [];
|
private array $paidDates = [];
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
private array $payDates = [];
|
private array $payDates = [];
|
||||||
private TransactionCurrency $primaryCurrency;
|
private TransactionCurrency $primaryCurrency;
|
||||||
private BillDateCalculator $calculator;
|
private BillDateCalculator $calculator;
|
||||||
|
|
||||||
|
@@ -48,11 +48,11 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
|||||||
private array $attachmentCount = [];
|
private array $attachmentCount = [];
|
||||||
private Collection $collection;
|
private Collection $collection;
|
||||||
private readonly array $dateFields;
|
private readonly array $dateFields;
|
||||||
private array $journalIds = [];
|
private array $journalIds = [];
|
||||||
private array $locations = [];
|
private array $locations = [];
|
||||||
private array $metaData = [];
|
private array $metaData = [];
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
private array $tags = [];
|
private array $tags = [];
|
||||||
private User $user;
|
private User $user;
|
||||||
private readonly TransactionCurrency $primaryCurrency;
|
private readonly TransactionCurrency $primaryCurrency;
|
||||||
private UserGroup $userGroup;
|
private UserGroup $userGroup;
|
||||||
|
@@ -73,6 +73,7 @@ class BudgetLimitTransformer extends AbstractTransformer
|
|||||||
if ($this->convertToPrimary && $currency->id !== $this->primaryCurrency->id) {
|
if ($this->convertToPrimary && $currency->id !== $this->primaryCurrency->id) {
|
||||||
$pcAmount = Steam::bcround($budgetLimit->native_amount, $this->primaryCurrency->decimal_places);
|
$pcAmount = Steam::bcround($budgetLimit->native_amount, $this->primaryCurrency->decimal_places);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => (string)$budgetLimit->id,
|
'id' => (string)$budgetLimit->id,
|
||||||
'created_at' => $budgetLimit->created_at->toAtomString(),
|
'created_at' => $budgetLimit->created_at->toAtomString(),
|
||||||
|
10
composer.lock
generated
10
composer.lock
generated
@@ -1879,16 +1879,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v12.21.0",
|
"version": "v12.22.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "ac8c4e73bf1b5387b709f7736d41427e6af1c93b"
|
"reference": "6ab00c913ef6ec6fad0bd506f7452c0bb9e792c3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/ac8c4e73bf1b5387b709f7736d41427e6af1c93b",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/6ab00c913ef6ec6fad0bd506f7452c0bb9e792c3",
|
||||||
"reference": "ac8c4e73bf1b5387b709f7736d41427e6af1c93b",
|
"reference": "6ab00c913ef6ec6fad0bd506f7452c0bb9e792c3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -2090,7 +2090,7 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2025-07-22T15:41:55+00:00"
|
"time": "2025-08-07T13:49:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/passport",
|
"name": "laravel/passport",
|
||||||
|
@@ -79,7 +79,7 @@ return [
|
|||||||
// see cer.php for exchange rates feature flag.
|
// see cer.php for exchange rates feature flag.
|
||||||
],
|
],
|
||||||
'version' => 'develop/2025-08-07',
|
'version' => 'develop/2025-08-07',
|
||||||
'build_time' => 1754540556,
|
'build_time' => 1754589772,
|
||||||
'api_version' => '2.1.0', // field is no longer used.
|
'api_version' => '2.1.0', // field is no longer used.
|
||||||
'db_version' => 26,
|
'db_version' => 26,
|
||||||
|
|
||||||
|
8
package-lock.json
generated
8
package-lock.json
generated
@@ -11524,9 +11524,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "7.0.6",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.0.tgz",
|
||||||
"integrity": "sha512-MHFiOENNBd+Bd9uvc8GEsIzdkn1JxMmEeYX35tI3fv0sJBUTfW5tQsoaOwuY4KhBI09A3dUJ/DXf2yxPVPUceg==",
|
"integrity": "sha512-3jdAy3NhBJYsa/lCFcnRfbK4kNkO/bhijFCnv5ByUQk/eekYagoV2yQSISUrhpV+5JiY5hmwOh7jNnQ68dFMuQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -11534,7 +11534,7 @@
|
|||||||
"fdir": "^6.4.6",
|
"fdir": "^6.4.6",
|
||||||
"picomatch": "^4.0.3",
|
"picomatch": "^4.0.3",
|
||||||
"postcss": "^8.5.6",
|
"postcss": "^8.5.6",
|
||||||
"rollup": "^4.40.0",
|
"rollup": "^4.43.0",
|
||||||
"tinyglobby": "^0.2.14"
|
"tinyglobby": "^0.2.14"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Reference in New Issue
Block a user