bseddon / xbrl Goto Github PK
View Code? Open in Web Editor NEWClasses that implement the XBRL 2.1, XDT, Formulas, Generics, XFI and other XBRL specifications
License: GNU General Public License v3.0
Classes that implement the XBRL 2.1, XDT, Formulas, Generics, XFI and other XBRL specifications
License: GNU General Public License v3.0
Would you be open to add a language parameter to processFormulasAgainstInstances
, so you can pass in the language that will be used to create the validation messages?
Currently I'm tackling this by a custom taxonomy implementation (XBRL_BE_TAX_INC
) and modifying the defaultLanguage before I do the processing, but I don't know if that's the right thing to do.
The spelling of my last name is Hoffman (rather than Hoffmann).
Hi,
I played around with the code to check if I could get it running doing assertions based on the Belgian tax taxonomy (webpage only available in Dutch and French: https://financien.belgium.be/nl/E-services/biztax/technische-documentatie#q2).
In the end I got it working, but I needed to do several fixes. I believe they are bugfixes, but not 100% sure of all.
I created a small test project to get things up and running, with the source code of the necessary libraries installed via composer. You can find the changes here: https://github.com/tim-vandecasteele/xbrl-experiment/commits/tim-fixes-for-be-tax .
They are split per commit with an explanation of what and how.
I didn't transfer these PRs to the corresponding repositories (3 for xpath2
and 3 for xbrl
) , as I'm not clear on what the policy is, specifically around tests. Let me know if this makes sense and what the process is to get these landed.
You may want to put a link to your "Additional Information...." page on this page: https://github.com/bseddon/XBRL/wiki
Hi, if I try to launch:
composer require lyquidity/xbrl:dev-master lyquidity/xpath2:dev-master lyquidity/utilities:dev-master lyquidity/xml:dev-master --prefer-dist
i get error:
Package lyquidity/xpath2 at version dev-master has requirements incompatible with your PHP version, PHP extensions
and Composer version:
- lyquidity/xpath2 dev-master requires php ^7.0 which does not match your installed version 8.0.13.
Any chance to get all compatible with php 8?
With every xbrl report file I get extension schema, which states what forms (presentation networks?) are available for particular business. With your help I can get all the necessary reports.
I am trying to improve the speed and came up with the following idea. Instead of using extension schema with every report I created a file which has all the possible forms instead. Then I compiled it.
Every time I need a report I parse the extension schema and get the list of available forms (from xsd:appinfo/link).
I create instance with compiled schema and validateDFR returns all possible networks.
I create reports for available forms only:
$instance = XBRL_Instance::FromInstanceDocument($xbrlFileName, $compiledTaxonomyFile);
$listOfAvailableForms = parseExtensionSchema();
$dfr = new \XBRL_DFR( $instanceTaxonomy );
$presentationNetworks = $dfr->validateDFR( $formulas );
if (in_array($listOfAvailableForms, $presentationNetworks))
{
getReportFields();
}
Is is a bit speedier than compiling extension taxonomy (and fixing Estonian extension taxonomy file by adding missing role imports), but still takes 2-3 seconds on my laptop.
To be honest I am not interested in full HTML reporting. I only look for fields from balance sheet and income statement.
I would be very thankful if you could share your thoughts on how could I make it faster..
Another example from Estonian reporting. This report is for 2018 taxonomy.
After manually adding missing role 9300 to the extension:
<link:linkbaseRef xlink:type="simple" xlink:href="et-gaap_2018-01-01/role-903000/def_AdditionalDimensionalAllocationByInterestRateBaseCurrenciesAndDueDate_role-903000.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
<link:linkbaseRef xlink:type="simple" xlink:href="et-gaap_2018-01-01/role-903000/def_AdditionalDimensionalAllocationByInterestRateBaseCurrenciesAndDueDateDuration_role-903010.xml" xlink:role="http://www.xbrl.org/2003/role/definitionLinkbaseRef" xlink:arcrole="http://www.w3.org/1999/xlink/properties/linkbase"/>
<xsd:import namespace="http://xbrl.eesti.ee/role/et-gaap_2018-01-01/role-903000" schemaLocation="et-gaap_2020-01-01/role-903000/role-903000.xsd"/>
I get new warnings:
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE4', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE5', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE6', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE7', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE8', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE3', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE14', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE16', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE17', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE18', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE19', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE20', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
[warning] [dimension] There are no valid hypercubes in the context for the primary item (Section 3.1.1 - context: 'HE21', primary item: 'et-gaap-cor_2018-01-01.xsd#et-gaap_TaxLiabilities', error: xbrldie:PrimaryItemDimensionallyInvalidError)
Maybe you have some hints for this issue as well?
I am trying to create report for the file (attached) using Estonian taxonomy for the year 2020.
$report = new \XBRL_Report('test.xbrl', 'test.xsd');
$report->excludeDefaultDimensionMembers();
$report->preparePresentation();
echo $report->toHtml();
Generated report is empty and logs complain about not finding roles
[info] Unable to find role for et-gaap-cor_2020-01-01.xsd#et-gaap_CurrentAssets
[info] Unable to find role for et-gaap-cor_2020-01-01.xsd#et-gaap_NonCurrentAssets etc.
After debugging for a while I found out that reporting needs role paths (and hierarchy) to be set, but the arrays are empty.
They get pruned in XBRL class in the function pruneNodeHypercubes, because they are marked as dimensional.
Could you please have a look and give some suggestions how to fix this.
Thank you!
See the link, XBRL-tests. You get a 404 error.
@bseddon I got into a pretty weird problem, that's almost exactly as described in here https://github.com/bseddon/XBRL/blob/develop/Formulas/Evaluation.php#L241
When executing
$formulas = new XBRL_Formulas();
if ( !$formulas->processFormulasAgainstInstances( $instance, null, null, null ) ) {
echo "Consistency error\n";
}
against the Belgian Tax Taxonomy, the assertion in be-tax-f-nrcorp-2420-2019-04-30-assertion.xml
is executed twice. Once regularly, and the next time, with a limited set, making it actually fail.
It seems that you added an $evaluated
boolean to fix exactly that https://github.com/bseddon/XBRL/blob/develop/Formulas/Evaluation.php#L197 but this variable is in comment. I couldn't see in the history why that would be the case.
Sadly it's not that easy to give an easy file to reproduce, but if needed I can carefully craft one.
Any chance your code can do a reverse lookup? For instance, parsing a JSON 10-Q and supplying the ReferenceName. Can it return the master class? (like roll-up?)
Hi! We are trying to use this library with XBRL files from Italian companies, but we have some trouble ..
/** @var string $filename */
$filename = $this->argument('filename');
$report = new \XBRL_Report( $filename );
$report->excludeDefaultDimensionMembers();
$report->preparePresentation();
$html = $report->toHtml();
$date = date( "Y-m-d" );
file_put_contents( "report_{$date}.html", $html );
Output:
[info] storage/bilanci/94101220211_28911915_14566012.xbrl
[info] Files: itcc-ci-micr-2018-11-04.xsd
[info] http://www.xbrl.org/dtr/type/numeric-2009-12-16.xsd
Exception : Error initialising the instance document. It may contain invalid XML.
hi
Is it possible to get a reference?
hi
What steps do I need to take to report xsd?
thanks
I am looking into using your code analysing Danish annual reports.
Testing your Case Study.
Attached two reports result in:
PHP Warning: DOMDocument::load(): Start tag expected, '<' not found in /.../instances/test2.xml, line: 1 in /.../report.php on line 391
PHP Stack trace:
PHP 1. {main}() /.../report.php:0
PHP 2. lyquidity\dfb\getInstanceTaxonomyHRef() /.../report.php:213
PHP 3. DOMDocument->load() /.../report.php:391
Please advise
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.