diff --git a/golden/expected_osv_parse/synthetic/s18_inn_row_above.json b/golden/expected_osv_parse/synthetic/s18_inn_row_above.json index 017da22..cc37424 100644 --- a/golden/expected_osv_parse/synthetic/s18_inn_row_above.json +++ b/golden/expected_osv_parse/synthetic/s18_inn_row_above.json @@ -8,8 +8,8 @@ "rows": 7, "warnings": [ "sheet=Лист_1 hierarchy=outline", - "строка 13: ИНН 7701234567 над строкой 14 отнесён к ней как к контрагенту", - "строка 18: ИНН 5001234567 над строкой 19 отнесён к ней как к контрагенту" + "строка 13: ИНН 7701234560 отнесён к контрагенту в строке 14", + "строка 18: ИНН 5001234561 отнесён к контрагенту в строке 19" ] }, "documents": [ @@ -97,7 +97,7 @@ "group_name": "Контрагенты", "account_code_raw": "60.01", "counterparty_name": "ООО Альфа", - "counterparty_inn": "7701234567", + "counterparty_inn": "7701234560", "data_type": "BU", "opening_debit": null, "opening_credit": "250000.50", @@ -173,7 +173,7 @@ "group_name": "Контрагенты", "account_code_raw": "60.02", "counterparty_name": "ООО Гамма", - "counterparty_inn": "5001234567", + "counterparty_inn": "5001234561", "data_type": "BU", "opening_debit": "120000.00", "opening_credit": null, diff --git a/golden/expected_osv_parse/synthetic/s20_inn_above_sibling_blank.json b/golden/expected_osv_parse/synthetic/s20_inn_above_sibling_blank.json new file mode 100644 index 0000000..5a1fc42 --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s20_inn_above_sibling_blank.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 13: ИНН 7701234560 отнесён к контрагенту в строке 14", + "строка 15: ИНН 7707654321 отнесён к контрагенту в строке 16", + "строка 19: ИНН 5001234561 отнесён к контрагенту в строке 20", + "строка 21: ИНН 500100732259 отнесён к контрагенту в строке 22" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 14, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 16, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 20, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 22, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s21_inn_above_sibling_sums.json b/golden/expected_osv_parse/synthetic/s21_inn_above_sibling_sums.json new file mode 100644 index 0000000..5a1fc42 --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s21_inn_above_sibling_sums.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 13: ИНН 7701234560 отнесён к контрагенту в строке 14", + "строка 15: ИНН 7707654321 отнесён к контрагенту в строке 16", + "строка 19: ИНН 5001234561 отнесён к контрагенту в строке 20", + "строка 21: ИНН 500100732259 отнесён к контрагенту в строке 22" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 14, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 16, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 20, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 22, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s22_inn_above_parent_blank.json b/golden/expected_osv_parse/synthetic/s22_inn_above_parent_blank.json new file mode 100644 index 0000000..5a1fc42 --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s22_inn_above_parent_blank.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 13: ИНН 7701234560 отнесён к контрагенту в строке 14", + "строка 15: ИНН 7707654321 отнесён к контрагенту в строке 16", + "строка 19: ИНН 5001234561 отнесён к контрагенту в строке 20", + "строка 21: ИНН 500100732259 отнесён к контрагенту в строке 22" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 14, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 16, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 20, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 22, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s23_inn_above_parent_sums.json b/golden/expected_osv_parse/synthetic/s23_inn_above_parent_sums.json new file mode 100644 index 0000000..5a1fc42 --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s23_inn_above_parent_sums.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 13: ИНН 7701234560 отнесён к контрагенту в строке 14", + "строка 15: ИНН 7707654321 отнесён к контрагенту в строке 16", + "строка 19: ИНН 5001234561 отнесён к контрагенту в строке 20", + "строка 21: ИНН 500100732259 отнесён к контрагенту в строке 22" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 14, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 16, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 20, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 22, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s24_inn_below_child_blank.json b/golden/expected_osv_parse/synthetic/s24_inn_below_child_blank.json new file mode 100644 index 0000000..cb9d10f --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s24_inn_below_child_blank.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 14: ИНН 7701234560 отнесён к контрагенту в строке 13", + "строка 16: ИНН 7707654321 отнесён к контрагенту в строке 15", + "строка 20: ИНН 5001234561 отнесён к контрагенту в строке 19", + "строка 22: ИНН 500100732259 отнесён к контрагенту в строке 21" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 13, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 15, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 19, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 21, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s25_inn_below_child_sums.json b/golden/expected_osv_parse/synthetic/s25_inn_below_child_sums.json new file mode 100644 index 0000000..cb9d10f --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s25_inn_below_child_sums.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 14: ИНН 7701234560 отнесён к контрагенту в строке 13", + "строка 16: ИНН 7707654321 отнесён к контрагенту в строке 15", + "строка 20: ИНН 5001234561 отнесён к контрагенту в строке 19", + "строка 22: ИНН 500100732259 отнесён к контрагенту в строке 21" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 13, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 15, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 19, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 21, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s26_inn_below_sibling_sums.json b/golden/expected_osv_parse/synthetic/s26_inn_below_sibling_sums.json new file mode 100644 index 0000000..cb9d10f --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s26_inn_below_sibling_sums.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 14: ИНН 7701234560 отнесён к контрагенту в строке 13", + "строка 16: ИНН 7707654321 отнесён к контрагенту в строке 15", + "строка 20: ИНН 5001234561 отнесён к контрагенту в строке 19", + "строка 22: ИНН 500100732259 отнесён к контрагенту в строке 21" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 13, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 15, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 19, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 21, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s27_inn_below_sibling_blank.json b/golden/expected_osv_parse/synthetic/s27_inn_below_sibling_blank.json new file mode 100644 index 0000000..cb9d10f --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s27_inn_below_sibling_blank.json @@ -0,0 +1,234 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "done", + "metrics": { + "rows": 8, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 14: ИНН 7701234560 отнесён к контрагенту в строке 13", + "строка 16: ИНН 7707654321 отнесён к контрагенту в строке 15", + "строка 20: ИНН 5001234561 отнесён к контрагенту в строке 19", + "строка 22: ИНН 500100732259 отнесён к контрагенту в строке 21" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 13, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": "7701234560", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 15, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 19, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 21, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +} diff --git a/golden/expected_osv_parse/synthetic/s28_inn_bad_checksum.json b/golden/expected_osv_parse/synthetic/s28_inn_bad_checksum.json new file mode 100644 index 0000000..f7e7f7e --- /dev/null +++ b/golden/expected_osv_parse/synthetic/s28_inn_bad_checksum.json @@ -0,0 +1,253 @@ +{ + "schema_version": "1.2", + "service": { + "name": "tabular-parser" + }, + "status": "needs_check", + "metrics": { + "rows": 9, + "warnings": [ + "sheet=Лист_1 hierarchy=outline", + "строка 13: похожа на ИНН 7701234567, но контрольная сумма не сходится — строка оставлена как есть", + "строка 15: ИНН 7707654321 отнесён к контрагенту в строке 16", + "строка 19: ИНН 5001234561 отнесён к контрагенту в строке 20", + "строка 21: ИНН 500100732259 отнесён к контрагенту в строке 22" + ] + }, + "documents": [ + { + "document_type": "OSV", + "locator": "sheet:Лист_1", + "header": { + "organization_name": "ООО \"Тестовая организация\"", + "organization_inn": null, + "account_code_raw": "60", + "period_text": "1 квартал 2025 г.", + "period_year": 2025, + "period_quarter": "Q1", + "is_cumulative": true, + "period_start": "2025-01-01", + "period_end": "2025-03-31", + "is_from_year_start": true, + "data_type": "BU", + "currency": "RUB", + "header_variant": 1 + }, + "group_schema": [ + { + "type": "ACCOUNT", + "name": "Счет" + }, + { + "type": "COUNTERPARTY", + "name": "Контрагенты" + } + ], + "columns": { + "opening_debit": "E", + "opening_credit": "F", + "turnover_debit": "G", + "turnover_credit": "H", + "closing_debit": "I", + "closing_credit": "J" + }, + "rows": [ + { + "row_number": 11, + "level": 0, + "parent_row_number": null, + "row_value": "60", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + }, + { + "row_number": 12, + "level": 1, + "parent_row_number": 11, + "row_value": "60.01", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.01", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": "253000.50", + "turnover_debit": "273000.25", + "turnover_credit": "460000.00", + "closing_debit": "65000.00", + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 13, + "level": 2, + "parent_row_number": 12, + "row_value": "7701234567", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "7701234567", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": null, + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 14, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Альфа", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Альфа", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "250000.50", + "turnover_debit": "180000.25", + "turnover_credit": "420000.00", + "closing_debit": null, + "closing_credit": "490000.25", + "extra": null + }, + { + "row_number": 16, + "level": 2, + "parent_row_number": 12, + "row_value": "ООО Бета", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "ООО Бета", + "counterparty_inn": "7707654321", + "data_type": "BU", + "opening_debit": "15000.00", + "opening_credit": null, + "turnover_debit": "90000.00", + "turnover_credit": "40000.00", + "closing_debit": "65000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 17, + "level": 2, + "parent_row_number": 12, + "row_value": "Иванов Иван", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.01", + "counterparty_name": "Иванов Иван", + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": null, + "opening_credit": "3000.00", + "turnover_debit": "3000.00", + "turnover_credit": null, + "closing_debit": null, + "closing_credit": null, + "extra": null + }, + { + "row_number": 18, + "level": 1, + "parent_row_number": 11, + "row_value": "60.02", + "group_type": "ACCOUNT", + "group_name": "Счет", + "account_code_raw": "60.02", + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": "1500.00", + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 20, + "level": 2, + "parent_row_number": 18, + "row_value": "ООО Гамма", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ООО Гамма", + "counterparty_inn": "5001234561", + "data_type": "BU", + "opening_debit": "120000.00", + "opening_credit": null, + "turnover_debit": "30000.00", + "turnover_credit": "100000.00", + "closing_debit": "50000.00", + "closing_credit": null, + "extra": null + }, + { + "row_number": 22, + "level": 2, + "parent_row_number": 18, + "row_value": "ИП Сидоров", + "group_type": "COUNTERPARTY", + "group_name": "Контрагенты", + "account_code_raw": "60.02", + "counterparty_name": "ИП Сидоров", + "counterparty_inn": "500100732259", + "data_type": "BU", + "opening_debit": null, + "opening_credit": "1500.00", + "turnover_debit": null, + "turnover_credit": null, + "closing_debit": null, + "closing_credit": "1500.00", + "extra": null + }, + { + "row_number": 23, + "level": 0, + "parent_row_number": null, + "row_value": "Итого", + "group_type": "TOTAL", + "group_name": null, + "account_code_raw": null, + "counterparty_name": null, + "counterparty_inn": null, + "data_type": "BU", + "opening_debit": "135000.00", + "opening_credit": "254500.50", + "turnover_debit": "303000.25", + "turnover_credit": "560000.00", + "closing_debit": "115000.00", + "closing_credit": "491500.25", + "extra": null + } + ], + "checks": { + "total_row_matches_root": true, + "balance_identity_violations": [], + "parent_sum_violations": [] + } + } + ] +}