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

Missing CVM codes in the ITR from years 2010 to 2019 #21

Closed
glourencoffee opened this issue Sep 30, 2022 · 0 comments
Closed

Missing CVM codes in the ITR from years 2010 to 2019 #21

glourencoffee opened this issue Sep 30, 2022 · 0 comments
Labels
Priority: Medium Issue should be integrated in the next release Status: Completed This issue has been solved and can be integrated to development branch Type: Bug Something isn't behaving as expected
Milestone

Comments

@glourencoffee
Copy link
Owner

Description

The exception ValueError is raised if AccountLayoutType.from_cvm_code() is called for ITR documents from years 2011 to 2019.

Steps to reproduce

  1. Download an ITR from 2011 to 2019
  2. Open the document with DFPITRFile
  3. Call AccountLayoutType.from_cvm_code() for documents in that file
  4. See how ValueError is raised for many documents

Expected behavior

CVM codes in ITR files from 2011 to 2019 should be tracked by this library, and thus not raise ValueError.

Actual behavior

For example, running the following program:

import cvm
import sys

missing_cvm_codes = {}

with cvm.DFPITRFile(sys.argv[1]) as file:
    for dfpitr in file:
        # print(dfpitr)
        
        try:
            cvm.AccountLayoutType.from_cvm_code(dfpitr.cvm_code)
        except ValueError:
            missing_cvm_codes[dfpitr.cvm_code] = dfpitr.company_name

# print('CVM codes missed by this library:')
for cvm_code, company_name in missing_cvm_codes.items():
    print(cvm_code, '-', company_name)

with the ITR of 2011 produces the following output:

15733 - SHOPPING CENTER TACARUNA SA
14680 - PARCOM PARTICIPACOES S.A. - EM LIQUIDAÇÃO
14613 - NEUMARKT TRADE AND FINANCIAL CENTER S/A
15334 - BOMBRIL HOLDING SA
14818 - CIMS S.A.
16772 - BNDES PARTICIPACOES S.A. - BNDESPAR
16209 - ELETRON S.A.
14966 - SERRA AZUL WATER PARK SA
18589 - INVESTCO S.A.
14915 - GTD PARTICIPACOES SA
19577 - CONC RODOVIA PRES. DUTRA S.A.
15261 - SAUIPE SA
15199 - SANTA CATARINA PART INVEST SA
15377 - HOPI HARI SA
19208 - CONC RIO-TERESOPOLIS S.A.
15717 - CAIXA ADM DIV PUB ESTADUAL SA
15784 - ELETROBRÁS PARTICIPAÇÕES S.A. - ELETROPAR
15865 - ITAITINGA PARTICIPACOES S.A.
15709 - FERROVIA SUL-ATLANTICO S.A.
...

Additional context

This bug results from the refactor implemented by #11. #20 was a similar bug with DFP files.

@glourencoffee glourencoffee added this to the 0.4.0 milestone Sep 30, 2022
@glourencoffee glourencoffee transferred this issue from another repository Oct 11, 2022
@glourencoffee glourencoffee transferred this issue from another repository Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium Issue should be integrated in the next release Status: Completed This issue has been solved and can be integrated to development branch Type: Bug Something isn't behaving as expected
Projects
None yet
Development

No branches or pull requests

1 participant