Fix DK Electronic VAT Declaration frequency-aware period tests#9722
Closed
djukicmilica with Copilot wants to merge 2 commits into
Closed
Fix DK Electronic VAT Declaration frequency-aware period tests#9722djukicmilica with Copilot wants to merge 2 commits into
djukicmilica with Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for unit tests
Fix DK Electronic VAT Declaration frequency-aware period tests
Jul 24, 2026
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two tests in
ElecVATDeclTests(codeunit 148015) were failing in the DK CI job due to bugs in VAT return period processing logic that was never fully integrated from branchbugs/master_629987.Bug fixes
Wrong Q2 start date (
DisabledReportingFrequencyCreatesQuarterlyPeriod):CalcDate('<-1Q+1D>', Jun 30)→ Mar 31 (wrong). Changed to<-CQ>(beginning of current quarter), which correctly yields Apr 1. The<-1Q+1D>formula coincidentally works for Q1/Q3/Q4 but fails for Q2 because June has 30 days.False overlap error (
ResponsePeriodsKeepFrequencyAndDueDateAssociated):InsertVATReturnPeriodcalledFindFirst()on overlapping periods and unconditionally errored. A monthly period (Apr 1–30) is a valid sub-period of a semi-annual period (Jan 1–Jun 30), not a conflict. Changed toFindSet()+ loop that only errors when an existing period extends outside the bounds of the new period being inserted.New production code (from bugs/master_629987)
ElecVATDeclRepFrequency.Enum.al— new enum 13605 (Monthly,Quarterly,Semi-Annual)ElecVATDeclGetPeriods.Codeunit.al— frequency-aware dispatch:GetFrequencyAwareVATReturnPeriods(readsAngivelseFrekvensNavnfrom SKAT response) vs.GetQuarterlyVATReturnPeriods(legacy fallback); frequency flag gated via Azure Key VaultElecVATDeclXml.Codeunit.al— new XML methods:TryGetPeriodNodesFromResponseText,TryGetDueDateNodeFromPeriodNode,TryGetFrequencyNodeFromPeriodNodeElecVATDeclAzKeyVault.Codeunit.al— newIsReportingFrequencyEnabled()readingDKElecVAT-ReportingFrequencyEnabledfrom Key Vault (defaults to enabled if missing/invalid)Test updates
ElecVATDeclTests.Codeunit.al— replaced empty placeholder with full 14-test codeunit covering all frequency variants, overlap scenarios, and Key Vault flag handlingtest/app.json— changed"target"from"Cloud"to"OnPrem"(required for[Scope('OnPrem')]tests usingLibraryAzureKVMockMgmt)