Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added validations DBA.FR74a and DBA.FR74b and related conformance tests. #1308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

allenbross-wf
Copy link
Contributor

Reason for change

DBA.FR74a: Provisions (fsa:Provisions) must be less than or equal to the balance sheet total (fsa:LiabilitiesAndEquity) minus equity (fsa:Equity).

DBA.FR74b: Liabilities (fsa:LiabilitiesOtherThanProvisions) and must be less than or equal to total assets (fsa:LiabilitiesAndEquity) minus equity (fsa:Equity).

Description of change

Added validations and conformance tests.

Steps to Test

review:
@Arelle/arelle

@aviary3-wk
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

elif fact.qname == pluginData.liabilitiesOtherThanProvisionsQn and fact.unit.value == DANISH_CURRENCY:
liabilityOtherFact = fact
if equityFact is not None and liabilityFact is not None and provisionFact is not None:
if cast(float, liabilityFact.xValue) - cast(float, equityFact.xValue) < cast(float, provisionFact.xValue) - ROUNDING_MARGIN:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe without xValue >= VALID? (Here or elsewhere in the plugin.)

elif fact.qname == pluginData.liabilitiesOtherThanProvisionsQn and fact.unit.value == DANISH_CURRENCY:
liabilityOtherFact = fact
if equityFact is not None and liabilityFact is not None and provisionFact is not None:
if cast(float, liabilityFact.xValue) - cast(float, equityFact.xValue) < cast(float, provisionFact.xValue) - ROUNDING_MARGIN:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these actually xs:float, or would decimal.Decimal be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These xValues are actually floats.

Copy link
Contributor

Choose a reason for hiding this comment

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

The LiabilitiesAndEquity concept is xbrli:monetaryItemType, which extends xs:decimal. I believe this logic should be producing decimal.Decimal. When I run fr74a-invalid.xbrl, I see <class 'decimal.Decimal'> for type(liabilityFact.xValue), not <class 'float'>, so cast(float) seems wrong.

NAMESPACE_CMN = 'http://xbrl.dcca.dk/cmn'
NAMESPACE_FSA = 'http://xbrl.dcca.dk/fsa'
NAMESPACE_GSD = 'http://xbrl.dcca.dk/gsd'
NAMESPACE_SOB = 'http://xbrl.dcca.dk/sob'
ROUNDING_MARGIN = 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, where does this value come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This came from the validation spreadsheet: "There is an option to deviate by DKK 1000 in connection with any roundings"

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a constant rather than an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

3 participants