You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a Desk tool to download GSTR-2A/2B from the GST portal and export it to Excel byte-for-byte identical to the portal's own file.
What it does
New GST Return Export doctype with Sync / Summary / Export actions (plain Frappe/Desk, async with realtime progress).
Persists the raw GSTN payload per period on the GST Return Log (store_raw_return_data / get_raw_return_data) — the export is raw-replay, not a lossy re-derivation from GST Inward Supply.
Excel exporter (gstr_2_export.py) fills the bundled portal templates label-by-label (survives template shifts): 2B invoice-level with code expansion + the four ITC-summary sheets from the portal's itcsumm; 2A item-level with per-invoice -Total rows; ISD invoice/credit-note routing, TCS computed columns, Read me header. Multi-period exports merge sections and sum itcsumm.
Summary section (returns_export): per-period aggregation from GST Inward Supply and a section-first range summary with ITC buckets, for the tool's summary view.
Sync fetches the 2A export-only sections (ECO/ECOA/TDS/TCS) best-effort, and reads legal/trade names verbatim from the GSTIN registry for portal-matching Read me headers.
Testing
Golden-workbook regression tests for 2A and 2B (committed goldens, per-cell comparison), value-assertion unit tests for the tricky logic, summary-aggregation and multi-period tests, sync raw-persistence + export-section tests, and controller endpoint tests.
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.
Priyal208
changed the title
feat: (p1)scaffold gst return export tool and (p2)persist raw gstn 2a/2b payload
feat: gstr export tool for 2a/2b
Jun 30, 2026
The reason will be displayed to describe this comment to others. Learn more.
something better..
-> what if user doesn't have permissions for the file / to view any file?
-> maybe a new API request in backend to get file content and trigger it's download
-> what permissions check will you do for this?
The reason will be displayed to describe this comment to others. Learn more.
let's first fix this and keep it consistant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GST Return Export — Phase 1 (Sync GSTR-2A / 2B)
Adds a Desk tool to download GSTR-2A/2B from the GST portal and export it to Excel byte-for-byte identical to the portal's own file.
What it does
store_raw_return_data/get_raw_return_data) — the export is raw-replay, not a lossy re-derivation from GST Inward Supply.gstr_2_export.py) fills the bundled portal templates label-by-label (survives template shifts): 2B invoice-level with code expansion + the four ITC-summary sheets from the portal'sitcsumm; 2A item-level with per-invoice-Totalrows; ISD invoice/credit-note routing, TCS computed columns, Read me header. Multi-period exports merge sections and sumitcsumm.returns_export): per-period aggregation from GST Inward Supply and a section-first range summary with ITC buckets, for the tool's summary view.Testing
Screenshots