fix: add additional inward supply fields to document view and excel export#4283
fix: add additional inward supply fields to document view and excel export#4283Priyal208 wants to merge 3 commits intoresilient-tech:developfrom
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 2 |
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/5Straightforward additive change — no existing logic is modified, and the null-handling path for records without an inward supply is preserved correctly throughout the stack. The change is purely additive: new fields are threaded consistently through the Python data layer, Excel export, and JS column definitions. The previously-flagged null-guard issue for gstr_1_filled/gstr_3b_filled has been applied in both the JS view and the Python assign_value branch. No existing reconciliation or export logic is altered. No files require special attention.
|
| Filename | Overview |
|---|---|
| india_compliance/gst_india/doctype/purchase_reconciliation_tool/init.py | Adds 7 new inward-supply fields to the ReconciledData projection list, the empty-defaults dict, and the update_fields output. The null-handling path is intact: fields come through as None for missing inward supply records (empty frappe._dict), so assign_value's is-None guard fires correctly. |
| india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.py | Adds assign_value branch for gstr_1_filled/gstr_3b_filled (converts 0/1 to No/Yes while letting the existing is-None guard produce empty cells), adds the missing Differences column and 7 new inward-supply columns to the Excel layout. |
| india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.js | Inserts 7 column descriptors (ITC Availability, Reason for ITC Unavailability, GSTR-1 Filed, GSTR-3B Filed, IRN Source, IRN Number, IRN Generation Date) into the document view. The gstr_*_filled callbacks correctly use the three-way null/0/1 guard already requested in a prior review cycle. |
| india_compliance/gst_india/data/test_purchase_reconciliation_tool.json | Adds the 7 new fields to all 9 test fixture entries, using 0 for the boolean flags and null for optional string fields. Consistent with the rest of the test dataset structure. |
Reviews (3): Last reviewed commit: "fix: review changes" | Re-trigger Greptile
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe purchase reconciliation tool is extended with ITC and IRN-related fields across multiple layers. Test data in 🚥 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. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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
🧹 Nitpick comments (1)
india_compliance/gst_india/data/test_purchase_reconciliation_tool.json (1)
30-37: ⚡ Quick winAdd at least one test case that exercises non-default values for the new fields.
All test cases across the file use identical defaults (
gstr_1_filled: 0,gstr_3b_filled: 0,itc_availability: "Yes", all IRN fieldsnull). The critical path ofgstr_1_filled = 1mapping to"Yes"in the UI/Excel renderer is never exercised, nor isitc_availabilitywith a value other than"Yes". Consider adding a test entry like:{ "INWARD_SUPPLY": { "bill_no": "BILL-23-00001", "gstr_1_filled": 1, "gstr_3b_filled": 1, "itc_availability": "ITC Available but Ineligible", "reason_itc_unavailability": "Others" }, ... "RECONCILED_DATA": { ... "gstr_1_filled": 1, "gstr_3b_filled": 1, "itc_availability": "ITC Available but Ineligible", "reason_itc_unavailability": "Others", ... } }This validates the full data-propagation pipeline for these fields.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 611aed82-8c5c-438f-8656-f309898a866d
📒 Files selected for processing (4)
india_compliance/gst_india/data/test_purchase_reconciliation_tool.jsonindia_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.pyindia_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.jsindia_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.py
| "irn_number": inward_supply.get("irn_number"), | ||
| "irn_gen_date": inward_supply.get("irn_gen_date"), |
There was a problem hiding this comment.
irn_gen_date will render inconsistently in the Excel export — apply format_date in get_consolidated_data.
bill_date and inward_supply_bill_date receive explicit format_date treatment inside get_consolidated_data before being written to the Excel workbook (producing formatted text strings like "11-12-2023"). irn_gen_date, however, is set here from the raw database value and is never formatted — so it arrives at ExcelExporter as a Python datetime.date object. openpyxl will write it as a date cell with whatever the system's default date number-format is, producing a visually inconsistent Excel report.
🛠️ Proposed fix in get_consolidated_data
purchase.bill_date = format_date(purchase.bill_date)
inward_supply.bill_date = format_date(inward_supply.bill_date)
doc.update(purchase)
doc.update({f"{prefix}_{key}": value for key, value in inward_supply.items()})
if doc.supplier_gstin:
doc.pan = doc.supplier_gstin[2:-3]
+
+ if doc.get("irn_gen_date"):
+ doc.irn_gen_date = format_date(doc.irn_gen_date)
Add additional inward supply fields to document view and excel export