Skip to content

Commit

Permalink
Merge pull request Arelle#1459 from Arelle/XT-4308
Browse files Browse the repository at this point in the history
  • Loading branch information
austinmatherne-wk authored Dec 20, 2024
2 parents a1b7e03 + c8e09a4 commit 5da1213
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class PluginValidationDataExtension(PluginData):
auditedNonAssuranceReportsDanish: str
auditedNonAssuranceReportsEnglish: str
averageNumberOfEmployeesQn: QName
balanceSheetQnLessThanOrEqualToAssets: frozenset[QName]
classOfReportingEntityQn: QName
consolidatedMemberQn: QName
consolidatedSoloDimensionQn: QName
Expand Down
89 changes: 89 additions & 0 deletions arelle/plugin/validate/DBA/ValidationPluginExtension.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,95 @@ def newPluginData(self, validateXbrl: ValidateXbrl) -> PluginValidationDataExten
auditedNonAssuranceReportsDanish='Andre erklæringer uden sikkerhed',
auditedNonAssuranceReportsEnglish='Auditor\'s reports (Other non-assurance reports)',
averageNumberOfEmployeesQn=qname(f'{{{NAMESPACE_FSA}}}AverageNumberOfEmployees'),
balanceSheetQnLessThanOrEqualToAssets=frozenset([
qname(f'{{{NAMESPACE_FSA}}}NoncurrentAssets'),
qname(f'{{{NAMESPACE_FSA}}}IntangibleAssets'),
qname(f'{{{NAMESPACE_FSA}}}CompletedDevelopmentProjects'),
qname(f'{{{NAMESPACE_FSA}}}ConcessionsOriginatingFromDevelopmentProjects'),
qname(f'{{{NAMESPACE_FSA}}}PatentsOriginatingFromDevelopmentProjects'),
qname(f'{{{NAMESPACE_FSA}}}TrademarksOriginatingFromDevelopmentProjects'),
qname(f'{{{NAMESPACE_FSA}}}OtherSimilarRightsOriginatingFromDevelopmentProjects'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredIntangibleAssets'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredConcessions'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredPatents'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredLicences'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredTrademarks'),
qname(f'{{{NAMESPACE_FSA}}}AcquiredOtherSimilarRights'),
qname(f'{{{NAMESPACE_FSA}}}Goodwill'),
qname(f'{{{NAMESPACE_FSA}}}DevelopmentProjectsInProgressAndPrepaymentsForIntangibleAssets'),
qname(f'{{{NAMESPACE_FSA}}}DevelopmentProjectsInProgress'),
qname(f'{{{NAMESPACE_FSA}}}PrepaymentsForIntangibleAssets'),
qname(f'{{{NAMESPACE_FSA}}}PropertyPlantAndEquipment'),
qname(f'{{{NAMESPACE_FSA}}}LandAndBuildings'),
qname(f'{{{NAMESPACE_FSA}}}Land'),
qname(f'{{{NAMESPACE_FSA}}}Buildings'),
qname(f'{{{NAMESPACE_FSA}}}InvestmentProperty'),
qname(f'{{{NAMESPACE_FSA}}}OtherInvestmentAssets'),
qname(f'{{{NAMESPACE_FSA}}}PlantAndMachinery'),
qname(f'{{{NAMESPACE_FSA}}}FixturesFittingsToolsAndEquipment'),
qname(f'{{{NAMESPACE_FSA}}}BiologicalAssets'),
qname(f'{{{NAMESPACE_FSA}}}LeaseholdImprovements'),
qname(f'{{{NAMESPACE_FSA}}}Ships'),
qname(f'{{{NAMESPACE_FSA}}}Planes'),
qname(f'{{{NAMESPACE_FSA}}}RightofuseAssets'),
qname(f'{{{NAMESPACE_FSA}}}PropertyPlantAndEquipmentInProgressAndPrepaymentsForPropertyPlantAndEquipment'),
qname(f'{{{NAMESPACE_FSA}}}PropertyPlantAndEquipmentInProgress'),
qname(f'{{{NAMESPACE_FSA}}}PrepaymentsForPropertyPlantAndEquipment'),
qname(f'{{{NAMESPACE_FSA}}}LongtermInvestmentsAndReceivables'),
qname(f'{{{NAMESPACE_FSA}}}LongtermInvestmentsInGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}LongtermInvestmentsInAssociates'),
qname(f'{{{NAMESPACE_FSA}}}LongtermParticipatingInterests'),
qname(f'{{{NAMESPACE_FSA}}}LongtermInvestmentsInJointVentures'),
qname(f'{{{NAMESPACE_FSA}}}LongtermReceivablesFromGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}LongtermReceivablesFromAssociates'),
qname(f'{{{NAMESPACE_FSA}}}LongtermReceivablesFromParticipatingInterests'),
qname(f'{{{NAMESPACE_FSA}}}LongtermReceivablesFromJointVentures'),
qname(f'{{{NAMESPACE_FSA}}}OtherLongtermInvestments'),
qname(f'{{{NAMESPACE_FSA}}}OtherLongtermReceivables'),
qname(f'{{{NAMESPACE_FSA}}}LongtermReceivablesFromOwnersAndManagement'),
qname(f'{{{NAMESPACE_FSA}}}NoncurrentDeferredTaxAssets'),
qname(f'{{{NAMESPACE_FSA}}}DepositsLongtermInvestmentsAndReceivables'),
qname(f'{{{NAMESPACE_FSA}}}CostExceedsIncomeForTheFinancialYearLongtermReceivables'),
qname(f'{{{NAMESPACE_FSA}}}ContributedCapitalInArrearsLongTerm'),
qname(f'{{{NAMESPACE_FSA}}}NoncurrentContractAssets'),
qname(f'{{{NAMESPACE_FSA}}}CurrentAssets'),
qname(f'{{{NAMESPACE_FSA}}}Inventories'),
qname(f'{{{NAMESPACE_FSA}}}RawMaterialsAndConsumables'),
qname(f'{{{NAMESPACE_FSA}}}WorkInProgress'),
qname(f'{{{NAMESPACE_FSA}}}ManufacturedGoodsAndGoodsForResale'),
qname(f'{{{NAMESPACE_FSA}}}PrepaymentsForGoods'),
qname(f'{{{NAMESPACE_FSA}}}Livestock'),
qname(f'{{{NAMESPACE_FSA}}}PropertyHeldForSaleInTheOrdinaryCourseOfBusiness'),
qname(f'{{{NAMESPACE_FSA}}}AssetsHeldForSaleInventories'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivables'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermTradeReceivables'),
qname(f'{{{NAMESPACE_FSA}}}ContractWorkInProgress'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesFromGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesFromAssociates'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesFromJointVentures'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesFromParticipatingInterests'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesDividendsFromGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesDividendsFromAssociates'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesDividendsFromJointVentures'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesDividendsFromParticipatingInterests'),
qname(f'{{{NAMESPACE_FSA}}}CurrentDeferredTaxAssets'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermTaxReceivables'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermTaxReceivablesFromGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}VatAndDutiesReceivables'),
qname(f'{{{NAMESPACE_FSA}}}OtherShorttermReceivables'),
qname(f'{{{NAMESPACE_FSA}}}ContributedCapitalInArrears'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermReceivablesFromOwnersAndManagement'),
qname(f'{{{NAMESPACE_FSA}}}DeferredIncomeAssets'),
qname(f'{{{NAMESPACE_FSA}}}CostExceedsIncomeForTheFinancialYearShorttermReceivables'),
qname(f'{{{NAMESPACE_FSA}}}TimingDifferencesShorttermReceivablesEspeciallyUtilities'),
qname(f'{{{NAMESPACE_FSA}}}CurrentContractAssets'),
qname(f'{{{NAMESPACE_FSA}}}DerivativeFinancialInstrumentsShorttermAssets'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermInvestments'),
qname(f'{{{NAMESPACE_FSA}}}ShorttermInvestmentsInGroupEnterprises'),
qname(f'{{{NAMESPACE_FSA}}}OtherShorttermInvestments'),
qname(f'{{{NAMESPACE_FSA}}}CashAndCashEquivalents'),
qname(f'{{{NAMESPACE_FSA}}}AssetsMeantForSale'),
]),
classOfReportingEntityQn=qname(f'{{{NAMESPACE_FSA}}}ClassOfReportingEntity'),
consolidatedMemberQn=qname(f'{{{NAMESPACE_CMN}}}ConsolidatedMember'),
consolidatedSoloDimensionQn=qname(f'{{{NAMESPACE_CMN}}}ConsolidatedSoloDimension'),
Expand Down
40 changes: 40 additions & 0 deletions arelle/plugin/validate/DBA/rules/fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,46 @@ def rule_fr56(
)


@validation(
hook=ValidationHook.XBRL_FINALLY,
)
def rule_fr63(
pluginData: PluginValidationDataExtension,
val: ValidateXbrl,
*args: Any,
**kwargs: Any,
) -> Iterable[Validation]:
"""
DBA.FR63: Items in the balance sheet must be less than or equal to the balance sheet total. Assets must be
less than or equal to the balance sheet total. Applies to both the year's figures and comparative figures.
"""
modelXbrl = val.modelXbrl
asset_facts = modelXbrl.factsByQname.get(pluginData.assetsQn)
if asset_facts is not None:
for asset_fact in asset_facts:
if asset_fact.xValid >= VALID and isinstance(asset_fact.xValue, decimal.Decimal):
concepts_in_error = []
facts_in_error = []
for balance_sheet_qn in pluginData.balanceSheetQnLessThanOrEqualToAssets:
balance_sheet_qn_facts = modelXbrl.factsByQname.get(balance_sheet_qn)
if balance_sheet_qn_facts is not None:
for balance_sheet_qn_fact in balance_sheet_qn_facts:
if (balance_sheet_qn_fact.xValid >= VALID and
isinstance(balance_sheet_qn_fact.xValue, decimal.Decimal) and
asset_fact.contextID == balance_sheet_qn_fact.contextID and
asset_fact.xValue < balance_sheet_qn_fact.xValue):
concepts_in_error.append(balance_sheet_qn.localName)
facts_in_error.append(balance_sheet_qn_fact)
if len(facts_in_error) > 0:
yield Validation.error(
codes='DBA.FR63',
msg=_("The annual report contains items in the balance sheet (year's figures or comparison "
"figures) which are greater than the balance sheet total(Assets). The following "
"fields do not comply: {}").format(concepts_in_error),
modelObject=facts_in_error
)


@validation(
hook=ValidationHook.XBRL_FINALLY,
)
Expand Down
Loading

0 comments on commit 5da1213

Please sign in to comment.