benjamin-awd / StatementSensei

PDF to CSV conversion for your bank statements
https://statementsensei.streamlit.app/
GNU Affero General Public License v3.0
63 stars 9 forks source link

bug: ocbc consolidated statement #15

Closed bsaurusrex closed 2 months ago

bsaurusrex commented 2 months ago

OCBC consolidated statement (current account) returns error: This error is thrown from both the email version and the website downloaded 'consolidated statement' version.


File "/app/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/app/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
File "/app/webapp/app.py", line 112, in <module>
    app()
File "/app/webapp/app.py", line 24, in app
    processed_files = process_files(files)
                      ^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/app.py", line 60, in process_files
    processed_file = handle_file(document)
                     ^^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/app.py", line 75, in handle_file
    file = parse_bank_statement(document)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/helpers.py", line 37, in parse_bank_statement
    statement = pipeline.extract(safety_check=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/monopoly/pipeline.py", line 51, in extract
    if not statement.statement_date:
           ^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 993, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/monopoly/statements/base.py", line 201, in statement_date
    raise ValueError("Statement date not found")
benjamin-awd commented 2 months ago

OCBC consolidated statement (current account) returns error: This error is thrown from both the email version and the website downloaded 'consolidated statement' version.

File "/app/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/app/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
File "/app/webapp/app.py", line 112, in <module>
    app()
File "/app/webapp/app.py", line 24, in app
    processed_files = process_files(files)
                      ^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/app.py", line 60, in process_files
    processed_file = handle_file(document)
                     ^^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/app.py", line 75, in handle_file
    file = parse_bank_statement(document)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/webapp/helpers.py", line 37, in parse_bank_statement
    statement = pipeline.extract(safety_check=False)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/monopoly/pipeline.py", line 51, in extract
    if not statement.statement_date:
           ^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/functools.py", line 993, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.12/site-packages/monopoly/statements/base.py", line 201, in statement_date
    raise ValueError("Statement date not found")

Hmm I suspect the issue is that the consolidated statement with the current account has a different format -- my own consolidated statement from 2023 Dec doesn't have any issues.

If you're willing to share a redacted version of the statement I could try to take a look

benjamin-awd commented 2 months ago

@bsaurusrex

Could you give it a try with v0.7.1? The issue should be resolved