diff --git a/README.md b/README.md index 1a8765d..26ba003 100644 --- a/README.md +++ b/README.md @@ -284,9 +284,16 @@ Find the ACORD year/month at the bottom left corner of each ACORD page. Often th #### Bank Statements +- [Fifth Third Bank](<./templates/Financial Services/Bank Statements/configurations/5_3_bank.json>) - [Ally (Combined Customer Statement)](<./templates/Financial Services/Bank Statements/configurations/ally_combined_customer_statement.json>) -- [Bank of America](<./templates/Financial Services/Bank Statements/configurations/boa.json>) +- [Bank of America](<./templates/Financial Services/Bank Statements/configurations/bank_of_america.json>) +- [Blue Vine](<./templates/Financial Services/Bank Statements/configurations/blue_vine.json>) +- [BMO](<./templates/Financial Services/Bank Statements/configurations/bmo.json>) +- [Chase (Checking Summary)](<./templates/Financial Services/Bank Statements/configurations/chase_checking_summary.json>) - [Chase (Consolidated Balance Summary)](<./templates/Financial Services/Bank Statements/configurations/chase_consolidated_balance_summary.json>) +- [Frost](<./templates/Financial Services/Bank Statements/configurations/frost.json>) +- [M and T](<./templates/Financial Services/Bank Statements/configurations/m_and_t.json>) +- [Regions Bank](<./templates/Financial Services/Bank Statements/configurations/regions_bank.json>) - [Well Fargo (Checking)](<./templates/Financial Services/Bank Statements/configurations/wells_fargo_checking.json>) - [Well Fargo (Savings)](<./templates/Financial Services/Bank Statements/configurations/wells_fargo_savings.json>) - [Well Fargo (Combined Statement of Accounts)](<./templates/Financial Services/Bank Statements/configurations/wells_fargo_combined_statement_of_accounts.json>) diff --git a/templates/Financial Services/Bank Statements/configurations/5_3_bank.json b/templates/Financial Services/Bank Statements/configurations/5_3_bank.json new file mode 100644 index 0000000..88e3d5b --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/5_3_bank.json @@ -0,0 +1,617 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "Statement Period Date" + }, + { + "type": "startsWith", + "text": "Account Number" + }, + { + "type": "startsWith", + "text": "Banking Center Phone" + }, + { + "type": "startsWith", + "text": "Account Summary" + }, + { + "type": "startsWith", + "text": "Date Paid" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Fifth Third Bank" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "Banking Center Phone", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.2, + "offsetX": -5, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left" + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "Account Type", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.1, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account Type:", + "Account Type" + ] + } + }, + { + "id": "_raw_statement_date", + "anchor": { + "match": { + "text": "Statement Period Date", + "type": "startsWith", + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.1, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Statement Period Date:", + "Statement Period Date" + ] + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": " ", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": "-", + "index": 1 + } + }, //////////////////////// + { // Transforms statement date end to string + "id": "_strings_statement_end_date", + "type": "string", + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { // Extracts the month from the statement end date + "id": "_month_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 1 + } + }, + { // Extracts the year from the statement end date + "id": "_year_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 0 + } + }, + { /// If the month of the statement is 01 = January, it deduces -1 year to the statement year + "id": "__year_deduced", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "var": "_month_from_statement.value" + }, + 1 + ] + }, + { + "-": [ + { + "var": "_year_from_statement.value" + }, + 1 + ] + }, + { + "var": "_year_from_statement.value" + } + ] + } + } + }, + //NOTE: If the Statement month is not January, '_year' and '__year_deduced' will be the same + // + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" + }, + "start": { + "text": "Summary of accounts", + "type": "startsWith" + }, + "end": { + "text": "total", + "type": "startsWith" + } + }, + "match": "all", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1, + "height": 0.3, + "offsetX": 0, + "offsetY": 0.1, + "start": "left", + } + }, + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "/\\d{4}" + }, + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": " ", + "index": 2 + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": " ", + "index": 0 + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.1, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account Number:", + "Account Number" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Account Summary", + "type": "includes", + "reverse": true + }, + "stop": "Account Summary", + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "text": "Account Summary", + "type": "includes" + }, + "match": { + "text": "Beginning Balance", + "type": "includes" + }, + "end": { + "text": "Daily Balance Summary", + "type": "includes" + } + }, + "stop": { + "text": "Daily Balance Summary", + "type": "includes" + } + }, + "fields": [ + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Summary", + "type": "includes" + } + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 4, + "height": 0.2, + "offsetX": -0.05, + "offsetY": -0.05, + "start": "left", + "wordFilters": [ + "Account Summary - ", + "Account Summary" + ] + } + }, + { + "id": "account_type", + "method": { + "id": "copy_to_section", + "source_id": "account_name" + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "Beginning Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 4, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "wordFilters": [ + "Beginning Balance", + ] + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Ending Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 4, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "wordFilters": [ + "Ending Balance", + ] + } + }, + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "items totaling", + "type": "includes", + "reverse": true + }, + "stop": "items totaling", + "offsetY": -0.1, + "stopOffsetY": 0.3 + }, + "anchor": { + "start": { + "text": "items totaling", + "type": "includes" + }, + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}\\b" + }, + } + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}\\b" + }, + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}\\b" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "sortLines": "readingOrderLeftToRight", + "offsetX": 2, + "width": 4, + "height": 0.2, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "debit", + "type": "currency", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}\\b" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Debits", + "sortLines": "readingOrderLeftToRight", + "offsetX": 1, + "width": 1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "credit", + "type": "currency", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}\\b" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Credits", + "sortLines": "readingOrderLeftToRight", + "offsetX": 1, + "width": 1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "region", + "offsetX": 0, + "offsetY": 0, + "width": 0, + "height": 0, + "start": "left" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_raw_statement_date", + "___statement_start_date", + "__statement_start_date", + "_statement_start_date", + "___statement_end_date", + "__statement_end_date", + "_statement_end_date", + "_year", + "_statements_dates", + "_strings_statement_end_date", + "_month_from_statement", + "_year_from_statement", + "__year_deduced" + ] + } + }, + ] +} \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/bank_of_america.json b/templates/Financial Services/Bank Statements/configurations/bank_of_america.json index d8a740a..5114e78 100644 --- a/templates/Financial Services/Bank Statements/configurations/bank_of_america.json +++ b/templates/Financial Services/Bank Statements/configurations/bank_of_america.json @@ -1,445 +1,506 @@ { - "fingerprint": { - "tests": [ - { - "text": "bankofamerica.com", - "type": "endsWith" - } - ] - }, - "fields": [ + "fingerprint": { + "tests": [ { - "id": "start_date", - "type": "date", - "method": { - "id": "passthrough", - "tiebreaker": "<" - }, - "anchor": { - "match": { - "type": "startsWith", - "text": "for", - "isCaseSensitive": true - } - } + "type": "startsWith", + "text": "bankofamerica" }, { - "id": "end_date", - "type": "date", - "method": { - "id": "passthrough", - "tiebreaker": ">" - }, - "anchor": { - "match": { - "type": "startsWith", - "text": "for", - "isCaseSensitive": true - } - } + "type": "startsWith", + "text": "Account Number" }, { - "id": "customer_name", - "method": { - "id": "region", - "start": "left", - "offsetX": -5.5, - "offsetY": 0.3, - "width": 3.2, - "height": 1.8, - "typeFilters": [ - "address" - ] - }, - "anchor": { - "match": { - "type": "startsWith", - "text": "customer service information" - } - } + "type": "startsWith", + "text": "Account Summary" }, { - "id": "customer_address", - "type": "address", - "method": { - "id": "region", - "start": "left", - "offsetX": -5.5, - "offsetY": 0.3, - "width": 3.2, - "height": 1.8 + "type": "startsWith", + "text": "Beginning balance" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Bank of Anerica" + } + }, + { + "id": "account_holder_name", + "anchor": { + "start": { + "text": "Business", + "type": "includes" }, - "anchor": { - "match": { - "type": "startsWith", - "text": "customer service information" - } + "match": { + "text": "bankofamerica", + "type": "startsWith" + }, + "end": { + "text": "Box", + "type": "includes" } }, - { - "id": "_account_summary_table_raw", - "type": "table", - "method": { - "id": "textTable", - "columns": [ - { - "id": "account_name", - "minX": 0.25, - "maxX": 3.5 - }, - { - "id": "account_number", - "minX": 3.5, - "maxX": 5.8 - }, - { - "id": "beginning_balance", - "minX": 0, - "maxX": 0, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true - }, - { - "id": "end_balance", - "minX": 5.8, - "maxX": 7.5, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true - } - ], - "stop": [ - { - "text": "total balance", - "type": "startsWith" - }, - { - "type": "first" - }, - { - "type": "first" - } - ] + "method": { + "id": "region", + "start": "left", + "offsetX": -5, + "offsetY": 0, + "width": 3.5, + "height": 0.6, + "tiebreaker": "first", + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "ACCOUNT NO", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "start": "left", + "height": 0.15, + "offsetX": -3, + "offsetY": -0.05, + "wordFilters": [ + ":" + ] + } + }, + { + "id": "statement_start_date", + "anchor": "Beginning balance on", + "type": "date", + "method": { + "id": "region", + "width": 4, + "offsetX": -0.1, + "start": "left", + "height": 0.2, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Beginning balance on " + ] + } + }, + { + "id": "statement_end_date", + "anchor": "ending balance on", + "type": "date", + "method": { + "id": "region", + "width": 4, + "offsetX": -0.1, + "start": "left", + "height": 0.2, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "ending balance on " + ] + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "match": "first", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 3, + "height": 0.2, + "offsetX": -0.1, + "offsetY": -0.08, + "start": "left", + "wordFilters": [ + "Account number:", + "Account number:" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Account number", + "type": "startsWith", + "reverse": true + }, + "stop": { + "text": "Account number", + "type": "startsWith" + }, + "stopOffsetY": 0.1, + "offsetY": -0.1 }, "anchor": { + "start": { + "text": "Account number", + "type": "startsWith" + }, "match": { - "type": "startsWith", - "text": "Your combined statement" + "text": "Account Summary", + "type": "startsWith" + }, + "end": { + "text": "Total withdrawals and other debits", + "type": "equals" } + }, + "stop": { + "text": "Total withdrawals and other debits", + "type": "equals" } - } - ], - "sections": [ - { - "id": "accounts", - "range": { + }, + "fields": [ + { + "id": "account_number", "anchor": { "match": { - "pattern": "^Your [A-Z]", - "type": "regex" + "text": "Account number", + "type": "startsWith", + "isCaseSensitive": true } + }, + "match": "first", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 3, + "height": 0.2, + "offsetX": -0.1, + "offsetY": -0.08, + "start": "left", + "wordFilters": [ + "Account number:", + "Account number:" + ] + } + }, + { + "id": "account_type", + "anchor": "null not found", + "method": { + "id": "passthrough" } }, - "fields": [ - { - "id": "account_type", - "method": { - "id": "label", - "position": "right" + { + "id": "opening_balance", + "anchor": { + "start": { + "text": "Account summary", + "type": "startsWith" }, - "anchor": { - "match": { - "text": "Your", - "type": "startsWith", - "isCaseSensitive": true - } + "match": { + "text": "Beginning balance on", + "type": "startsWith" } }, - { - "id": "account_number", - "anchor": { - "match": { - "text": "account number:", - "type": "startsWith" - } + "type": "currency", + "method": { + "id": "row", + "position": "right", + "tiebreaker": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "closing_balance", + "anchor": { + "start": { + "text": "Account summary", + "type": "startsWith" }, - "method": { - "id": "label", - "position": "right" + "match": { + "text": "Ending balance on", + "type": "startsWith" } }, - { - "id": "beginning_balance", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "type": "currency", + "method": { + "id": "row", + "position": "right", + "tiebreaker": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "_credits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Deposits and other credits", + "type": "startsWith", + "reverse": true, + }, + "stop": "Description", + "offsetY": -0.1, + "stopOffsetY": 0.1 }, "anchor": { - "match": { - "text": "beginning balance", + "start": { + "text": "Ending balance on", "type": "startsWith" - } - }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "deposits", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "anchor": { + }, "match": { - "text": "deposits", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$", + "type": "regex" + }, + "end": { + "text": "Total deposits and other credits", "type": "startsWith" } }, - "method": { - "id": "row", - "position": "right" - } + "stop": { + "text": "Total deposits and other credits", + "type": "startsWith" + }, + "stopOffsetY": -0.1 }, - { - "id": "withdrawals", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "fields": [ + { + "id": "date", + "type": "date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } + }, + "method": { + "id": "passthrough" + } }, - "anchor": { - "match": { - "text": "withdrawals", - "type": "startsWith" + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } }, - "end": "ending balance" + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "height": 0.5, + "offsetX": 2.2, + "offsetY": 0.1, + "width": 5, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description" + ] + } }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "withdrawals", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + { + "id": "debit", + "anchor": "null not found", + "method": { + "id": "passthrough" + } }, - "anchor": { - "match": { - "text": "atm and debit card subtractions", - "type": "startsWith" + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } }, - "end": "ending balance" - }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "end_balance", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Amount", + "height": 0.5, + "offsetX": 0, + "offsetY": 0.1, + "width": 1, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } }, - "anchor": { - "match": { - "text": "ending balance", - "type": "startsWith" + { + "id": "balance", + "anchor": "null not found", + "method": { + "id": "passthrough" } }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "_deposits_table_raw", - "type": "table", + ] + }, + { + "id": "_debits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Withdrawals and other debits", + "type": "startsWith", + "reverse": true, + }, + "stop": "Description", + "offsetY": -0.1, + "stopOffsetY": 0.1 + }, "anchor": { - "match": [ - { - "text": "ending balance on", - "type": "startsWith" - }, + "start": [ { - "text": "Deposits and other", + "text": "Total deposits and other credits", "type": "startsWith" } - ] - }, - "method": { - "id": "textTable", - "columns": [ - { - "id": "date", - "minX": 0.3, - "maxX": 1.15, - "type": "date" - }, - { - "id": "description", - "minX": 1.15, - "maxX": 7 - }, - { - "id": "amount", - "minX": 7.2, - "maxX": 8.2, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true - } ], - "stop": { - "text": "total deposits", + "match": { + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$", + "type": "regex" + }, + "end": { + "text": "Total withdrawals and other debits", "type": "startsWith" } - } - }, - { - "id": "_withdrawals_table_raw", - "type": "table", - "anchor": { - "match": [ - { - "text": "ending balance on", - "type": "startsWith" - }, - { - "text": "withdrawals and other", - "type": "startsWith" - } - ] }, - "method": { - "id": "textTable", - "columns": [ - { - "id": "date", - "minX": 0.3, - "maxX": 1.15, - "type": "date" - }, - { - "id": "description", - "minX": 1.15, - "maxX": 5.8 - }, - { - "id": "amount", - "minX": 7.2, - "maxX": 8.2, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true - } - ], - "stop": { + "stop": [ + { "type": "any", "matches": [ { - "text": "total withdrawals", + "text": "Total withdrawals and other debits", + "type": "startsWith" + }, + { + "text": "Subtotal for card account", "type": "startsWith" }, { - "pattern": "^Total .+ subtractions$", - "type": "regex" + "text": "card account", + "type": "startsWith" } ] } - } - }, - { - "id": "_transaction_table_raw", - "type": "table", - "anchor": "not applicable to BOA", - "method": { - "id": "passthrough" - } - } - ], - "computed_fields": [ - { - "id": "deposits_table", - "method": { - "id": "zip", - "source_ids": [ - "_deposits_table_raw" - ] - } - }, - { - "id": "withdrawals_table", - "method": { - "id": "zip", - "source_ids": [ - "_withdrawals_table_raw" - ] - } + ], + "stopOffsetY": -0.1 }, - { - "id": "transaction_table", - "method": { - "id": "zip", - "source_ids": [ - "_transaction_table_raw" - ] - } - }, - { - "id": "suppress", - "method": { - "id": "suppressOutput", - "source_ids": [ - "_deposits_table_raw", - "_withdrawals_table_raw", - "_transaction_table_raw" + "fields": [ + { + "id": "date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "height": 0.5, + "offsetX": 2.2, + "offsetY": 0.1, + "width": 5, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description" + ] + } + }, + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12][0-9]|3[01])/\\d{2}$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Amount", + "height": 0.5, + "offsetX": 0, + "offsetY": 0.1, + "width": 1, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "credit", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + { + "id": "balance", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + ] + } + ], + "computed_fields": [ + { + "id": "transaction_data", + "method": { + "id": "customComputation", + "jsonLogic": { + "merge": [ + { + "var": "_credits_transaction_data" + }, + { + "var": "_debits_transaction_data" + } ] } } - ] - } - ], - "computed_fields": [ - { - "id": "account_summary_table", - "type": "table", - "method": { - "id": "zip", - "source_ids": [ - "_account_summary_table_raw" - ] - } - }, - { - "id": "suppress", - "method": { - "id": "suppressOutput", - "source_ids": [ - "_account_summary_table_raw" - ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_credits_transaction_data", + "_debits_transaction_data" + ] + } } - } - ] - } \ No newline at end of file + ] + } + ] +} \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/blue_vine.json b/templates/Financial Services/Bank Statements/configurations/blue_vine.json new file mode 100644 index 0000000..cf1d332 --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/blue_vine.json @@ -0,0 +1,300 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "Bluevine" + }, + { + "type": "startsWith", + "text": "Account statement" + }, + { + "type": "startsWith", + "text": "Summary" + }, + { + "type": "startsWith", + "text": "Beginning balance" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Blue Vine" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "Account Statement", + "type": "equals", + }, + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 2.5, + "height": 1.5, + "offsetY": -1.5, + "offsetX": -0.05, + "start": "left", + "tiebreaker": "first" + } + }, + { + "id": "account_name", + "anchor": "null no found", + "method": { + "id": "passthrough" + } + }, + { + "id": "statement_start_date", + "type": "date", + "anchor": { + "match": { + "text": "Beginning balance on", + "type": "startsWith" + }, + }, + "method": { + "id": "region", + "offsetX": -0.1, + "offsetY": -0.1, + "width": 2.5, + "height": 0.35, + "start": "left" + } + }, + { + "id": "statement_end_date", + "type": "date", + "anchor": { + "match": { + "text": "Ending balance on", + "type": "startsWith" + }, + }, + "method": { + "id": "region", + "offsetX": -0.1, + "offsetY": -0.1, + "width": 2.5, + "height": 0.35, + "start": "left" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "start": "left", + "width": 5, + "offsetX": -0.02, + "height": 0.3, + "offsetY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account Number:", + "Account Number" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "Account statement", + "type": "equals" + }, + "match": { + "text": "Account Number", + "type": "startsWith" + }, + "end": { + "text": "In case of errors or questions", + "type": "startsWith" + } + }, + "stop": { + "text": "In case of errors or questions", + "type": "startsWith" + } + }, + /*/// accounts /// + account_number + account_type + opening_balance + closing_balance*/ + "fields": [ + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "start": "left", + "width": 5, + "offsetX": -0.02, + "height": 0.3, + "offsetY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account Number:", + "Account Number" + ] + } + }, + { + "id": "account_type", + "anchor": "null no found", + "method": { + "id": "passthrough" + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "Beginning Balance on", + "type": "startsWith" + } + }, + "type": "currency", + "method": { + "id": "region", + "width": 2, + "offsetX": 0.2, + "start": "right", + "height": 0.3, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Ending balance on", + "type": "startsWith" + } + }, + "type": "currency", + "method": { + "id": "region", + "width": 2, + "offsetX": -0.2, + "start": "right", + "height": 0.3, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Description", + "type": "equals", + "reverse": true + }, + "stop": "Description", + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": "Transactions", + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}/\\d{2}\\b" + } + } + }, + "fields": [ + { + "id": "date", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}/\\d{2}\\b" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}/\\d{2}/\\d{2}\\b" + } + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "sortLines": "readingOrderLeftToRight", + "percentOverlapX": 0, + "percentOverlapY": 0, + "width": 2, + "height": 0.1, + "offsetX": 1 + } + }, + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\$\\-\\d+(?:\\.\\d{2})?" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\$\\d+(?:\\.\\d{2})?" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "balance", + "anchor": "null not found on this document", + "method": { + "id": "passthrough" + } + } + ] + } + ] + } + ] + } \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/bmo.json b/templates/Financial Services/Bank Statements/configurations/bmo.json new file mode 100644 index 0000000..d95082e --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/bmo.json @@ -0,0 +1,365 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "BANK OF AMERICA ACCOUNT DETAILS" + }, + { + "type": "startsWith", + "text": "Bank Account ID", + "isCaseSensitive": true + }, + { + "type": "startsWith", + "text": "Account Type", + "isCaseSensitive": true + }, + { + "type": "startsWith", + "text": "SUMMARY", + "isCaseSensitive": true + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "BMO" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "Bank Account ID", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 2.5, + "height": 0.6, + "offsetX": -4.25, + "offsetY": -0.2, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0 + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "Account Type", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.3, + "offsetX": 0.7, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight", + "start": "right", + "wordFilters": [ + "Account Type:", + "Account Type" + ] + } + }, + { + "id": "_raw_statement_date", + "anchor": { + "match": { + "text": "Statement Period", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.2, + "offsetX": 0.2, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight", + "start": "right", + "wordFilters": [ + "Account Type:", + "Account Type" + ] + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": "to", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": "to", + "index": 1 + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Bank Account ID", + "type": "startsWith" + }, + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.2, + "offsetX": 0.6, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight", + "start": "right", + "wordFilters": [ + "Account Type:", + "Account Type" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "SUMMARY", + "type": "equals" + }, + "match": { + "text": "Deposits & Credits", + "type": "startsWith" + }, + }, + "offsetY": -0.5, + "stop": { + "text": "Opening Balance", + "type": "startsWith" + }, + "stopOffsetY": -0.1 + }, + "fields": [ + { + "id": "account_number", + "method": { + "id": "copy_to_section", + "source_id": "account_number" + } + }, + { + "id": "account_type", + "method": { + "id": "copy_to_section", + "source_id": "account_name" + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "Opening Balance", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.2, + "offsetX": 1, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight", + "start": "right", + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Closing Balance", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.2, + "offsetX": 1, + "offsetY": -0.1, + "sortLines": "readingOrderLeftToRight", + "start": "right", + } + }, + { + "id": "transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Particulars", + "type": "equals", + "reverse": true, + }, + "stop": { + "text": "Particulars", + "type": "equals" + }, + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "type": "startsWith", + "text": "TRANSACTION DETAILS" + }, + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "stopOffsetY": -0.1 + }, + "fields": [ + { + "id": "date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "method": { + "id": "intersection", + "verticalAnchor": "Particulars", + "width": 3, + "height": 0.3, + "offsetX": 1.2, + "percentOverlapX": 0, + "percentOverlapY": 0, + } + }, + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Withdrawals", + "width": 0.7, + "height": 0.3, + "offsetX": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0, + } + }, + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Deposits", + "width": 0.7, + "height": 0.3, + "offsetX": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + } + }, + { + "id": "_balance", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])-(\\d{4})$" + } + }, + "type": { + "id": "replace", + "pattern": "$-", + "replaceWith": "-$" + }, + "method": { + "id": "intersection", + "verticalAnchor": "Balance", + "width": 0.7, + "height": 0.3, + "offsetX": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0, + } + }, + { + "id": "balance", + "type": "currency", + "method": { + "id": "concat", + "source_ids": [ + "_balance" + ] + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_balance", + ] + } + } + ] + } + ] + }, + + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_raw_statement_date", + ] + } + } + ] + } \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/chase_checking_summary.json b/templates/Financial Services/Bank Statements/configurations/chase_checking_summary.json new file mode 100644 index 0000000..da0562c --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/chase_checking_summary.json @@ -0,0 +1,948 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "Chase Bank" + }, + { + "type": "startsWith", + "text": "Account" + }, + { + "type": "startsWith", + "text": "customer service" + }, + { + "type": "startsWith", + "text": "Checking Summary" + }, + { + "type": "startsWith", + "text": "Beginning balance" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Chase Bank" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "International Calls", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 1, + "offsetX": -4.5, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0 + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "INSTANCES", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.4, + "offsetX": -0.3, + "offsetY": -0.4, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0, + "wordFilters": [ + "instances", + "amount" + ] + } + }, + { + "id": "_statement_end_start_date", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith", + "isCaseSensitive": true + }, + "end": { + "text": "Web", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.4, + "offsetX": -0.3, + "offsetY": -0.4, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0, + "wordFilters": [ + "instances", + "amount" + ] + } + }, + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "\\d{4}" + }, + "method": { + "id": "concat", + "source_ids": [ + "_statement_end_start_date" + ] + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statement_end_start_date", + "separator": "through", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statement_end_start_date", + "separator": "through", + "index": 1 + } + }, //////////////////////// + { // Transforms statement date end to string + "id": "_strings_statement_end_date", + "type": "string", + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { // Extracts the month from the statement end date + "id": "_month_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 1 + } + }, + { // Extracts the year from the statement end date + "id": "_year_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 0 + } + }, + { /// If the month of the statement is 01 = January, it deduces -1 year to the statement year + "id": "__year_deduced", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "var": "_month_from_statement.value" + }, + 1 + ] + }, + { + "-": [ + { + "var": "_year_from_statement.value" + }, + 1 + ] + }, + { + "var": "_year_from_statement.value" + } + ] + } + } + }, + //NOTE: If the Statement month is not January, '_year' and '__year_deduced' will be the same + // + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" + }, + "start": { + "text": "Summary of accounts", + "type": "startsWith" + }, + "end": { + "text": "total", + "type": "startsWith" + } + }, + "match": "all", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1, + "height": 0.3, + "offsetX": 0, + "offsetY": 0.1, + "start": "left", + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.1, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account Number:", + "Account Number" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "Beginning Balance", + "type": "startsWith" + }, + "match": { + "text": "Beginning Balance", + "type": "startsWith" + } + }, + "stop": { + "text": "DAILY ENDING BALANCE", + "type": "startsWith" + } + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account Number", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.1, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account Number:", + "Account Number" + ] + } + }, + { + "id": "account_type", + "method": { + "id": "copy_to_section", + "source_id": "account_name" + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "Beginning Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 6, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "tiebreaker": "last", + "wordFilters": [ + "Beginning Balance", + ] + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Ending Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 6, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "tiebreaker": "last", + "wordFilters": [ + "Ending Balance", + ] + } + }, + { + "id": "_credits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Description", + "type": "equals", + "reverse": true + }, + "stop": "Description", + "offsetY": -0.1, + "stopOffsetY": 0.1 + }, + "anchor": { + "start": { + "text": "DEPOSITS AND ADDITIONS", + "type": "startsWith" + }, + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + "end": { + "text": "Total Deposits and Additions", + "type": "startsWith" + }, + }, + "stop": { + "text": "Total Deposits and Additions", + "type": "startsWith" + }, + "stopOffsetY": -0.1 + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "__date", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "_date", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "width": 4, + "offsetX": 1.7, + "height": 0.5, + "offsetY": 0.2, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description/" + ] + } + }, + { + "id": "debit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "amount", + "width": 1, + "offsetX": 0, + "height": 0.5, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description/" + ] + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__date", + "_date", + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "_debits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Description", + "type": "equals", + "reverse": true + }, + "stop": "Description", + "offsetY": -0.1, + "stopOffsetY": 0.1 + }, + "anchor": { + "start": [ + { + "type": "any", + "matches": [ + { + "text": "Total ATM & Debit Card Withdrawals", + "type": "startsWith" + }, + { + "text": "ELECTRONIC WITHDRAWALS", + "type": "startsWith" + }, + ] + } + ], + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + "end": { + "text": "Total Electronic Withdrawals", + "type": "startsWith" + }, + }, + "stop": [ + { + "type": "any", + "matches": [ + { + "text": "Total ATM & Debit Card Withdrawals", + "type": "startsWith" + }, + { + "text": "Total Electronic Withdrawals", + "type": "startsWith" + }, + ] + } + ], + "stopOffsetY": -0.1 + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "__date", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "_date", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "width": 4, + "offsetX": 1.7, + "height": 0.5, + "offsetY": 0.2, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description/" + ] + } + }, + { + "id": "debit", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex", + "xRangeFilter": { + "minX": 0, + "maxX": 1.4 + } + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "amount", + "width": 1, + "offsetX": 0, + "height": 0.5, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description/" + ] + } + }, + { + "id": "credit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__date", + "_date", + "_year", + "__year_deduced", + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ], + "computed_fields": [ + { + "id": "transaction_data", + "method": { + "id": "customComputation", + "jsonLogic": { + "merge": [ + { + "var": "_credits_transaction_data" + }, + { + "var": "_debits_transaction_data" + } + ] + } + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_credits_transaction_data", + "_debits_transaction_data", + "_year" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_statement_end_start_date", + "_year", + "_statements_dates", + "_strings_statement_end_date", + "_month_from_statement", + "_year_from_statement", + "__year_deduced" + ] + } + }, + ] +} \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/frost.json b/templates/Financial Services/Bank Statements/configurations/frost.json new file mode 100644 index 0000000..81d96ea --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/frost.json @@ -0,0 +1,840 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "STATEMENT ISSUED" + }, + { + "type": "startsWith", + "text": "Page" + }, + { + "type": "includes", + "text": "Frost" + }, + { + "type": "startsWith", + "text": "DESCRIPTION" + }, + ] + }, + "preprocessors": [ + { + "type": "splitLines", + "minSpaces": 2 + } + ], + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Frost Bank" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "Page 1", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "start": "left", + "offsetX": -5, + "offsetY": 0, + "width": 3.5, + "height": 0.6, + "tiebreaker": "first", + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "ACCOUNT NO", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "start": "left", + "height": 0.15, + "offsetX": -3, + "offsetY": -0.05, + "wordFilters": [ + ":" + ] + } + }, + { + "id": "statement_start_date", + "anchor": "looking for anchor", + "method": { + "id": "passthrough" + } + }, + { + "id": "statement_end_date", + "anchor": { + "match": { + "text": "STATEMENT ISSUED", + "type": "equals", + "isCaseSensitive": true + } + }, + "type": "date", + "method": { + "id": "region", + "width": 2, + "height": 0.4, + "offsetX": -0.2, + "offsetY": -0.1, + "start": "left" + } + }, //////////////////////// + { // Transforms statement date end to string + "id": "_strings_statement_end_date", + "type": "string", + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { // Extracts the month from the statement end date + "id": "_month_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 1 + } + }, + { // Extracts the year from the statement end date + "id": "_year_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 0 + } + }, + { /// If the month of the statement is 01 = January, it deduces -1 year to the statement year + "id": "__year_deduced", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "var": "_month_from_statement.value" + }, + 1 + ] + }, + { + "-": [ + { + "var": "_year_from_statement.value" + }, + 1 + ] + }, + { + "var": "_year_from_statement.value" + } + ] + } + } + }, + //NOTE: If the Statement month is not January, '_year' and '__year_deduced' will be the same + // + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "-\\d{4}" + }, + "anchor": { + "match": { + "text": "STATEMENT ISSUED", + "type": "equals", + "isCaseSensitive": true + } + }, + "method": { + "id": "region", + "width": 2, + "height": 0.4, + "offsetX": -0.2, + "offsetY": -0.1, + "start": "left" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "ACCOUNT NO", + "type": "startsWith" + } + }, + "match": "first", + "type": { + "id": "replace", + "pattern": "[¬_]+", + "replaceWith": "" + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 2, + "height": 0.02, + "offsetX": -0.1, + "offsetY": -0.0, + "start": "right", + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "ACCOUNT NO", + "type": "startsWith", + "reverse": true + }, + "stop": { + "text": "ACCOUNT NO", + "type": "startsWith" + }, + "offsetY": -0.1, + "stopOffsetY": 0.1 + }, + "anchor": { + "start": { + "text": "ACCOUNT NO", + "type": "startsWith" + }, + "match": { + "text": "BALANCE THIS STATEMENT", + "type": "includes" + }, + "end": { + "text": "DAILY BALANCE", + "type": "includes" + } + }, + "stop": { + "text": "DAILY BALANCE", + "type": "includes" + } + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "ACCOUNT NO", + "type": "startsWith" + } + }, + "match": "first", + "type": { + "id": "replace", + "pattern": "[¬_]+", + "replaceWith": "" + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 2, + "height": 0.02, + "offsetX": -0.1, + "offsetY": -0.0, + "start": "right", + } + }, + { + "id": "account_type", + "anchor": { + "match": { + "text": "ACCOUNT NO", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 3, + "height": 0.15, + "offsetX": -3, + "offsetY": -0.05, + "start": "left" + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "BALANCE LAST STATEMENT", + "type": "startsWith", + }, + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1.5, + "height": 0.1, + "offsetX": 0, + "offsetY": 0.1, + "start": "left" + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "BALANCE THIS STATEMENT", + "type": "startsWith", + }, + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1.5, + "height": 0.1, + "offsetX": 0, + "offsetY": 0.1, + "start": "left" + } + }, + { + "id": "_credits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "DESCRIPTION", + "type": "equals", + "reverse": true + }, + "stop": "DESCRIPTION", + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "pattern": "DEPOSITS/?CREDITS", + "type": "regex" + }, + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + "end": { + "pattern": "/?DEBITS", + "type": "regex" + } + }, + }, + "requiredFields": [ + "transaction_type" + ], + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "-" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Transaction", + "width": 1, + "height": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Amount", + "width": 1, + "height": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "debit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "region", + "offsetX": 0, + "offsetY": 0, + "width": 0, + "height": 0, + "start": "left" + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "region", + "offsetX": 0, + "offsetY": 0, + "width": 0, + "height": 0, + "start": "left" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_date", + "_year", + "__date", + "_date_year", + "__year_deduced", + "_date__year_deduced" + ] + } + } + ] + }, + { + "id": "_debits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "DESCRIPTION", + "type": "equals", + "reverse": true + }, + "stop": "DESCRIPTION", + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "pattern": "/?DEBITS", + "type": "regex" + }, + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + "end": { + "text": "DAILY BALANCE", + "type": "includes" + } + }, + }, + "requiredFields": [ + "transaction_type" + ], + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "-" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year", + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Transaction", + "width": 1, + "height": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "region", + "offsetX": 0, + "offsetY": 0, + "width": 0, + "height": 0, + "start": "left" + } + }, + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "\\b\\d{2}-\\d{2}\\b" + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Amount", + "width": 1, + "height": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "region", + "offsetX": 0, + "offsetY": 0, + "width": 0, + "height": 0, + "start": "left" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_date", + "_year", + "__date", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ], + "computed_fields": [ + { + "id": "transaction_data", + "method": { + "id": "customComputation", + "jsonLogic": { + "merge": [ + { + "var": "_credits_transaction_data" + }, + { + "var": "_debits_transaction_data" + } + ] + } + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_credits_transaction_data", + "_debits_transaction_data", + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "___statement_start_date", + "__statement_start_date", + "_statement_start_date", + "___statement_end_date", + "__statement_end_date", + "_statement_end_date", + "_year", + "_statements_dates", + "_strings_statement_end_date", + "_month_from_statement", + "_year_from_statement", + "__year_deduced" + ] + } + } + ] + } \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/m_and_t.json b/templates/Financial Services/Bank Statements/configurations/m_and_t.json new file mode 100644 index 0000000..c591943 --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/m_and_t.json @@ -0,0 +1,406 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "M&T" + }, + { + "type": "startsWith", + "text": "ACCOUNT NUMBER", + "isCaseSensitive": true + }, + { + "type": "startsWith", + "text": "BEGINNING BALANCE", + "isCaseSensitive": true + }, + { + "type": "startsWith", + "text": "ACCOUNT ACTIVITY", + "isCaseSensitive": true + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "M&T" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "BEGINNING BALANCE", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 1, + "offsetX": -4, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0 + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "Account Type", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.32, + "offsetX": -1, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account Type:", + "Account Type" + ] + } + }, + { + "id": "_raw_statement_date", + "anchor": { + "match": { + "text": "STATEMENT PERIOD", + "type": "startsWith", + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.31, + "offsetX": -0.05, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Statement Period", + ] + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": " ", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_raw_statement_date", + "separator": "-", + "index": 1 + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" + }, + }, + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1, + "height": 0.2, + "offsetX": 0, + "offsetY": 0.1, + "start": "left", + } + }, + { + "id": "raw_beginning_balance", + "anchor": { + "match": { + "text": "BEGINNING BALANCE", + "type": "startsWith", + "isCaseSensitive": true + }, + "end": { + "text": "DEPOSITS", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "type": "currency", + "method": { + "id": "region", + "start": "right", + "width": 1.5, + "height": 0.2, + "offsetX": 0.3, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "raw_ending_balance", + "anchor": { + "match": { + "text": "ENDING BALANCE", + "type": "startsWith", + "isCaseSensitive": true + }, + "end": { + "text": "ACCOUNT ACTIVITY", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "type": "currency", + "method": { + "id": "region", + "start": "right", + "width": 1.8, + "height": 0.2, + "offsetX": 0.3, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "TRANSACTION DESCRIPTION", + "type": "equals", + "reverse": true + }, + "stop": { + "text": "TRANSACTION DESCRIPTION", + "type": "equals" + }, + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "text": "ACCOUNT ACTIVITY", + "type": "equals", + }, + "match": { + "type": "equals", + "text": "TRANSACTION DESCRIPTION" + } + }, + "stop": { + "type": "equals", + "text": "null no stop" + }, + "requireStop": true + }, + "fields": [ + { + "id": "account_number", + "method": { + "id": "copy_to_section", + "source_id": "account_number" + } + }, + { + "id": "account_type", + "method": { + "id": "copy_to_section", + "source_id": "account_name" + } + }, + { + "id": "opening_balance", + "method": { + "id": "copy_to_section", + "source_id": "raw_beginning_balance" + } + }, + { + "id": "closing_balance", + "method": { + "id": "copy_to_section", + "source_id": "raw_ending_balance" + } + }, + { + "id": "transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "TRANSACTION DESCRIPTION", + "type": "equals", + "reverse": true, + }, + "stop": { + "text": "TRANSACTION DESCRIPTION", + "type": "equals" + }, + "stopOffsetY": 0.1, + "offsetY": -0.1 + }, + "anchor": { + "start": { + "text": "TRANSACTION DESCRIPTION", + "type": "equals" + }, + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "stop": { + "text": "NUMBER OF DEPOSITS", + "type": "startsWith" + }, + "stopOffsetY": -0.1 + }, + "requiredFields": [ + "date" + ], + "fields": [ + { + "id": "date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "type": "date", + "method": { + "id": "passthrough" + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "method": { + "id": "intersection", + "verticalAnchor": { + "match": { + "text": "TRANSACTION DESCRIPTION", + "type": "startsWith" + } + }, + "width": 3, + "height": 0.3, + "offsetY": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": { + "match": { + "text": "WITHDRAWALS", + "type": "startsWith" + } + }, + "width": 0.8, + "height": 0.3, + "offsetY": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": { + "match": { + "text": "DEPOSITS", + "type": "startsWith" + } + }, + "width": 0.8, + "height": 0.3, + "offsetY": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + { + "id": "balance", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0[1-9]|1[0-2])/(0[1-9]|[12]\\d|3[01])/(\\d{4})$" + } + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": { + "match": { + "text": "BALANCE", + "type": "startsWith" + } + }, + "width": 0.8, + "height": 0.3, + "offsetY": 0.1, + "percentOverlapX": 0, + "percentOverlapY": 0 + } + }, + ] + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_raw_statement_date", + "raw_beginning_balance", + "raw_ending_balance" + ] + } + } + ] + } \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/regions_bank.json b/templates/Financial Services/Bank Statements/configurations/regions_bank.json new file mode 100644 index 0000000..1c4bf87 --- /dev/null +++ b/templates/Financial Services/Bank Statements/configurations/regions_bank.json @@ -0,0 +1,813 @@ +{ + "fingerprint": { + "tests": [ + { + "type": "startsWith", + "text": "Regions Bank" + }, + { + "type": "startsWith", + "text": "Account" + }, + { + "type": "startsWith", + "text": "Summary" + }, + { + "type": "startsWith", + "text": "Beginning balance" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Regions Bank" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "ACCOUNT", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 1, + "offsetX": -5, + "offsetY": -0.7, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0 + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "SUMMARY", + "type": "equals", + "isCaseSensitive": true + } + }, + "method": { + "id": "region", + "width": 4.5, + "height": 0.6, + "offsetX": -1.5, + "offsetY": -0.9, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 0, + } + }, + { + "id": "_statement_end_start_date", + "anchor": { + "match": { + "text": "SUMMARY", + "type": "equals", + "isCaseSensitive": true + }, + "end": { + "text": "Beginning Balance", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 4.5, + "height": 0.6, + "offsetX": -1.5, + "offsetY": -0.9, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "tiebreaker": 1, + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statement_end_start_date", + "separator": "through", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statement_end_start_date", + "separator": "through", + "index": 1 + } + }, //////////////////////// + { // Transforms statement date end to string + "id": "_strings_statement_end_date", + "type": "string", + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { // Extracts the month from the statement end date + "id": "_month_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 1 + } + }, + { // Extracts the year from the statement end date + "id": "_year_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 0 + } + }, + { /// If the month of the statement is 01 = January, it deduces -1 year to the statement year + "id": "__year_deduced", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "var": "_month_from_statement.value" + }, + 1 + ] + }, + { + "-": [ + { + "var": "_year_from_statement.value" + }, + 1 + ] + }, + { + "var": "_year_from_statement.value" + } + ] + } + } + }, + //NOTE: If the Statement month is not January, '_year' and '__year_deduced' will be the same + // + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" + }, + "start": { + "text": "Summary of accounts", + "type": "startsWith" + }, + "end": { + "text": "total", + "type": "startsWith" + } + }, + "match": "all", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1, + "height": 0.3, + "offsetX": 0, + "offsetY": 0.1, + "start": "left", + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_statement_end_start_date" + ] + } + }, + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "\\d{4}" + }, + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "ACCOUNT", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.25, + "offsetX": -0.05, + "offsetY": -0.09, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account #", + "Account" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "SUMMARY", + "type": "equals" + }, + "match": { + "text": "Beginning balance", + "type": "startsWith" + }, + "end": { + "text": "Total Withdrawals", + "type": "equals" + } + }, + "stop": { + "text": "Total Withdrawals", + "type": "equals" + } + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "account_type", + "method": { + "id": "copy_to_section", + "source_id": "account_name" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "ACCOUNT", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3, + "height": 0.25, + "offsetX": -0.05, + "offsetY": -0.09, + "sortLines": "readingOrderLeftToRight", + "start": "left", + "wordFilters": [ + "Account #", + "Account" + ] + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "Beginning Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 4, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "tiebreaker": "last", + "wordFilters": [ + "Beginning Balance", + ] + } + }, + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Ending Balance", + "type": "includes" + } + }, + "type": "currency", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 4, + "height": 0.1, + "offsetX": -0.3, + "offsetY": -0.05, + "start": "left", + "tiebreaker": "last", + "wordFilters": [ + "Ending Balance", + ] + } + }, + { + "id": "_credits_transaction_data", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "DEPOSITS & CREDITS", + "type": "startsWith", + "isCaseSensitive": true + }, + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + }, + "end": { + "text": "Total deposits", + "type": "startsWith" + } + }, + "stop": { + "text": "Total deposits", + "type": "startsWith" + }, + "stopOffsetY": -0.1 + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "__date", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "method": { + "id": "region", + "start": "right", + "width": 3.5, + "height": 0.25, + "offsetX": 0.05, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "debit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "type": "currency", + "method": { + "id": "region", + "start": "right", + "width": 5, + "height": 0.25, + "offsetX": 5, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "_debits_transaction_data", + "type": "sections", + "range": { + "anchor": { + "start": { + "text": "Total Deposits", + "type": "startsWith", + "isCaseSensitive": true + }, + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + }, + "end": { + "text": "Total Withdrawals", + "type": "startsWith" + } + }, + "stop": { + "text": "Total Withdrawals", + "type": "startsWith" + }, + "stopOffsetY": -0.1 + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "__date", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "method": { + "id": "region", + "start": "right", + "width": 3.5, + "height": 0.25, + "offsetX": 0.05, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "debit", + "anchor": { + "match": { + "pattern": "^\\d{2}/\\d{2}$", + "type": "regex" + } + }, + "type": "currency", + "method": { + "id": "region", + "start": "right", + "width": 5, + "height": 0.25, + "offsetX": 5, + "offsetY": -0.07, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "balance", + "anchor": { + "match": { + "text": "not found on this doc", + "type": "equals" + } + }, + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ], + "computed_fields": [ + { + "id": "transaction_data", + "method": { + "id": "customComputation", + "jsonLogic": { + "merge": [ + { + "var": "_credits_transaction_data" + }, + { + "var": "_debits_transaction_data" + } + ] + } + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_credits_transaction_data", + "_debits_transaction_data" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "_statements_dates", + "_strings_statement_end_date", + "_month_from_statement", + "_year_from_statement", + "__year_deduced" + ] + } + } + ] + } \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/configurations/wells_fargo_combined_statement_of_accounts.json b/templates/Financial Services/Bank Statements/configurations/wells_fargo_combined_statement_of_accounts.json index 30a26aa..d26a9b7 100644 --- a/templates/Financial Services/Bank Statements/configurations/wells_fargo_combined_statement_of_accounts.json +++ b/templates/Financial Services/Bank Statements/configurations/wells_fargo_combined_statement_of_accounts.json @@ -1,414 +1,1320 @@ { - "fingerprint": { - "tests": [ - { - "text": "combined statement of accounts", - "type": "endsWith" - }, - { - "text": "page 1", - "type": "includes" + "fingerprint": { + "tests": [ + { + "type": "includes", + "text": "Wells Fargo" + }, + { + "type": "startsWith", + "text": "Statement period activity summary" + }, + { + "type": "startsWith", + "text": "Transaction history" + }, + ] + }, + "fields": [ + { + "id": "institution", + "method": { + "id": "constant", + "value": "Wells Fargo" + } + }, + { + "id": "account_holder_name", + "anchor": { + "match": { + "text": "Questions", + "type": "startsWith" } - ] + }, + "method": { + "id": "region", + "start": "left", + "offsetX": -5, + "offsetY": 0, + "width": 3.5, + "height": 0.9, + "tiebreaker": "first", + "sortLines": "readingOrderLeftToRight" + } }, - "fields": [ - { - "id": "start_date", - "type": "date", - "method": { - "id": "label", - "position": "right", - "tiebreaker": "<" - }, - "anchor": { - "match": { - "type": "startsWith", - "text": "fee period" - } + { + "id": "account_name", + "anchor": { + "match": { + "text": "Summary of accounts", + "type": "startsWith" } }, - { - "id": "end_date", - "type": "date", - "method": { - "id": "label", - "position": "right", - "tiebreaker": ">" - }, - "anchor": { - "match": { - "type": "startsWith", - "text": "fee period" - } + "method": { + "id": "region", + "width": 3, + "start": "left", + "height": 0.4, + "offsetX": -0.1, + "offsetY": 0.25, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + ":" + ] + } + }, + { + "id": "account_name", + "anchor": { + "match": { + "text": "Account summary", + "type": "startsWith" } }, - { - "id": "customer_name", - "method": { - "id": "region", - "start": "left", - "offsetX": -5.5, - "offsetY": 0.1, - "width": 3.4, - "height": 1.8, - "typeFilters": [ - "address" + "method": { + "id": "region", + "width": 3, + "start": "left", + "height": 0.4, + "offsetX": -0.1, + "offsetY": 0.05, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + ":", + "Account Summary" + ] + } + }, + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "\\d{4}" + }, + "anchor": { + "match": { + "text": "Page 1", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "method": { + "id": "region", + "width": 2, + "height": 0.3, + "offsetX": -1.5, + "offsetY": -0.1, + "start": "left" + } + }, + { + "id": "_year", + "type": { + "id": "custom", + "pattern": "\\d{4}" + }, + "anchor": { + "match": { + "text": "Page 1", + "type": "startsWith", + "isCaseSensitive": true + } + }, + "method": { + "id": "region", + "width": 3.5, + "height": 0.3, + "offsetX": -3, + "offsetY": -0.1, + "start": "left" + } + }, + { + "id": "___statement_start_date", + "anchor": "Beginning balance on", + "method": { + "id": "region", + "width": 3, + "offsetX": -0.1, + "start": "left", + "height": 0.2, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Beginning balance on " + ] + } + }, + { + "id": "__statement_start_date", + "method": { + "id": "concat", + "source_ids": [ + "___statement_start_date", + "_year" + ] + } + }, + { + "id": "_statement_start_date", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__statement_start_date" + ] + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_statement_start_date" + ] + } + }, + { + "id": "___statement_end_date", + "anchor": "ending balance on", + "method": { + "id": "region", + "width": 3, + "offsetX": -0.1, + "start": "left", + "height": 0.2, + "offsetY": -0.05, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "ending balance on " + ] + } + }, + { + "id": "__statement_end_date", + "method": { + "id": "concat", + "source_ids": [ + "___statement_end_date", + "_year" + ] + } + }, + { + "id": "_statement_end_date", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__statement_end_date" + ] + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_statement_end_date" + ] + } + }, + { + "id": "_statements_dates", + "anchor": { + "match": { + "text": "Page 1", + "type": "startsWith" + } + }, + "method": { + "id": "region", + "width": 3.5, + "offsetX": -3, + "offsetY": -0.05, + "height": 0.15, + "start": "left", + "sortLines": "readingOrderLeftToRight", + } + }, + { + "id": "statement_start_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statements_dates", + "separator": " - ", + "index": 0 + } + }, + { + "id": "statement_end_date", + "type": "date", + "method": { + "id": "split", + "source_id": "_statements_dates", + "separator": " - ", + "index": 1 + } + }, + //////////////////////// + { // Transforms statement date end to string + "id": "_strings_statement_end_date", + "type": "string", + "method": { + "id": "concat", + "source_ids": [ + "statement_end_date" + ] + } + }, + { // Extracts the month from the statement end date + "id": "_month_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 1 + } + }, + { // Extracts the year from the statement end date + "id": "_year_from_statement", + "type": "number", + "method": { + "id": "split", + "source_id": "_strings_statement_end_date", + "separator": "-", + "index": 0 + } + }, + { /// If the month of the statement is 01 = January, it deduces -1 year to the statement year + "id": "__year_deduced", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "var": "_month_from_statement.value" + }, + 1 + ] + }, + { + "-": [ + { + "var": "_year_from_statement.value" + }, + 1 + ] + }, + { + "var": "_year_from_statement.value" + } ] + } + } + }, + //NOTE: If the Statement month is not January, '_year' and '__year_deduced' will be the same + // + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" }, - "anchor": { - "match": { - "type": "startsWith", - "text": "questions?" - } + "start": { + "text": "Summary of accounts", + "type": "startsWith" + }, + "end": { + "text": "total", + "type": "startsWith" } }, - { - "id": "customer_address", - "type": "address", - "method": { - "id": "region", - "start": "left", - "offsetX": -5.5, - "offsetY": 0.1, - "width": 3.4, - "height": 1.8 + "match": "all", + "method": { + "id": "region", + "sortLines": "readingOrderLeftToRight", + "width": 1, + "height": 0.3, + "offsetX": 0, + "offsetY": 0.1, + "start": "left", + } + }, + { + "id": "account_number", + "anchor": "Account Number", + "method": { + "id": "region", + "start": "left", + "offsetX": -0.05, + "height": 0.15, + "offsetY": -0.05, + "width": 2, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account number:", + "account number" + ] + } + }, + { + "id": "accounts", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Statement period activity summary", + "type": "startsWith", + "reverse": true + }, + "stop": "Statement period activity summary", + "offsetY": -0.7, + "stopOffsetY": 0.1 }, "anchor": { + "start": { + "text": "Statement period activity summary", + "type": "startsWith", + }, "match": { + "text": "Statement period activity summary", "type": "startsWith", - "text": "questions?" - } + }, + }, + "stop": { + "text": "Account transaction fees summary", + "type": "startsWith" } }, - { - "id": "_account_summary_table_raw", - "type": "table", - "method": { - "id": "textTable", - "columns": [ + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "account_number", + "anchor": { + "match": { + "text": "Account number", + "type": "startsWith" + }, + }, + "method": { + "id": "region", + "width": 3, + "height": 0.2, + "offsetX": -0.05, + "offsetY": -0.08, + "start": "left", + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account number:", + "Account number" + ] + }, + }, + { + "id": "account_type", + "anchor": "Statement period activity summary", + "method": { + "id": "region", + "offsetX": -0.05, + "offsetY": -0.7, + "height": 0.4, + "width": 3.5, + "start": "left", + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "opening_balance", + "anchor": { + "start": { + "text": "Statement period activity ", + "type": "startsWith" + }, + "match": { + "text": "Beginning balance on", + "type": "startsWith" + } + }, + "type": "currency", + "method": { + "id": "row", + "position": "right", + "tiebreaker": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "closing_balance", + "anchor": { + "start": { + "text": "Statement period activity ", + "type": "startsWith" + }, + "match": { + "text": "Ending balance on", + "type": "startsWith" + } + }, + "type": "currency", + "method": { + "id": "row", + "position": "right", + "tiebreaker": 0, + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Description", + "type": "equals", + "reverse": true + }, + "stop": "Description", + "offsetY": -0.3, + "stopOffsetY": 0.01 + }, + "anchor": { + "start": { + "text": "Transaction history", + "type": "startsWith" + }, + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + "end": { + "text": "Ending balance on", + "type": "startsWith" + }, + }, + "stop": { + "text": "Ending balance on", + "type": "startsWith" + }, + "stopOffsetY": -0.2 + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, { - "id": "account_name", - "minX": 0.2, - "maxX": 2.75 + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "Description", + "width": 2.5, + "height": 0.3, + "offsetX": 1, + "offsetY": 0.15, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Description" + ] + } }, { - "id": "account_number", - "minX": 3.9, - "maxX": 5.5 + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "Debits", + "width": 0.5, + "height": 0.3, + "offsetX": 0, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + } }, { - "id": "beginning_balance", - "minX": 5.5, - "maxX": 7, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, }, - "isRequired": true + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "credits", + "width": 0.5, + "height": 0.3, + "offsetX": 0, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + } }, { - "id": "end_balance", - "minX": 7, - "maxX": 8.4, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "id": "balance", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, }, - "isRequired": true - } - ], - "stop": [ + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "balance", + "width": 0.5, + "height": 0.3, + "offsetX": 0, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + } + }, { - "pattern": "total ?.+ ?accounts", - "type": "regex", - "flags": "i" + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } } ] }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "accounts", + "type": "sections", + "range": { "anchor": { + "start": { + "text": "Account Summary", + "type": "startsWith", + }, "match": { + "text": "Account Summary", "type": "startsWith", - "text": "Summary of accounts" + }, + }, + }, + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" } - } - } - ], - "sections": [ - { - "id": "accounts", - "range": { + }, + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" + } + }, + { + "id": "account_number", "anchor": { - "start": "combined statement of accounts", "match": { - "text": "statement period activity summary", + "text": "Account number", "type": "startsWith" + }, + }, + "method": { + "id": "region", + "width": 1.5, + "height": 0.4, + "offsetX": -0.05, + "offsetY": -0.08, + "start": "left", + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account number:", + "Account number" + ] + }, + }, + { + "id": "account_type", + "anchor": "account summary", + "method": { + "id": "region", + "offsetX": -0.05, + "offsetY": -0.05, + "height": 0.6, + "width": 3, + "start": "left", + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "Account summary" + ] + } + }, + { + "id": "opening_balance", + "anchor": { + "match": { + "text": "nning balance", + "type": "endsWith" } }, - "offsetY": -0.75 + "type": "currency", + "method": { + "id": "region", + "width": 1.5, + "offsetY": -0.05, + "height": 0.4, + "offsetX": -0.05, + "start": "left", + "sortLines": "readingOrderLeftToRight" + } }, - "fields": [ - { - "id": "account_type", - "method": { - "id": "label", - "position": "right", - "lineFilters": [ - { - "text": "card reserve", - "type": "includes" - } - ] - }, - "anchor": { - "match": { - "text": "Wells Fargo", - "type": "startsWith", - "isCaseSensitive": true - } + { + "id": "closing_balance", + "anchor": { + "match": { + "text": "Ending balance", + "type": "endsWith" } }, - { - "id": "account_number", + "type": "currency", + "method": { + "id": "region", + "width": 1.5, + "offsetY": -0.05, + "height": 0.4, + "offsetX": -0.05, + "start": "left", + "sortLines": "readingOrderLeftToRight" + } + }, + { + "id": "_credits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Amount", + "type": "equals", + "reverse": true + }, + "stop": "Amount", + "offsetY": -0.3, + "stopOffsetY": 0.01 + }, "anchor": { + "start": { + "text": "Credits", + "type": "startsWith" + }, "match": { - "text": "account number:", + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + "end": { + "text": "Total Electronic", "type": "startsWith" - } + }, }, - "method": { - "id": "label", - "position": "right" - } + "stop": { + "text": "Total Electronic", + "type": "startsWith" + }, + "stopOffsetY": -0.2 }, - { - "id": "beginning_balance", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } }, - "anchor": { - "match": { - "text": "beginning balance", - "type": "startsWith" + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" } }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "deposits", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "method": { + "id": "passthrough" + } }, - "anchor": { - "match": { - "text": "deposits", - "type": "startsWith" + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] } }, - "method": { - "id": "row", - "position": "right" + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] + } + } + }, + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "method": { + "id": "intersection", + "verticalAnchor": "detail", + "width": 2.5, + "height": 0.3, + "offsetX": 1, + "offsetY": 0.15, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "details" + ] + } + }, + { + "id": "debit", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + { + "id": "credit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "amount", + "width": 0.5, + "height": 0.3, + "offsetX": 0, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + } + }, + { + "id": "balance", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } } - }, - { - "id": "withdrawals", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + ] + }, + { + "id": "_debits_transaction_data", + "type": "sections", + "range": { + "externalRange": { + "anchor": { + "text": "Amount", + "type": "equals", + "reverse": true + }, + "stop": "Amount", + "offsetY": -0.3, + "stopOffsetY": 0.01 }, "anchor": { + "start": { + "text": "Debits", + "type": "startsWith" + }, "match": { - "text": "withdrawals", + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + "end": { + "text": "Total Electronic", "type": "startsWith" }, - "end": "ending balance" }, - "method": { - "id": "row", - "position": "right" - } + "stop": { + "text": "Total Electronic", + "type": "startsWith" + }, + "stopOffsetY": -0.2 }, - { - "id": "end_balance", - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true + "fields": [ + { // Imports the statement year + "id": "_year", + "method": { + "id": "copy_to_section", + "source_id": "_year" + } }, - "anchor": { - "match": { - "text": "ending balance", - "type": "startsWith" + { // Imports the statement year deduced in 1 + "id": "__year_deduced", + "method": { + "id": "copy_to_section", + "source_id": "__year_deduced" } }, - "method": { - "id": "row", - "position": "right" - } - }, - { - "id": "_deposits_table_raw", - "type": "table", - "anchor": { - "match": [ - { - "text": "transaction history", - "type": "startsWith" + { // Extracts the date of the Transaction + "id": "__date", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" + }, + }, + "method": { + "id": "passthrough" + } + }, + { //Concats the trasnaction date + the statement date deduced in 1 year + "id": "_date__year_deduced", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "__year_deduced" + ] + } + }, + { //Concats the trasnaction date + the statement date + "id": "_date_year", + "type": { + "id": "replace", + "pattern": " ", + "replaceWith": "/" + }, + "method": { + "id": "concat", + "source_ids": [ + "__date", + "_year" + ] + } + }, + { //Evaluates the Month, if it is 12, outputs the Statement year -1 + // If the Statement month is not January, _year and __year_deduced will be the same + "id": "_date", + "method": { + "id": "customComputation", + "jsonLogic": { + "if": [ + { + "==": [ + { + "substr": [ + { + "var": "__date.value" + }, + 0, + 2 + ] + }, + "12" + ] + }, + { + "var": "_date__year_deduced.value" + }, + { + "var": "_date_year.value" + } + ] } - ] + } }, - "method": { - "id": "textTable", - "columns": [ - { - "id": "date", - "minX": 0.5, - "maxX": 1.4 - }, - { - "id": "description", - "minX": 1.4, - "maxX": 5.5 + { //concat to set type to Date + "id": "date", + "type": "date", + "method": { + "id": "concat", + "source_ids": [ + "_date" + ] + } + }, + { + "id": "transaction_type", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" }, - { - "id": "amount", - "minX": 5.5, - "maxX": 6.5, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true - } - ], - "stop": { - "text": "ending balance on", - "type": "startsWith" + }, + "method": { + "id": "intersection", + "verticalAnchor": "detail", + "width": 2.5, + "height": 0.3, + "offsetX": 1, + "offsetY": 0.15, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + "wordFilters": [ + "details" + ] } - } - }, - { - "id": "_withdrawals_table_raw", - "type": "table", - "anchor": { - "match": [ - { - "text": "transaction history", - "type": "startsWith" - } - ] }, - "method": { - "id": "textTable", - "columns": [ - { - "id": "date", - "minX": 0.5, - "maxX": 1.4 + { + "id": "debit", + "anchor": { + "match": { + "type": "regex", + "pattern": "^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])$" }, + }, + "type": "currency", + "method": { + "id": "intersection", + "verticalAnchor": "amount", + "width": 0.5, + "height": 0.3, + "offsetX": 0, + "offsetY": 0, + "percentOverlapX": 0, + "percentOverlapY": 0, + "sortLines": "readingOrderLeftToRight", + } + }, + { + "id": "credit", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + { + "id": "balance", + "anchor": "null not found", + "method": { + "id": "passthrough" + } + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "__date", + "_date", + "_year", + "_date_year", + "_date__year_deduced", + "__year_deduced" + ] + } + } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_year", + "__year_deduced" + ] + } + } + ], + "computed_fields": [ + { + "id": "transaction_data", + "method": { + "id": "customComputation", + "jsonLogic": { + "merge": [ { - "id": "description", - "minX": 1.4, - "maxX": 5.5 + "var": "_credits_transaction_data" }, { - "id": "amount", - "minX": 6.5, - "maxX": 7.4, - "type": { - "id": "currency", - "relaxedWithCents": true, - "removeSpaces": true - }, - "isRequired": true + "var": "_debits_transaction_data" } - ], - "stop": { - "text": "ending balance on", - "type": "startsWith" - } - } - }, - { - "id": "_transaction_table_raw", - "type": "table", - "anchor": "not applicable to Wells Fargo", - "method": { - "id": "passthrough" - } - } - ], - "computed_fields": [ - { - "id": "deposits_table", - "method": { - "id": "zip", - "source_ids": [ - "_deposits_table_raw" - ] - } - }, - { - "id": "withdrawals_table", - "method": { - "id": "zip", - "source_ids": [ - "_withdrawals_table_raw" - ] - } - }, - { - "id": "transaction_table", - "method": { - "id": "zip", - "source_ids": [ - "_transaction_table_raw" - ] - } - }, - { - "id": "suppress", - "method": { - "id": "suppressOutput", - "source_ids": [ - "_deposits_table_raw", - "_withdrawals_table_raw", - "_transaction_table_raw" ] } } - ] - } - ], - "computed_fields": [ - { - "id": "account_summary_table", - "type": "table", - "method": { - "id": "zip", - "source_ids": [ - "_account_summary_table_raw" - ] - } - }, - { - "id": "suppress", - "method": { - "id": "suppressOutput", - "source_ids": [ - "_account_summary_table_raw" - ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "_credits_transaction_data", + "_debits_transaction_data", + ] + } } + ] + }, + { + "id": "hide", + "method": { + "id": "suppressOutput", + "source_ids": [ + "___statement_start_date", + "__statement_start_date", + "_statement_start_date", + "___statement_end_date", + "__statement_end_date", + "_statement_end_date", + "_year", + "_statements_dates", + "_strings_statement_end_date", + "_month_from_statement", + "_year_from_statement", + "__year_deduced" + ] } - ] - } \ No newline at end of file + } + ] +} \ No newline at end of file diff --git a/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.pdf new file mode 100644 index 0000000..8e509cf Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.png b/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.png new file mode 100644 index 0000000..1339701 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/5_3_bank_sample.png differ diff --git a/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.pdf new file mode 100644 index 0000000..ce83cb8 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.png b/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.png new file mode 100644 index 0000000..167eceb Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/blue_vine_sample.png differ diff --git a/templates/Financial Services/Bank Statements/refdocs/bmo_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/bmo_sample.pdf new file mode 100644 index 0000000..8da3756 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/bmo_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/bmo_sample.png b/templates/Financial Services/Bank Statements/refdocs/bmo_sample.png new file mode 100644 index 0000000..dd274c8 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/bmo_sample.png differ diff --git a/templates/Financial Services/Bank Statements/refdocs/frost_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/frost_sample.pdf new file mode 100644 index 0000000..2e45fde Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/frost_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/frost_sample.png b/templates/Financial Services/Bank Statements/refdocs/frost_sample.png new file mode 100644 index 0000000..1cadedd Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/frost_sample.png differ diff --git a/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.pdf new file mode 100644 index 0000000..054dcd3 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.png b/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.png new file mode 100644 index 0000000..12dc653 Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/m_and_t_sample.png differ diff --git a/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.pdf b/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.pdf new file mode 100644 index 0000000..98fcd6d Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.pdf differ diff --git a/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.png b/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.png new file mode 100644 index 0000000..09b836b Binary files /dev/null and b/templates/Financial Services/Bank Statements/refdocs/regions_bank_sample.png differ