fix: fix ITC claim period filtering GST Purchase Register and reports#4280
fix: fix ITC claim period filtering GST Purchase Register and reports#4280ljain112 wants to merge 1 commit intoresilient-tech:developfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
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.
Confidence Score: 5/5Safe to merge — the fix is targeted, correctly handles edge cases, and is well covered by new unit and integration tests. No P0 or P1 findings. The core logic change is straightforward: a single No files require special attention.
|
| Filename | Overview |
|---|---|
| india_compliance/gst_india/utils/itc_claim.py | Fixes apply_period_filter to use isin over all periods in the date range (instead of only to_date's period) when return_period is not provided and filter_by="ITC Claim Period". |
| india_compliance/gst_india/utils/init.py | Adds get_periods_between_dates utility to generate inclusive MMYYYY month period list between two dates, replacing the removed dateutil.rrule dependency. |
| india_compliance/gst_india/doctype/purchase_reconciliation_tool/init.py | Delegates _get_periods to the new shared get_periods_between_dates, removing the local dateutil.rrule usage. |
| india_compliance/gst_india/utils/test_itc_claim.py | Adds unit tests for get_periods_between_dates (range, reversed, same-month) and for apply_period_filter with both explicit and range-based period modes. |
| india_compliance/gst_india/report/gst_purchase_register/test_gst_purchase_register.py | Adds an integration test verifying that "ITC Claim Period" date-range filtering in the GST Purchase Register includes the correct invoices across multiple months. |
Reviews (1): Last reviewed commit: "fix: fix ITC claim period filtering GST ..." | Re-trigger Greptile
📝 WalkthroughWalkthroughThis pull request introduces a new utility function 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
india_compliance/gst_india/utils/test_itc_claim.py (1)
97-107: ⚡ Quick winAdd one cross-month partial-boundary test case.
Current coverage misses a high-signal case where
from_date/to_dateare in different months but not at month boundaries (e.g., 15th → 1st). Adding this helps lock down date-range semantics.✅ Suggested test addition
+ def test_get_periods_between_date_partial_month_boundaries(self): + periods = get_periods_between_dates("2024-04-15", "2024-06-01") + self.assertEqual(periods, ["042024", "052024", "062024"])
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ac0f8b8a-646e-43c0-8eb1-d850a3e7aede
📒 Files selected for processing (5)
india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.pyindia_compliance/gst_india/report/gst_purchase_register/test_gst_purchase_register.pyindia_compliance/gst_india/utils/__init__.pyindia_compliance/gst_india/utils/itc_claim.pyindia_compliance/gst_india/utils/test_itc_claim.py
Issue: Data was not getting filtered between dates.