fix: correct from and to statecode in e-waybill for sez invoice.#4141
fix: correct from and to statecode in e-waybill for sez invoice.#4141ljain112 wants to merge 3 commits intoresilient-tech:developfrom
Conversation
Confidence Score: 5/5Safe to merge — fixes a real API compliance bug, logic is correct for all SEZ permutations, and new tests verify each case. No P0/P1 findings. The copy-before-override pattern correctly preserves actFromStateCode/actToStateCode. The to_state_code condition handles both is_return and SEZ outward cases. BUYING_DOCTYPES refactor is safe. All existing test expectations updated appropriately. No files require special attention.
|
| Filename | Overview |
|---|---|
| india_compliance/gst_india/utils/e_waybill.py | Core fix: SEZ state_number override (96) applied per-party before ship_to/ship_from copy, preserving actual physical state codes; to_state_code logic extended to use bill_to.state_number when the buyer is SEZ. |
| india_compliance/gst_india/utils/transaction_data.py | Fetches gst_category from Address and includes it in the returned address_details dict so downstream callers can check party-level SEZ status. |
| india_compliance/gst_india/constants/e_waybill.py | Adds BUYING_DOCTYPES set computed from ADDRESS_FIELDS via identity check on buying_address, replacing the hardcoded tuple. |
| india_compliance/gst_india/utils/test_e_waybill.py | Adds five new integration tests covering SEZ state codes for outward sales invoice, sales return, stock entry, purchase invoice, and purchase return. |
Reviews (3): Last reviewed commit: "test: add gst_category field to address ..." | Re-trigger Greptile
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughE-waybill behavior for SEZ addresses was adjusted: 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6129094d-9af7-4ae3-82ae-7de1b5ce0069
📒 Files selected for processing (2)
india_compliance/gst_india/utils/e_waybill.pyindia_compliance/gst_india/utils/test_e_waybill.py
There was a problem hiding this comment.
🧹 Nitpick comments (1)
india_compliance/gst_india/utils/test_e_waybill.py (1)
1395-1504: Add a sandbox regression for the new SEZ GSTIN branch.These cases lock down the state-code swaps, but none run with
sandbox_mode = 1, so the newSEZ_GSTINpath inindia_compliance/gst_india/utils/e_waybill.pyLines 1810-1867 is still untested. One sandbox assert onfromGstin/toGstinwould cover the other half of this change.🧪 Suggested test shape
+ `@change_settings`( + "GST Settings", + {"sandbox_mode": 1, "enable_overseas_transactions": 1}, + ) + def test_e_waybill_for_sez_outward_invoice_in_sandbox(self): + si = create_sales_invoice( + vehicle_no="GJ07DL9009", + company_address="_Test Indian Registered Company-Billing", + customer_address="_Test Registered Customer-Billing-1", + is_out_state=1, + is_export_with_gst=1, + ) + + e_waybill_data = EWaybillData(si).get_data() + + self.assertEqual(e_waybill_data.get("toGstin"), "27AAJCS5738D1Z6")
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: be9332d4-d8f7-4e93-b7e6-a87a58693224
📒 Files selected for processing (5)
india_compliance/gst_india/constants/e_waybill.pyindia_compliance/gst_india/utils/e_waybill.pyindia_compliance/gst_india/utils/test_e_waybill.pyindia_compliance/gst_india/utils/transaction_data.pyindia_compliance/tests/test_records.json
✅ Files skipped from review due to trivial changes (1)
- india_compliance/tests/test_records.json
a35ec1c to
66ee129
Compare
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 7 |
TIP This summary will be updated as you push new changes. Give us feedback
No description provided.