Skip to content

Delocalize FI Currency Exchange Rate import into FI Core#9405

Draft
djukicmilica wants to merge 4 commits into
mainfrom
djukicmilica/fi-deloc-currency-exch-rate
Draft

Delocalize FI Currency Exchange Rate import into FI Core#9405
djukicmilica wants to merge 4 commits into
mainfrom
djukicmilica/fi-deloc-currency-exch-rate

Conversation

@djukicmilica

@djukicmilica djukicmilica commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Delocalizes the Finnish Currency Exchange Rate import from the FI BaseApp layer into the FI Core extension app.

Changes

FI Core:

  • Adds codeunit 13415 "Currency Exch. Rate Import" with the fixed-format import logic and preserved OnBeforeFileImport event.
  • Adds page extension 13414 "Currencies FI" with the visible Import Exchange Rates action.

FI BaseApp compatibility:

  • Retains codeunit 32000001 "Currency Exchange Rate" under #if not CLEAN29 and marks it Pending for version 29.0.
  • Retains its public OnBeforeFileImport event as obsolete.
  • Retains the original page action as hidden and Pending.
  • Keeps the existing test codeunit 144001 CurrencyExchangeRateFile; no new test codeunit is added.

Move the Finnish fixed-format currency-rate file import out of the FI
BaseApp layer into the FI Core extension app.

- Add codeunit 13413 'Currency Exch. Rate Import' to FI Core (moved from
  BaseApp codeunit 32000001 'Currency Exchange Rate'; logic unchanged,
  OnBeforeFileImport integration event and OnPrem scope preserved).
- Add pageextension 13414 'Currencies FI' extending page 5 'Currencies'
  to re-expose the 'Import Exchange Rates' action running the moved
  codeunit.
- Move the test to FI Core Tests as codeunit 148151 'Currency Exch. Rate
  File Test' (subscriber rewired to the new codeunit).
- Remove the 'Import Exchange Rates' action from the FI BaseApp
  Currencies page override and delete the BaseApp codeunit and test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 731eaef8-bab7-4b1c-840e-f409b4de0195
@djukicmilica
djukicmilica requested a review from a team July 14, 2026 09:21
@github-actions

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

@djukicmilica
djukicmilica marked this pull request as draft July 14, 2026 09:31
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟡\ Medium\ Severity\ —\ Performance} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Both lookups in the moved import logic filter on the full primary key and then call FindFirst instead of using Get: Currency is keyed solely on Code (SetFilter(Code, ...) + FindFirst), and Currency Exchange Rate is keyed on (Currency Code, Starting Date) (SetFilter/SetRange on both fields + FindFirst).

Per the referenced guidance, when every primary-key field is known at the call site, Get expresses the lookup as a key seek and communicates intent more clearly than composing filters and calling FindFirst.

Suggested fix (apply manually — could not be anchored as a one-click suggestion):

                if not CurrencyExchRate.Get(Valuuttakoodi, StartingDate) then
                    if Currency.Get(Valuuttakoodi) then begin

Knowledge:

Posting this finding as an issue comment because inline comment placement failed.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

using System.IO;

codeunit 32000001 "Currency Exchange Rate"
codeunit 13413 "Currency Exch. Rate Import"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Upgrade} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

This PR renames/moves BaseApp codeunit 32000001 'Currency Exchange Rate' to a new app (FI Core) as codeunit 13413 'Currency Exch.

Rate Import', and removes the 'Import Exchange Rates' action from the BaseApp Currencies page override, without any ObsoleteState staging. Per the referenced guidance, retiring a BaseApp object should go through a Pending release (with ObsoleteReason/ObsoleteTag) before removal, so any per-tenant customization or extension still referencing codeunit 32000001 or the object name 'Currency Exchange Rate' by ID/name is not stranded. This repo's own precedent for the same delocalization pattern (e.g. the FI Depreciation Differences delocalization, commit 8b26e1e) does stage the BaseApp removal behind ObsoleteState Pending/Removed and CLEAN-version guards with upgrade code; this PR deletes the object outright instead.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@github-actions

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

All sub-skills completed or found no applicable knowledge; agent self-review pass surfaced no cross-cutting findings.

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Performance 1 1 0 0 1
Upgrade 1 1 0 1 0

Totals: 2 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants