Commit Graph

1904 Commits

Author SHA1 Message Date
LPW
237035c8d4 Improve convert-to-trade security selection with search-first UX (#703)
* Enhance security handling logic:
- Prioritize user's country in sorting securities and country codes.
- Add comprehensive mapping for MIC codes to user-friendly exchange names.
- Revamp combobox to consistently pull from a provider when available.
- Improve handling of custom ticker and exchange input fields.

* Localize securities combobox display and exchange labels.

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-19 15:49:51 +01:00
LPW
bf9bcae600 Add gains by tax treatment to investment report with grouped subtype dropdown (#701)
* Add tax treatment metrics to reports, forms, and models

- Implement `build_gains_by_tax_treatment` for grouping gains by tax treatment
- Update investment performance view with tax treatment breakdown
- Add tax treatment field to crypto and investments forms
- Introduce `realized_gain_loss` calculation in the Trade model
- Group investment subtypes by region for improved dropdown organization

* Optimize investment performance report by reducing N+1 queries

- Eager-load associations in `build_gains_by_tax_treatment` to minimize database queries
- Preload holdings for realized gain/loss calculations in trades
- Refactor views to standardize "no data" placeholder using translations
- Adjust styling in tax treatment breakdown for improved layout

* Enhance investment performance translations and optimize holdings lookup logic

- Update `holdings_count` and `sells_count` translations to handle pluralization
- Refactor views to use pluralized translation keys with count interpolation
- Optimize preloaded holdings lookup in `Trade` to ensure deterministic selection using `select` and `max_by`

* Refine preloaded holdings logic in `Trade` model

- Treat empty preloaded holdings as authoritative to prevent unnecessary DB queries
- Add explicit fallback behavior for database query when holdings are not preloaded

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-19 15:44:49 +01:00
Mark Hendriksen
7f0781179c Add Dutch (nl) translations for UI and models (#702)
* Add Dutch (nl) translations for UI and models

Added comprehensive Dutch translation files for models, views, mailers, and Doorkeeper, covering accounts, categories, admin, and more. Updated languages_helper.rb to include 'nl' as a supported language. Improved capitalization and consistency in existing Dutch date and number formats.

* ai sugestions

* nitpick fix

* Fix Dutch translations and improve consistency

Corrected minor issues and improved consistency in Dutch locale files, including fixing typos, updating terminology (e.g., 'Self-Hosting' to 'Zelfhosting', 'Provider selectie' to 'Providerselectie'), and ensuring proper formatting. No functional changes were made; this commit only affects translation files.

* Update Dutch translations for product name and pluralization

Replaced hardcoded product names with %{product_name} in password reset and API key views for improved reusability. Updated wallet setup message in CoinStats item model to support correct Dutch pluralization.

* Update nl.yml
2026-01-19 15:42:55 +01:00
Alessio Cappa
e1a2ec901c feat: Allow to change country code in already existing Enable Banking connection, to link banks from other countries (#699) 2026-01-19 13:57:07 +01:00
github-actions[bot]
90bb0ac1cb Bump version to next alpha after v0.6.7-alpha.12 release 2026-01-18 17:04:46 +00:00
LPW
64dc5c2fb8 Add tax treatment classification for investment accounts with international support (#693)
* Add tax treatment support for accounts, investments, and cryptos

* Replace hardcoded region labels with I18n translations

* Add I18n support for subtype labels with fallback to hardcoded values

* fixed schema

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-18 17:29:02 +01:00
Alessio Cappa
6ec03e93f4 fix: Properly compute credit card balance for Enable Banking accounts (#663)
* fix: Properly compute credit card balance for Enable Banking accounts

* fix: Use right balance type codes

* fix: Update comment
2026-01-18 15:11:34 +01:00
LPW
f97ff419e8 Allow manual entry on linked accounts (#689)
* Update activity menu to conditionally display options for linked and investment accounts

* Update transaction test to reflect "New activity" menu change

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-18 15:08:27 +01:00
Alessio Cappa
3ea102d14f fix: Force top-0 on tooltip div to avoid overflow issues on mobile (#695) 2026-01-18 13:20:03 +01:00
foXaCe
302fb84086 feat: Support multiple crypto wallets with same token (#676)
* feat: Support multiple crypto wallets with same token

Allows users to import multiple wallets containing the same
cryptocurrency (e.g., ETH on different wallet addresses).

Changes:
- Add wallet_address column to coinstats_accounts
- Update uniqueness validation to include wallet_address
- Extract and store wallet address in WalletLinker
- Add composite unique index on [item_id, account_id, wallet_address]
- Add tests for multi-wallet support and backwards compatibility

Users can now have:
- ETH (0xAAA...) → "Ethereum (0xAA...AA)"
- ETH (0xBBB...) → "Ethereum (0xBB...BB)"

Backwards compatible: existing accounts with wallet_address: nil
continue to work.

* style: Fix array bracket spacing in migration

* chore: Update schema.rb with wallet_address column and index

Add the missing wallet_address column and composite unique index
to db/schema.rb for CI compatibility with db:schema:load

* test: Add test for wallet deletion with same token different addresses

Verifies that deleting one wallet does not affect other wallets
that share the same token but have different addresses.

Addresses review comment from @EthanC via @jjmata

---------

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
2026-01-18 11:27:09 +01:00
Mark Hendriksen
79d14c142f Remove relative positioning from net worth chart div (#687)
The 'relative' class was removed from the net worth chart container, possibly to resolve layout or stacking issues. The chart should now rely on default positioning.
2026-01-18 11:21:35 +01:00
Vivic87
3575c1e68a Add Spanish localization for reports (#694)
Signed-off-by: Vivic87 <id.vivic@gmail.com>
2026-01-18 10:57:40 +01:00
Juan José Mata
7f854aaded Remove "contact support" text 2026-01-18 08:13:29 +00:00
LPW
0f6dd536df Enhance ticker search and validation in "Convert to Trade" form (#688)
- Updated resolution logic to support combobox-based ticker selection and validation.
- Added market price display with validation against entered prices to detect significant mismatches.
- Improved messaging and UI for custom ticker input and market price warnings.

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-17 22:46:15 +01:00
Juan José Mata
47e0185409 fix: Allow locale preview on onboarding preferences page (#682)
* fix: Allow locale preview on onboarding preferences page

When a user selects a different language on /onboarding/preferences,
the page now immediately displays in the selected language. This is
achieved by checking for a valid locale URL parameter before falling
back to the family's saved locale setting.

* fix: Harden locale param handling and restore locale in tests

- Add type check to ensure params[:locale] is a String before calling
  .to_sym, preventing 500 errors from array/hash injection attacks
- Add teardown to tests to restore original locale, preventing test
  pollution

* fix: Reload family in teardown to handle update_column

* fix: Remove edge case test that used update_column with nil locale

* fix: Simplify localize tests - rely on fixture defaults and transactional isolation

* fix: Update system test to expect Spanish button text after locale preview

* refactor: Use I18n.t for button text in system test instead of hardcoded string

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-17 17:59:10 +01:00
Nuno Marques
527155a46f UI quick fixes (#684)
* fix: changed bg-surface-hover color for dark theme

* fix: added hover state to table entries on Tags and Accounts lists

* fix: added bottom margin on tag creation element preview

* fix: added overflow property to accounts table wrapper
2026-01-17 15:59:37 +01:00
github-actions[bot]
17046c70f6 Bump version to next alpha after v0.6.7-alpha.11 release 2026-01-16 23:05:49 +00:00
foXaCe
917101853b fix: Locale-aware currency formatting (#677)
* fix: Locale-aware currency formatting

Add locale-specific formatting for money display:
- French (fr): symbol after number with non-breaking space (1 000,12 €)
- German (de): symbol after number (1.000,12 €)
- Spanish (es): symbol after number (1.000,12 €)
- Italian (it): symbol after number (1.000,12 €)
- Portuguese-Brazil (pt-BR): symbol before with space (R$ 1.000,12)

This follows international conventions where most European languages
place the currency symbol after the number, unlike English.

* fix: Address CodeRabbit review comments

- Use non-breaking spaces (NBSP) for French locale formatting
- Add nil guard in locale_options to prevent NoMethodError
- Add test coverage for Portuguese (Brazil) locale

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 23:55:51 +01:00
LPW
9792ab838f Make first user of instance automatically super_admin (#655)
* Implement dynamic role assignment for new family creators.

Introduced `User.role_for_new_family_creator` to assign `super_admin` to the first user of an instance and a configurable fallback role (e.g., `admin`) to subsequent users. Updated controllers and tests accordingly.

* Update default fallback role for family creators to admin.

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-16 21:27:55 +01:00
LPW
0c2026680c Improve investment activity labels UX and add convert-to-trade feature (#649)
* Add `investment_activity_label` to trades and enhance activity label handling

- Introduced `investment_activity_label` column to the `trades` table with a migration.
- Backfilled existing `trades` with activity labels based on quantity (`Buy`, `Sell`, or `Other`).
- Replaced `category_id` in trades with `investment_activity_label` for better alignment with transaction labels.
- Updated views and controllers to display and manage activity labels for trades.
- Added localized badge components for displaying and editing labels dynamically.
- Enhanced `PlaidAccount::Investments::TransactionsProcessor` to assign and process activity labels automatically.
- Added investment flows section to reports for tracking contributions and withdrawals.
- Refactored related tests and models for consistency and to ensure proper validation and filtering.

* Improve handling of `investment_activity_label`, trade type, and security selection in trades and transactions

- Refined label assignment logic in `trades_controller` to default to `Buy`/`Sell` based on transaction nature.
- Simplified security selection in `transactions_controller` by resolving via unique IDs or custom tickers.
- Streamlined UI for trade and transaction forms by updating dropdown options and label text.
- Enabled quick-edit badges to open `convert_to_trade` modal when applicable, enhancing flexibility.
- Adjusted tests and views to align with updated workflows and ensure consistent behavior.

* Improve handling of `investment_activity_label`, trade type, and security selection in trades and transactions

- Refined label assignment logic in `trades_controller` to default to `Buy`/`Sell` based on transaction nature.
- Simplified security selection in `transactions_controller` by resolving via unique IDs or custom tickers.
- Streamlined UI for trade and transaction forms by updating dropdown options and label text.
- Enabled quick-edit badges to open `convert_to_trade` modal when applicable, enhancing flexibility.
- Adjusted tests and views to align with updated workflows and ensure consistent behavior.

* Improve handling of `investment_activity_label`, trade type, and security selection in trades and transactions

- Refined label assignment logic in `trades_controller` to default to `Buy`/`Sell` based on transaction nature.
- Simplified security selection in `transactions_controller` by resolving via unique IDs or custom tickers.
- Streamlined UI for trade and transaction forms by updating dropdown options and label text.
- Enabled quick-edit badges to open `convert_to_trade` modal when applicable, enhancing flexibility.
- Adjusted tests and views to align with updated workflows and ensure consistent behavior.

* Add safeguard for `dropdownTarget` existence in quick edit controller

- Prevent errors by ensuring `dropdownTarget` is present before toggling its visibility.

* Fix undefined method 'category' for Trade on mobile view

Trade model uses investment_activity_label, not category. The upstream
merge introduced a call to trade.category which doesn't exist. Use the
activity label badge on mobile instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix activity label logic for zero/blank quantity and sell inference

- Return `nil` for blank or zero quantity in `investment_activity_label_for`.
- Correct `is_sell` logic to use the amount’s sign properly in `transactions_controller`.

* Fix i18n key paths in transactions controller for convert_to_trade

- Update flash message translations to use full i18n paths.
- Use `BigDecimal` for quantity and price calculations to improve precision.

---------

Co-authored-by: Josh Waldrep <joshua.waldrep5+github@gmail.com>
Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 21:04:10 +01:00
LPW
1ca84d8048 Fix missing SSO JIT account creation template (#679)
* Add UI and functionality for new user registration via OIDC integration

* Add tests and localization for new user registration via OIDC

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-16 21:00:24 +01:00
LPW
c391ba2b23 Harden SimpleFIN sync: protect user data, fix stuck syncs, optimize API calls (#671)
* Implement entry protection flags for sync overwrites

- Added `user_modified` and `import_locked` flags to `entries` table to prevent provider sync from overwriting user-edited and imported data.
- Introduced backfill migration to mark existing entries based on conditions.
- Enhanced sync and processing logic to respect protection flags, track skipped entries, and log detailed stats.
- Updated UI to display skipped/protected entries and reasons in sync summaries.

* Localize error details summary text and adjust `sync_account_later` method placement

* Restored schema.rb

---------

Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
2026-01-16 12:34:06 +01:00
foXaCe
9b1188eab4 i18n: Fix and complete French translations (#673)
* i18n: Fix and complete French translations

- layout/fr.yml: Add missing nav section, remove extra key
- accounts/fr.yml: Rename account_sidebar_tabs to sidebar, fix %{product} variable, add missing keys (unlink, types, etc.)
- imports/fr.yml: Add missing category_import, rule_import sections
- settings/fr.yml: Add disable_ai, MFA/SSO keys, recurring_transactions_label
- registrations/fr.yml: Add closed message
- settings/hostings/fr.yml: Fix %{product} variable, add missing sections

* i18n: Add French translations for lunchflow_items

* i18n: Add missing French translations for 12 files

- models/category, models/coinstats_item
- views/chats, views/recurring_transactions, views/components
- views/enable_banking_items, views/reports, views/coinstats_items
- views/admin/sso_providers, views/admin/users
- views/rules, views/oidc_accounts
2026-01-16 09:45:00 +01:00
Andrei Onel
e0a74b2387 docs: Documentation update for v0.6.7-alpha.8 (#647)
* Update docs/features/investment-tracking.md

* Small changes to steps

Signed-off-by: Andrei Onel <onel@users.noreply.github.com>

* Moved invested-tracking guide to `guide.md`

Signed-off-by: Andrei Onel <onel@users.noreply.github.com>

* Delete docs/features/investment-tracking.md

Signed-off-by: Andrei Onel <onel@users.noreply.github.com>

* removed stray dash

* Update links for data provider integrations in guide

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

---------

Signed-off-by: Andrei Onel <onel@users.noreply.github.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: Juan José Mata <jjmata@jjmata.com>
2026-01-15 22:04:01 +01:00
foXaCe
3fc3e20c36 i18n: Add French translations (#658)
* i18n: Add French translations

Add complete French translation files for the application.

Co-Authored-By: Norman Alié <mail@normanalie.fr>
Co-Authored-By: Xurron <corentin.boeglin2005@gmail.com>

* fix: Correct YAML syntax in French securities translations

Co-Authored-By: Norman Alié <mail@normanalie.fr>
Co-Authored-By: Xurron <corentin.boeglin2005@gmail.com>

---------

Co-authored-by: Norman Alié <mail@normanalie.fr>
Co-authored-by: Xurron <corentin.boeglin2005@gmail.com>
2026-01-15 21:42:39 +01:00
Dario G. Mori
7f993eb9e9 fix: removed check for redis managed image as it causes crash (#661)
* feat: updated redis-operator to 0.23.X

* chore: renamed redis-operator-redis to redis-sentinel

* chore: renamed 00-redis-operator-replication to redis-operator-replication

* feat: added podSecurityContext

* fix: added security context to fix PV mounting

* fix: removed reference to tag and image in managed

* Revert "fix: added security context to fix PV mounting"

This reverts commit 18aca83c73.

* chore: removed podSecurityContext as it is not necessary
2026-01-15 21:39:39 +01:00
soky srm
4cc321a083 Family merchant logo (#660)
* FIX merchant regression

* Add logo support for family merchants

* Update family_merchant.rb
2026-01-15 17:00:32 +01:00
github-actions[bot]
f94a04d2e1 Bump version to next alpha after v0.6.7-alpha.10 release 2026-01-15 12:23:56 +00:00
soky srm
d1b8d585ce FIX merchant regression (#659) 2026-01-15 13:14:10 +01:00
github-actions[bot]
a5ec5d3a62 Bump version to next alpha after v0.6.7-alpha.9 release 2026-01-15 12:05:43 +00:00
Alessio Cappa
fabd60c098 fix: PWA display issues (#653)
* feat: re-apply PWA changes from previous PR

* feat: adjust padding on pages for mobile

* fix: Add position relative to netWorthChart to avoid overflow issues on mobile

* fix: Add safe-area to progress bar

* feat: add missing class on html

* fix: Replace touch-none with overscroll-none
2026-01-15 12:53:35 +01:00
Alessio Cappa
5d6abf7b48 feat: Add more category icons (#651)
* feat: Add more category icons

* fix: Fix icon name typo
2026-01-15 10:34:09 +01:00
Alessio Cappa
a50c48d3cf fix: Investments page mobile (#654)
* fix: Mobile layout UI adjustment for trade page

* fix: Adjust table in holdings tab on mobile

* fix: properly manage width on desktop
2026-01-15 10:32:52 +01:00
Juan José Mata
3f62e84531 No API hostname yet for sure.am 2026-01-14 20:53:09 +00:00
Mark Hendriksen
e9ae80c9fa Update selection bar styles and group classes (#648)
* Update selection bar styles and group classes

Replaces hardcoded color classes with design token classes for background, border, and text. Updates group and group-hover class names for edit and delete actions to use more specific variants.

* make the selection dars the same
2026-01-14 19:42:44 +01:00
Jose
8f164b20ef fix(api): Use authorize_scope! for merchants and tags controllers (#643)
* Add files via upload

Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com>

* Add merchants and tags resources to routes

Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com>

* update

* update spaces

* fix: Apply CodeRabbit suggestions and add YARD documentation

* docs: Add API documentation for merchants and tags endpoints

* fix: Address CodeRabbit feedback on documentation

* fix: Use authorize_scope! instead of ensure_read_scope

---------

Signed-off-by: Jose <39016041+jospaquim@users.noreply.github.com>
2026-01-14 11:22:19 +01:00
LPW
a780b34421 Fix SimpleFIN liability balance sign when transaction history is incomplete (#642)
* Add sanity check for net balance mismatch in overpayment analysis

- Introduced a validation to detect cases where transactions' net balance deviates significantly from the observed balance (using a 10% or $5 tolerance).
- Returns `:unknown` with a `net-balance-mismatch` error for incomplete data scenarios.

* Clarify liability net-balance comparison logic in overpayment analysis.

---------

Co-authored-by: Josh Waldrep <joshua.waldrep5+github@gmail.com>
2026-01-14 11:20:10 +01:00
Juan José Mata
f384f0866b Update PikaPods run button link
Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
2026-01-13 23:48:19 +01:00
Mark Hendriksen
ae254434a1 Add primary text color to amount in header (#640)
* Add primary text color to amount in header

Applied the 'text-primary' class to the amount display in the valuations header for improved visual emphasis and consistency with the design system.

* Update header styles and add currency display

Applied 'text-primary' class to amount displays in trades and transfers headers for consistent styling. Added a secondary styled currency display to the valuations header for improved clarity.
2026-01-13 23:04:56 +01:00
LPW
ff55b977d4 Add sso_audit_logs association and clear logs in demo data cleaner (#638)
- Added `has_many :sso_audit_logs` association to `User` model with `dependent: :nullify`.
- Updated `Demo::DataCleaner` to clear SSO audit logs before destroying related data.

Co-authored-by: Josh Waldrep <joshua.waldrep5+github@gmail.com>
2026-01-13 17:44:51 +01:00
Juan José Mata
ababbb99d0 Is sample_data or demo_data? 2026-01-13 15:53:10 +00:00
soky srm
0e22c60286 FIX Yahoo issues (#636)
* FIX Yahoo issues

* Update yahoo_finance_test.rb

* FIX proper cookie access
2026-01-13 16:46:07 +01:00
Juan José Mata
252042c0dc Fix account subtype not persisting when creating/editing investment accounts (#635)
The Account model only delegated the subtype reader to the accountable,
but not the writer. This caused form submissions with `account[subtype]`
to be silently ignored since there was no setter method on Account.

Changes:
- Add `subtype=` writer method to Account that delegates to accountable
- Add additional investment subtypes (457b, sep_ira, simple_ira, trust,
  ugma, utma, other) to Investment::SUBTYPES for better coverage
- Update PlaidAccount::TypeMappable with additional investment subtype
  mappings (403b, 457b, sep_ira, simple_ira, trust, ugma, utma)

Fixes #502

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 14:46:19 +01:00
Juan José Mata
88241cf5cb Fix tags getting removed after / during bank sync (#634)
* fix: Preserve transaction tags during rule application

When rules set tags, they now ADD to existing tags instead of replacing
them. This fixes issue #518 where tags were being removed during bank sync.

The root cause was that SetTransactionTags called enrich_attribute with
just the single tag from the rule, which replaced all existing tags.
Now it merges the new tag with existing tags using .uniq to prevent
duplicates.

This preserves:
- User-applied tags that shouldn't be overwritten by rules
- Tags from other rules when multiple rules match the same transaction
- Tags set during previous syncs

* fix: Add nil guard for tag in SetTransactionTags

Return early with 0 if the tag is not found, preventing NoMethodError
when find_by_id returns nil. This matches the pattern used in
SetTransactionMerchant.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 14:33:46 +01:00
soky srm
0bf3084738 Merge pull request #508 from kysre/add-config-import-csv-skip-first-x-rows
Add config import csv skip first x rows
2026-01-13 14:05:01 +01:00
sokie
4af588d1e6 i8n and fix test 2026-01-13 13:56:37 +01:00
sokie
11a011db15 Update import.rb 2026-01-13 13:51:10 +01:00
sokie
c9b334ac4f Add rows validation 2026-01-13 13:50:12 +01:00
sokie
30d3ee167e FIX add debounce for field
and refresh only form update
2026-01-13 13:45:40 +01:00
sokie
ff921799e4 Update _transaction_import.html.erb 2026-01-13 13:41:05 +01:00