Skip to content

feat: Template for P&L and BS of Schedule III (backport #3993)#4273

Merged
ljain112 merged 25 commits intoresilient-tech:version-16-hotfixfrom
ljain112:local-backport-v16-schedule-iii
Apr 30, 2026
Merged

feat: Template for P&L and BS of Schedule III (backport #3993)#4273
ljain112 merged 25 commits intoresilient-tech:version-16-hotfixfrom
ljain112:local-backport-v16-schedule-iii

Conversation

@ljain112
Copy link
Copy Markdown
Member

Manual backport: #3993

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 30, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity

Metric Results
Complexity 11

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 30, 2026

Confidence Score: 3/5

Safe to merge for the fixture/template changes; the test utility account-mutation behavior warrants a fix before the test suite is expanded.

One P1 in create_account (silently overwrites structural account fields on collision) and one P2 pattern-matching gap in the P&L template pull the score below a clean 4. The core fixture and patch logic is sound.

india_compliance/tests/erpnext_test_utils.py (create_account mutation) and the P&L JSON template (employee expense pattern coverage).

Important Files Changed

Filename Overview
india_compliance/income_tax_india/financial_report_template/test_schedule_iii.py New test for Schedule III P&L and Balance Sheet templates; journal entries are deliberately reversed for sign-reversal testing, which is internally consistent but may be confusing.
india_compliance/tests/erpnext_test_utils.py Shared test utility file copied from ERPNext; contains many unused functions and a create_account implementation that silently modifies existing accounts on name collision.
india_compliance/patches/v16/sync_financial_report_templates.py Minimal patch that delegates to ERPNext's _sync_templates_for; straightforward and correct.
india_compliance/income_tax_india/financial_report_template/account_categories.json Defines 8 India-specific account categories for Schedule III; two description strings are missing a space before "Examples:".
india_compliance/income_tax_india/financial_report_template/standard_profit_and_loss_(schedule_iii)/standard_profit_and_loss_(schedule_iii).json Complete Schedule III P&L template; advanced filtering uses name-based patterns for employee expenses, which can miss accounts whose names don't match any of the listed keywords.
india_compliance/income_tax_india/financial_report_template/standard_balance_sheet_(schedule_iii)/standard_balance_sheet_(schedule_iii).json Complete Schedule III Balance Sheet template with Balance Check row; structure and formulas look correct.
india_compliance/patches.txt Patch entry for sync_financial_report_templates appended correctly.

Comments Outside Diff (2)

  1. india_compliance/tests/erpnext_test_utils.py, line 1613-1639 (link)

    P1 create_account silently overwrites existing account's parent

    When an account with the same account_name and company already exists, the function updates its parent_account (and is_group) to whatever was passed in and saves — potentially reparenting a live chart-of-accounts entry. Any other test or patch that relies on the original parent of that account will see corrupted data after this call.

    The tearDownClass rollback guards the test run itself, but if a real system account name ever collides (or the rollback fails), the chart of accounts is silently mutated. A safer pattern is to raise or return early if the account already exists rather than overwriting structural fields:

    if account:
        return account  # already exists, return as-is
  2. india_compliance/tests/erpnext_test_utils.py, line 1527-1530 (link)

    P2 Many unused functions imported and defined

    erpnext_test_utils.py copies numerous functions from ERPNext test helpers (create_task, make_project_template, make_project, get_rm_items, make_bom, create_subcontracting_order, create_fiscal_year) that are not referenced anywhere in this PR. The top-level from erpnext.buying.doctype.purchase_order.purchase_order import get_mapped_subcontracting_order also runs eagerly on every import of this module, adding an unnecessary dependency.

    If these are placeholders for future tests, consider adding them only when they are actually needed to keep the module lean and avoid accidental import failures.

Reviews (1): Last reviewed commit: "test: use consistent test date in Schedu..." | Re-trigger Greptile

@ljain112 ljain112 force-pushed the local-backport-v16-schedule-iii branch from 493a196 to a02d549 Compare April 30, 2026 13:24
@ljain112 ljain112 merged commit 1f87fb4 into resilient-tech:version-16-hotfix Apr 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants