Code Monkey home page Code Monkey logo

xbrl's People

Contributors

andreybolonin avatar bseddon avatar tim-vandecasteele avatar tjuryakin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xbrl's Issues

XBRL italy

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.

Compiling extension schema

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..

Several fixes (to be able to handle the Belgian tax taxonomy)

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.

VariableSet evaluated twice, second time with wrong context

@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.

reference

hi
Is it possible to get a reference?

presentation nodes pruned

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();

test.zip

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!

Report for Danish IFRS gives no result

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

instances.tar.gz

Please advise

Add language to `processFormulasAgainstInstances`

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.

PHP 8 not supported

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?

Missing hypercubes

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)

test2.zip

Maybe you have some hints for this issue as well?

Reverse Lookup?

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?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.