fix(reports): block unsupported EUR annual reports (#1366)
Closes #1360
This commit is contained in:
@@ -104,6 +104,28 @@ describe('validateAnnualReportCompleteness', () => {
|
||||
expect(result.error_count).toBe(0)
|
||||
})
|
||||
|
||||
it('keeps an unsupported reporting currency blocking at signing stage', () => {
|
||||
const value = input('signing')
|
||||
const currencyIssue = {
|
||||
code: 'AR-SCOPE-CURRENCY',
|
||||
severity: 'error' as const,
|
||||
section: 'scope' as const,
|
||||
message: 'Accounteds årsredovisningsflöde stöder ännu endast SEK som redovisningsvaluta.',
|
||||
}
|
||||
value.eligibility = {
|
||||
...eligibility,
|
||||
k2_eligible: false,
|
||||
digital_filing_eligible: false,
|
||||
issues: [currencyIssue],
|
||||
digital_issues: [currencyIssue],
|
||||
}
|
||||
|
||||
const result = validateAnnualReportCompleteness(value)
|
||||
|
||||
expect(result.ok).toBe(false)
|
||||
expect(result.issues).toEqual(expect.arrayContaining([currencyIssue]))
|
||||
})
|
||||
|
||||
it('does not infer an unanswered disclosure confirmation', () => {
|
||||
const value = input('draft')
|
||||
value.disclosures.securities_pledged_confirmed = false
|
||||
|
||||
@@ -39,6 +39,33 @@ describe('evaluateAnnualReportEligibility', () => {
|
||||
expect(result.issues).toEqual([])
|
||||
})
|
||||
|
||||
it('blocks EUR reports before they can be finalized or filed digitally', () => {
|
||||
const profile = completeProfile()
|
||||
profile.reporting_currency = 'EUR'
|
||||
const result = evaluateAnnualReportEligibility({
|
||||
entityType: 'aktiebolag',
|
||||
framework: 'k2',
|
||||
periodStart: '2026-01-01',
|
||||
periodEnd: '2026-12-31',
|
||||
profile,
|
||||
metrics,
|
||||
})
|
||||
|
||||
expect(result.k2_eligible).toBe(false)
|
||||
expect(result.digital_filing_eligible).toBe(false)
|
||||
expect(result.issues).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({ code: 'AR-SCOPE-CURRENCY', severity: 'error' }),
|
||||
]),
|
||||
)
|
||||
expect(result.digital_issues.filter((item) => item.code === 'AR-SCOPE-CURRENCY')).toHaveLength(
|
||||
1,
|
||||
)
|
||||
expect(
|
||||
result.digital_issues.filter((item) => item.code === 'AR-DIGITAL-CURRENCY'),
|
||||
).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('does not treat unanswered legal facts as false', () => {
|
||||
const result = evaluateAnnualReportEligibility({
|
||||
entityType: 'aktiebolag',
|
||||
|
||||
@@ -279,6 +279,16 @@ export function evaluateAnnualReportEligibility(
|
||||
}
|
||||
}
|
||||
|
||||
if (profile.reporting_currency !== 'SEK') {
|
||||
issues.push(
|
||||
issue(
|
||||
'AR-SCOPE-CURRENCY',
|
||||
'Accounteds årsredovisningsflöde stöder ännu endast SEK som redovisningsvaluta.',
|
||||
'Upprätta årsredovisningen i ett system som stöder euro som redovisningsvaluta.',
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
const k2Eligible = input.framework === 'k2' && issues.every((item) => item.severity !== 'error')
|
||||
const digitalIssues = [...issues]
|
||||
if (input.framework !== 'k2') {
|
||||
@@ -290,14 +300,6 @@ export function evaluateAnnualReportEligibility(
|
||||
),
|
||||
)
|
||||
}
|
||||
if (profile.reporting_currency !== 'SEK') {
|
||||
digitalIssues.push(
|
||||
issue(
|
||||
'AR-DIGITAL-CURRENCY',
|
||||
'Digital inlämning stöds ännu endast för årsredovisningar i SEK.',
|
||||
),
|
||||
)
|
||||
}
|
||||
if (profile.auditor_report_required === null) {
|
||||
digitalIssues.push(
|
||||
issue(
|
||||
|
||||
Reference in New Issue
Block a user