Skip to content

fix: GSTR-3B report UI issues#4575

Open
Abdeali099 wants to merge 27 commits into
developfrom
ui-changes-gstr3b
Open

fix: GSTR-3B report UI issues#4575
Abdeali099 wants to merge 27 commits into
developfrom
ui-changes-gstr3b

Conversation

@Abdeali099

@Abdeali099 Abdeali099 commented Jul 13, 2026

Copy link
Copy Markdown
Member

Changes

Three fixes for the GSTR 3B Report form:

  1. Grouped download buttons
  2. Duplicate intro message on first save
  3. CSS leak greying out the page title
  4. Ungrouping Button
  5. Version Log for JSON Output
  6. Primary Action Label
  7. List View Update
  8. Remove Redundant Code
  9. Minor Refactors
  10. enqueue after commit for message and data

Before - Form

image

After - Form

image

Before - Listview

image

After - Listview

image
  • no-docs

Note

Backport to V-16

@Abdeali099 Abdeali099 self-assigned this Jul 13, 2026
@Abdeali099
Abdeali099 requested review from ljain112 and vorasmit and removed request for ljain112 July 13, 2026 07:26
@codacy-production

codacy-production Bot commented Jul 13, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

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

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

Safe to merge for the UI fixes and the new PDF endpoint; the async report path still overwrites the previously-generated data in the database before the background job completes, so a failed job permanently loses the prior report.

The validate() method unconditionally sets self.json_output to an empty string at the top, which is committed to the database before the background job runs when enqueue_report=1. If the job subsequently fails, the user's previous valid report is gone with no recovery path other than a successful re-run. This was flagged in earlier review rounds and remains unaddressed. The new print format's PDF orientation is controlled by a CSS property rather than by the wkhtmltopdf option, so the PDF silently renders in portrait. Everything else is well-implemented.

gstr_3b_report.py (validate/on_update async data-loss path) and print_format/gstr_3b/gstr_3b.html (PDF orientation)

Important Files Changed

Filename Overview
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py Adds on_update enqueueing with enqueue_after_commit, duplicate-report guard, get_report helper with permission checking, and PDF download endpoint; validate() still unconditionally clears json_output before the background job runs, permanently erasing the previous report if the job fails
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js Moves realtime listener to setup, adds json_output guard in append_form (fixes previous SyntaxError crash), groups download buttons, sets custom primary action label that survives dirty state; realtime listener is not unregistered on teardown
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json Adds list-view columns and standard filters for company, year, company_gstin, month_or_quarter; changes json_output from hidden to read_only for version tracking; adds depends_on to generation_status field
india_compliance/gst_india/print_format/gstr_3b/gstr_3b.html New print format template reusing the existing report HTML; orientation: Landscape is set as a CSS property which is not how PDF generators read orientation — wkhtmltopdf reads the orientation option, not CSS
india_compliance/gst_india/doctype/gstr_3b_report/test_gstr_3b_report.py Adds seven new test cases covering duplicate-report prevention, single-enqueue deduplication, failure persistence and realtime notification, permission-based download rejection, empty-report rejection, and consistent file naming
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.html Scopes .disabled and .right CSS rules under .gstr3b-report to prevent global CSS leak that was greying out page titles; correct targeted fix
india_compliance/gst_india/print_format/gstr_3b/gstr_3b.json New Print Format definition for GSTR-3B; uses wkhtmltopdf generator and references the new Jinja template; margins are all zero which suits a compact table layout
india_compliance/gst_india/utils/itc_claim.py Changes filing-status confirmation from a modal msgprint to an alert toast and removes trailing period; purely a UX improvement
india_compliance/gst_india/print_format/gstr_3b/init.py Empty init.py to make the print_format/gstr_3b directory a Python package; no logic

Reviews (19): Last reviewed commit: "test: skip committing in test" | Re-trigger Greptile

Comment thread india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js Outdated
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The GSTR 3B report flow now prevents duplicate reports, deduplicates background generation, publishes completion status, and supports JSON, Excel, and PDF downloads. The form renders saved or in-progress reports and provides updated actions. A landscape print format was added, report styles were scoped, report fields were exposed in list and filter views, and generation status was made conditional. Tests cover lifecycle, download, authorization, and filename behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main GSTR-3B report UI fixes in the patch.
Description check ✅ Passed The description is clearly related to the changeset and mentions several implemented GSTR 3B report fixes.
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.

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.

@ljain112

Copy link
Copy Markdown
Member

View Form can be removed and added as Download PDF.
We are already showing all the detauils in UI itself.

@ljain112

Copy link
Copy Markdown
Member
image No need for print settings directly print can be done.

@ljain112

Copy link
Copy Markdown
Member
image show period , year and gstin in list view

@ljain112

Copy link
Copy Markdown
Member

Version log is not available for data.

@ljain112

Copy link
Copy Markdown
Member
image We can update the label as generate and re-generate for better calrity and can remove the intro completely .

@ljain112

Copy link
Copy Markdown
Member

After enquue report is not getting automatically populated.

@ljain112

Copy link
Copy Markdown
Member
image json naming should be like doc name with gstin and period details.

Comment thread india_compliance/gst_india/print_format/gstr_3b/gstr_3b.html
Comment thread india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js (2)

31-34: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Remove the forced intro and dirty state.

Every refresh of an existing report re-adds “Please save the report again…” and sets __unsaved = 1, so users are prompted to save again even after a successful save. This does not remove the duplicate-intro problem and makes the form appear perpetually unsaved. Gate any legacy migration message behind an explicit condition, or remove this block.


36-45: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use a report-specific JSON filename.

The endpoint invoked here still produces the hardcoded GST3B.json filename in gstr_3b_report.py. Update make_json to derive the filename from the document name, GSTIN, and reporting period as required by the PR.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c4d20a9f-fa76-49cb-97f3-d163407d207e

📥 Commits

Reviewing files that changed from the base of the PR and between a0f64fe and 41d7efc.

📒 Files selected for processing (2)
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json

Comment thread india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js
@Abdeali099

Copy link
Copy Markdown
Member Author

After enquue report is not getting automatically populated.

Not able to replicate

@codacy-production

codacy-production Bot commented Jul 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 18 complexity

Metric Results
Complexity 18

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.

@Abdeali099 Abdeali099 changed the title fix: GSTR-3B report UI issues (download buttons, duplicate intro, CSS leak) fix: GSTR-3B report UI issues Jul 14, 2026
@Abdeali099
Abdeali099 requested a review from ljain112 July 14, 2026 10:08
Comment thread india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py
@ljain112

Copy link
Copy Markdown
Member

@greptileai review

Comment thread india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py
@ljain112

Copy link
Copy Markdown
Member

@greptileai review

Abdeali099 and others added 25 commits July 22, 2026 14:52
@ljain112
ljain112 force-pushed the ui-changes-gstr3b branch from e268260 to 224589a Compare July 22, 2026 09:22
@ljain112

Copy link
Copy Markdown
Member

@greptile, we have already allowed a version change, so no issues

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

That's a fair point. With version tracking enabled on json_output (changed from hidden: 1 to read_only: 1 so changes appear in the timeline), the previously-valid report data is preserved in the version history even after validate() clears it to "". So the data isn't permanently lost in the scenario where the background job fails — users can recover the prior value from the document's version log.

One nuance worth being aware of: the db_set() call in get_data() that writes the newly-generated JSON back won't create a version entry (since db_set bypasses the version lifecycle by default). So the timeline will record the json_output being cleared, but not the subsequent successful regeneration. This is a minor limitation for auditability, but it doesn't block the approach. Thanks for the clarification.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3614db51-aff6-4abf-8935-645ae91aaa7f

📥 Commits

Reviewing files that changed from the base of the PR and between e268260 and b504f1a.

📒 Files selected for processing (9)
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.html
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json
  • 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/print_format/gstr_3b/__init__.py
  • india_compliance/gst_india/print_format/gstr_3b/gstr_3b.html
  • india_compliance/gst_india/print_format/gstr_3b/gstr_3b.json
  • india_compliance/gst_india/utils/itc_claim.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • india_compliance/gst_india/print_format/gstr_3b/gstr_3b.json
  • india_compliance/gst_india/utils/itc_claim.py
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.html
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.js
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.json
  • india_compliance/gst_india/doctype/gstr_3b_report/gstr_3b_report.py

Comment thread india_compliance/gst_india/print_format/gstr_3b/gstr_3b.html
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.

2 participants