Skip to content

feat: allow itc claim period for RCM Purchase Invoice#4264

Open
ljain112 wants to merge 5 commits intoresilient-tech:developfrom
ljain112:rcm-itc-claim-period
Open

feat: allow itc claim period for RCM Purchase Invoice#4264
ljain112 wants to merge 5 commits intoresilient-tech:developfrom
ljain112:rcm-itc-claim-period

Conversation

@ljain112
Copy link
Copy Markdown
Member

@ljain112 ljain112 commented Apr 24, 2026

Allow ITC Claim for RCM Purchase Invoice in a different month.

  • Outward RCM liability will be reported as per the Posting Date.
  • Inward RCM will be reported as per ITC Claim Period/Posting Date.

no-docs

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -6 complexity

Metric Results
Complexity -6

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 24, 2026

Confidence Score: 5/5

Safe to merge — only a P2 style comment, no logic or correctness issues found.

Changes are well-scoped: removal of the Unregistered-RCM restriction is clean, the is_outward_query flag correctly isolates the outward liability query from the ITC period filter, and both the unit and integration tests cover the new behaviour end-to-end. The only finding is a misleading inline comment.

No files require special attention.

Important Files Changed

Filename Overview
india_compliance/gst_india/utils/itc_claim.py Removes the Unregistered-RCM restriction: deletes _validate_itc_claim_period_for_rcm_invoice and the early-return in _calculate_itc_claim_period. Unregistered RCM invoices now follow the same next-unfiled-period logic as all other invoices.
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py Adds is_outward_query flag that forces Posting Date filter on outward supply queries, correctly separating RCM output tax liability (always posting date) from ITC (follows claim period).
india_compliance/gst_india/doctype/gstr_3b_report/test_gstr_3b_report.py New test_rcm_outward_liability test covers the split-period scenario end-to-end; logic and assertions look correct.
india_compliance/gst_india/overrides/test_purchase_invoice.py Test updated to verify that Unregistered RCM invoices now accept any valid period (including "Deferred" and future periods), replacing the old restriction assertions.
india_compliance/gst_india/utils/test_itc_claim.py Unit test updated to assert Unregistered RCM follows next-unfiled-period logic; adds case where posting period is already filed to confirm the skip-to-next-period path.

Reviews (2): Last reviewed commit: "refactor: changes as per review" | Re-trigger Greptile

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@ljain112 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 46 minutes and 11 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9c464705-fd3d-472f-a104-a33ba8c98e9d

📥 Commits

Reviewing files that changed from the base of the PR and between 8b6d9bd and ff72049.

📒 Files selected for processing (5)
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py
  • india_compliance/gst_india/doctype/gstr_3b_report/test_gstr_3b_report.py
  • india_compliance/gst_india/overrides/test_purchase_invoice.py
  • india_compliance/gst_india/utils/itc_claim.py
  • india_compliance/gst_india/utils/test_itc_claim.py
📝 Walkthrough

Walkthrough

The changes introduce configurability to ITC period filtering in GSTR 3B reports. The apply_itc_period_filter method now accepts an optional filter_by parameter, with get_outward_tax_invoices explicitly specifying "Posting Date" for outward invoice selection. A special-case validation rule that required unregistered RCM (Reverse Charge Mechanism) invoices to claim ITC in the same period as posting date has been removed from the ITC claim utilities. Supporting test coverage has been added for RCM behavior across month boundaries, and existing tests have been updated to reflect the new behavior where unregistered RCM invoices can have ITC claim periods independent of posting date.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the motivation and impact of allowing flexible ITC claim periods for RCM Purchase Invoices.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: allowing flexible ITC claim period selection for RCM Purchase Invoices instead of forcing it to the posting date.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ljain112
Copy link
Copy Markdown
Member Author

@greptileai

@ljain112
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ljain112
Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Full review triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant