+
diff --git a/apps/client/src/app/components/broker-import-dialog/broker-import-dialog.scss b/apps/client/src/app/components/broker-import-dialog/broker-import-dialog.scss
new file mode 100644
index 0000000000..af099011c2
--- /dev/null
+++ b/apps/client/src/app/components/broker-import-dialog/broker-import-dialog.scss
@@ -0,0 +1,78 @@
+:host {
+ display: block;
+}
+section {
+ margin-top: 1.5rem;
+ padding-top: 1rem;
+ border-top: 1px solid #8884;
+}
+table {
+ width: 100%;
+ border-collapse: collapse;
+}
+td,
+th {
+ padding: 0.6rem;
+ text-align: left;
+ vertical-align: top;
+ border-bottom: 1px solid #8884;
+}
+th {
+ white-space: nowrap;
+}
+.table-wrap {
+ overflow-x: auto;
+}
+mat-form-field {
+ width: 100%;
+}
+.source-controls,
+.filter-controls {
+ display: flex;
+ gap: 1rem;
+ align-items: center;
+ flex-wrap: wrap;
+}
+.source-controls > * {
+ flex: 1 1 16rem;
+}
+.filter-controls > mat-form-field {
+ flex: 1 1 10rem;
+}
+.preview-action {
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+ margin: 1rem 0;
+}
+.summary-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
+ gap: 0.75rem;
+ margin-bottom: 1rem;
+}
+.summary-grid > div {
+ padding: 0.75rem;
+ border: 1px solid #8884;
+ border-radius: 0.4rem;
+}
+.summary-grid strong {
+ display: block;
+ font-size: 1.4rem;
+}
+.instrument-card {
+ padding: 1rem 0;
+ border-bottom: 1px solid #8884;
+}
+.confirmation-controls {
+ width: 100%;
+ padding: 0.5rem 0;
+}
+details > summary {
+ cursor: pointer;
+ font-weight: 500;
+ margin: 0.75rem 0;
+}
+mat-dialog-actions {
+ background: var(--mat-dialog-container-color, inherit);
+}
diff --git a/apps/client/src/app/components/broker-import-dialog/broker-import.messages.ts b/apps/client/src/app/components/broker-import-dialog/broker-import.messages.ts
new file mode 100644
index 0000000000..dafec7b3b0
--- /dev/null
+++ b/apps/client/src/app/components/broker-import-dialog/broker-import.messages.ts
@@ -0,0 +1,76 @@
+export const BROKER_IMPORT_TEXT = {
+ excludeUnsupported: $localize`:@@brokerUpstream_excludeUnsupported:Exclude unsupported groups`,
+ VALUATION_CURRENCY: $localize`:@@broker2_VALUATION_CURRENCY:The chosen listing has another currency. Activity amounts retain the source currency.`,
+ formatError: $localize`:@@brokerUpstream_formatError:Check the Directa Movimenti export: keep all 12 original columns, valid dates and Italian decimal numbers.`,
+ summary: $localize`:@@broker2_summary:Import summary`,
+ instruments: $localize`:@@broker2_instruments:Instruments`,
+ costs: $localize`:@@broker2_costs:Tax and commission matching`,
+ details: $localize`:@@broker2_details:Source rows and diagnostics`,
+ rows: $localize`:@@broker2_rows:Source rows`,
+ recognized: $localize`:@@broker2_recognized:Recognized`,
+ ready: $localize`:@@broker2_ready:Ready to import`,
+ existing: $localize`:@@broker2_existing:Already present`,
+ blocked: $localize`:@@broker2_blocked:Blocked`,
+ excluded: $localize`:@@broker2_excluded:Excluded`,
+ name: $localize`:@@broker2_name:Instrument`,
+ listing: $localize`:@@broker2_listing:Listing`,
+ market: $localize`:@@broker2_market:Market`,
+ currency: $localize`:@@broker2_currency:Currency`,
+ verification: $localize`:@@broker2_verification:Verification`,
+ affected: $localize`:@@broker2_affected:Affected operations`,
+ action: $localize`:@@broker2_action:Action`,
+ automatic: $localize`:@@broker2_automatic:Automatic`,
+ confirmed: $localize`:@@broker2_confirmed:Resolved with confirmation`,
+ choose: $localize`:@@broker2_choose:Needs confirmation`,
+ unresolved: $localize`:@@broker2_unresolved:Unresolvable`,
+ source: $localize`:@@broker2_source:Source`,
+ planned: $localize`:@@broker2_planned:To import`,
+ difference: $localize`:@@broker2_difference:Unreconciled`,
+ date: $localize`:@@broker2_date:Date`,
+ type: $localize`:@@broker2_type:Type`,
+ gross: $localize`:@@broker2_gross:Gross`,
+ fee: $localize`:@@broker2_fee:Fee`,
+ tax: $localize`:@@broker2_tax:Tax`,
+ net: $localize`:@@broker2_net:Net cash`,
+ include: $localize`:@@broker2_include:Include`,
+ all: $localize`:@@broker2_all:All`,
+ status: $localize`:@@broker2_status:Status`,
+ preview: $localize`:@@broker2_preview:Refresh preview`,
+ checking: $localize`:@@brokerUpstream_checking:Verifying listings and checking the import…`,
+ cancel: $localize`:@@broker2_cancel:Cancel`,
+ import: $localize`:@@broker2_import:Import Data`,
+ file: $localize`:@@broker2_file:Select a Directa CSV`,
+ destination: $localize`:@@broker2_destination:Destination account`,
+ buy: $localize`:@@broker2_buy:Buy`,
+ sell: $localize`:@@broker2_sell:Sell`,
+ dividend: $localize`:@@broker2_dividend:Dividend`,
+ expense: $localize`:@@broker2_expense:Expense`,
+ loadError: $localize`:@@broker2_loadError:Unable to load the preview. Check the file and try again.`,
+ previewAgain: $localize`:@@broker2_previewAgain:The choices or destination changed. Refresh the preview.`,
+ permission: $localize`:@@broker2_permission:Import from your own unrestricted profile with account and activity permissions.`,
+ invalidFile: $localize`:@@broker2_invalidFile:Choose a valid UTF-8 Directa CSV under 2 MB.`,
+ COST_ASSOCIATION: $localize`:@@broker2_COST_ASSOCIATION:Choose a compatible activity for this cost. A date alone is not sufficient.`,
+ INVALID_SOURCE: $localize`:@@broker2_INVALID_SOURCE:Check the source value, sign, date or identity in these rows.`,
+ CHANGED_IMPORT: $localize`:@@broker2_CHANGED_IMPORT:Previously imported data changed. Reconcile the existing records.`,
+ EXISTING_RECORD: $localize`:@@broker2_EXISTING_RECORD:A similar or previously imported record needs manual review.`,
+ INSTRUMENT_UNRESOLVED: $localize`:@@broker2_INSTRUMENT_UNRESOLVED:No reliable listing match was found for this ISIN. It remains blocked.`,
+ INSTRUMENT_CHOICE: $localize`:@@broker2_INSTRUMENT_CHOICE:Choose one of the verified listings below.`,
+ PROVIDER_UNAVAILABLE: $localize`:@@broker2_PROVIDER_UNAVAILABLE:A data source is unavailable. Retry, or choose a listing already verified.`,
+ PROFILE_CONFLICT: $localize`:@@broker2_PROFILE_CONFLICT:The saved instrument conflicts with verified listing data.`,
+ DIVIDEND_QUANTITY: $localize`:@@broker2_DIVIDEND_QUANTITY:Dividends use one income unit because the source has no share quantity.`,
+ instructions: $localize`:@@brokerUpstream_instructions:Choose a Directa CSV and a destination account. Account balances are not changed.`,
+ datePolicy: $localize`:@@brokerUpstream_datePolicy:Use the operation date for activities and retain settlement dates in source details.`,
+ coverage: $localize`:@@brokerUpstream_coverage:Source amount coverage`,
+ confirm: $localize`:@@brokerUpstream_confirm:I reviewed the selected activities, omissions and instrument choices.`,
+ partial: $localize`:@@brokerUpstream_partial:I explicitly accept importing only the selected groups; excluded movements will not be imported.`,
+ unsupported: $localize`:@@brokerUpstream_unsupported:Unsupported`,
+ limitations: $localize`:@@brokerUpstream_limitations:Taxes and cash transfers cannot be represented by this importer. Exclude a taxed activity together with all its costs.`,
+ TAX_UNSUPPORTED: $localize`:@@brokerUpstream_TAX_UNSUPPORTED:Taxes cannot be represented faithfully. Exclude this complete activity group.`,
+ UNSUPPORTED: $localize`:@@brokerUpstream_UNSUPPORTED:This movement is unsupported. Review it and explicitly exclude its complete group.`,
+ PARTIAL_REQUIRED: $localize`:@@brokerUpstream_PARTIAL_REQUIRED:Confirm the partial import and review all excluded groups.`,
+ DATE_POLICY: $localize`:@@brokerUpstream_DATE_POLICY:Accept the operation-date policy before importing.`,
+ LIMIT: $localize`:@@brokerUpstream_LIMIT:The selected activities exceed your import limit.`,
+ sourceMenu: $localize`:@@brokerUpstream_sourceMenu:Choose import source`,
+ fromGhostfolio: $localize`:@@brokerUpstream_fromGhostfolio:Import from Ghostfolio`,
+ fromDirecta: $localize`:@@brokerUpstream_fromDirecta:Import from Directa`
+};
diff --git a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
index 2c442f0403..62af573470 100644
--- a/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
+++ b/apps/client/src/app/pages/portfolio/activities/activities-page.component.ts
@@ -1,3 +1,4 @@
+import { GfBrokerImportDialogComponent } from '@ghostfolio/client/components/broker-import-dialog/broker-import-dialog.component';
import { IcsService } from '@ghostfolio/client/services/ics/ics.service';
import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service';
import { UserService } from '@ghostfolio/client/services/user/user.service';
@@ -217,6 +218,26 @@ export class GfActivitiesPageComponent implements OnInit {
});
}
+ protected onImportBroker(format: string) {
+ if (
+ !this.hasPermissionToImportActivities ||
+ this.user.settings.isRestrictedView ||
+ format !== 'DIRECTA'
+ )
+ return;
+ this.dialog
+ .open(GfBrokerImportDialogComponent, {
+ width: this.deviceType === 'mobile' ? '100vw' : '75rem',
+ maxWidth: '98vw',
+ height: '95dvh'
+ })
+ .afterClosed()
+ .pipe(takeUntilDestroyed(this.destroyRef))
+ .subscribe((imported) => {
+ if (imported) this.fetchActivities();
+ });
+ }
+
protected onImport() {
const dialogRef = this.dialog.open<
GfImportActivitiesDialogComponent,
diff --git a/apps/client/src/app/pages/portfolio/activities/activities-page.html b/apps/client/src/app/pages/portfolio/activities/activities-page.html
index 2b89ee8b20..f667282d8b 100644
--- a/apps/client/src/app/pages/portfolio/activities/activities-page.html
+++ b/apps/client/src/app/pages/portfolio/activities/activities-page.html
@@ -32,6 +32,7 @@
(export)="onExport()"
(exportDrafts)="onExportDrafts($event)"
(import)="onImport()"
+ (importBroker)="onImportBroker($event)"
(importDividends)="onImportDividends()"
(pageChanged)="onChangePage($event)"
(sortChanged)="onSortChanged($event)"
diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf
index 4df395e687..8fd95589b9 100644
--- a/apps/client/src/locales/messages.ca.xlf
+++ b/apps/client/src/locales/messages.ca.xlf
@@ -9883,6 +9883,302 @@
170
+
+ Import summary
+ Resum de la importació
+
+
+ Instruments
+ Instruments
+
+
+ Tax and commission matching
+ Associació d’impostos i comissions
+
+
+ Source rows and diagnostics
+ Files originals i diagnòstic
+
+
+ Source rows
+ Files originals
+
+
+ Recognized
+ Reconegudes
+
+
+ Ready to import
+ A punt per importar
+
+
+ Already present
+ Already present
+
+
+ Blocked
+ Bloquejades
+
+
+ Excluded
+ Excloses
+
+
+ Instrument
+ Instrument
+
+
+ Listing
+ Cotització
+
+
+ Market
+ Mercat
+
+
+ Currency
+ Divisa
+
+
+ Verification
+ Verificació
+
+
+ Affected operations
+ Operacions afectades
+
+
+ Action
+ Acció
+
+
+ Automatic
+ Automàtic
+
+
+ Resolved with confirmation
+ Resolt amb confirmació
+
+
+ Needs confirmation
+ Cal confirmació
+
+
+ Unresolvable
+ No resoluble
+
+
+ Source
+ Origen
+
+
+ To import
+ Per importar
+
+
+ Unreconciled
+ Sense conciliar
+
+
+ Date
+ Data
+
+
+ Type
+ Tipus
+
+
+ Gross
+ Brut
+
+
+ Fee
+ Comissió
+
+
+ Tax
+ Tax
+
+
+ Net cash
+ Efectiu net
+
+
+ Include
+ Inclou
+
+
+ All
+ Tots
+
+
+ Status
+ Estat
+
+
+ Refresh preview
+ Actualitza la previsualització
+
+
+ Verifying listings and checking the import…
+ Verificant cotitzacions i importació…
+
+
+ Cancel
+ Cancel·la
+
+
+ Import Data
+ Importa dades
+
+
+ Select a Directa CSV
+ Selecciona un CSV Directa
+
+
+ Destination account
+ Destination account
+
+
+ Buy
+ Comprar
+
+
+ Sell
+ Vendre
+
+
+ Dividend
+ Dividend
+
+
+ Expense
+ Despesa
+
+
+ Unable to load the preview. Check the file and try again.
+ No s’ha pogut carregar la previsualització. Revisa el fitxer i torna-ho a provar.
+
+
+ The choices or destination changed. Refresh the preview.
+ Les opcions o la destinació han canviat. Actualitza la previsualització.
+
+
+ Import from your own unrestricted profile with account and activity permissions.
+ Importa des del teu perfil sense restriccions amb permisos de comptes i operacions.
+
+
+ Choose a valid UTF-8 Directa CSV under 2 MB.
+ Tria un CSV Directa UTF-8 vàlid de menys de 2 MB.
+
+
+ Choose a compatible activity for this cost. A date alone is not sufficient.
+ Tria una operació compatible amb aquest cost. La data sola no és suficient.
+
+
+ Check the source value, sign, date or identity in these rows.
+ Revisa l’import, signe, data o identificador d’aquestes files.
+
+
+ Previously imported data changed. Reconcile the existing records.
+ Les dades ja importades han canviat. Concilia els registres existents.
+
+
+ A similar or previously imported record needs manual review.
+ Un registre semblant o ja importat requereix revisió manual.
+
+
+ No reliable listing match was found for this ISIN. It remains blocked.
+ No s’ha trobat una cotització fiable per a aquest ISIN. L’instrument continua bloquejat.
+
+
+ Choose one of the verified listings below.
+ Tria una de les cotitzacions verificades a continuació.
+
+
+ A data source is unavailable. Retry, or choose a listing already verified.
+ Una font de dades no està disponible. Torna-ho a provar o tria una cotització ja verificada.
+
+
+ The saved instrument conflicts with verified listing data.
+ L’instrument desat contradiu les dades verificades de la cotització.
+
+
+ Dividends use one income unit because the source has no share quantity.
+ Els dividends usen una unitat d’ingrés perquè el fitxer no indica el nombre de participacions.
+
+
+ Choose a Directa CSV and a destination account. Account balances are not changed.
+ Tria un CSV de Directa i un compte de destinació. Els saldos del compte no es modifiquen.
+
+
+ Use the operation date for activities and retain settlement dates in source details.
+ Utilitza la data d’operació per a les activitats i conserva les dates valor als detalls originals.
+
+
+ Source amount coverage
+ Cobertura dels imports originals
+
+
+ I reviewed the selected activities, omissions and instrument choices.
+ He revisat les activitats seleccionades, les omissions i la selecció d’instruments.
+
+
+ I explicitly accept importing only the selected groups; excluded movements will not be imported.
+ Accepto explícitament importar només els grups seleccionats; els moviments exclosos no s’importaran.
+
+
+ Unsupported
+ No compatible
+
+
+ Taxes and cash transfers cannot be represented by this importer. Exclude a taxed activity together with all its costs.
+ Aquest importador no pot representar impostos ni transferències d’efectiu. Exclou cada activitat subjecta a impostos juntament amb tots els seus costos.
+
+
+ Taxes cannot be represented faithfully. Exclude this complete activity group.
+ Els impostos no es poden representar fidelment. Exclou aquest grup complet d’operacions.
+
+
+ This movement is unsupported. Review it and explicitly exclude its complete group.
+ Aquest moviment no és compatible. Revisa’l i exclou explícitament el seu grup complet.
+
+
+ Confirm the partial import and review all excluded groups.
+ Confirma la importació parcial i revisa tots els grups exclosos.
+
+
+ Accept the operation-date policy before importing.
+ Accepta l’ús de la data d’operació abans d’importar.
+
+
+ The selected activities exceed your import limit.
+ Les activitats seleccionades superen el teu límit d’importació.
+
+
+ Choose import source
+ Tria la font d’importació
+
+
+ Import from Ghostfolio
+ Importa des de Ghostfolio
+
+
+ Import from Directa
+ Importa des de Directa
+
+
+ Check the Directa Movimenti export: keep all 12 original columns, valid dates and Italian decimal numbers.
+ Comprova l’exportació Movimenti de Directa: conserva les 12 columnes originals, dates vàlides i nombres en format italià.
+
+
+ The chosen listing has another currency. Activity amounts retain the source currency.
+ La cotització triada usa una altra divisa. Els imports de les operacions conserven la divisa original.
+
+
+ Exclude unsupported groups
+ Exclou els grups no compatibles
+