Skip to content

Commit

Permalink
fix: rename field and create patch
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit committed Jan 7, 2025
1 parent 357678f commit f576494
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def is_gstr1_api_enabled(self, settings=None, warn_for_missing_credentials=False
if not is_production_api_enabled(settings):
return False

if not settings.compare_gstr_1_data:
if not settings.enable_gstr_1_api:
return False

if not settings.has_valid_credentials(self.gstin, "Returns"):
Expand Down
22 changes: 11 additions & 11 deletions india_compliance/gst_india/doctype/gst_settings/gst_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"e_invoice_applicable_from",
"e_invoice_applicable_companies",
"gstr_1_section_break",
"enable_gstr_1_api",
"compare_unfiled_data",
"compare_gstr_1_data",
"filing_frequency",
"column_break_cxmn",
"restrict_changes_after_gstr_1",
Expand Down Expand Up @@ -611,14 +611,6 @@
"fieldtype": "Check",
"label": "Restrict Changes to Transactions After Filing"
},
{
"default": "0",
"depends_on": "eval: india_compliance.is_api_enabled(doc)",
"description": "Use APIs to compare records with GST Portal After Filing",
"fieldname": "compare_gstr_1_data",
"fieldtype": "Check",
"label": "Compare Data with GST Portal After Filing"
},
{
"default": "0",
"depends_on": "eval: doc.enable_e_waybill",
Expand Down Expand Up @@ -672,17 +664,25 @@
},
{
"default": "1",
"depends_on": "eval: india_compliance.is_api_enabled(doc)",
"depends_on": "eval: india_compliance.is_api_enabled(doc) && doc.enable_gstr_1_api",
"description": "Use API to compare records with GST Portal Before Filing.",
"fieldname": "compare_unfiled_data",
"fieldtype": "Check",
"label": "Compare Data with GST Portal Before Filing"
},
{
"default": "0",
"depends_on": "eval: india_compliance.is_api_enabled(doc)",
"description": "Use APIs to compare records with GST Portal and File GST Returns",
"fieldname": "enable_gstr_1_api",
"fieldtype": "Check",
"label": "Enable GSTR-1 API Features"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-12-30 13:13:35.102729",
"modified": "2025-01-07 16:34:55.885085",
"modified_by": "Administrator",
"module": "GST India",
"name": "GST Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2868,7 +2868,7 @@ function is_gstr1_api_enabled() {
return (
india_compliance.is_api_enabled() &&
!gst_settings.sandbox_mode &&
gst_settings.compare_gstr_1_data
gst_settings.enable_gstr_1_api
);
}

Expand Down
3 changes: 2 additions & 1 deletion india_compliance/gst_india/setup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ def set_default_gst_settings():
"reconcile_for_b2b": 1,
"reconcile_for_cdnr": 1,
# GSTR-1
"compare_gstr_1_data": 1,
"enable_gstr_1_api": 1,
"compare_unfiled_data": 1,
"freeze_transactions": 1,
"filing_frequency": "Monthly",
}
Expand Down
1 change: 1 addition & 0 deletions india_compliance/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ india_compliance.patches.v14.set_item_details_from_purchase_invoice_to_bill_of_e
india_compliance.patches.v14.update_item_gst_details_and_gst_trearment_in_bill_of_entry
india_compliance.patches.v14.update_default_auto_reconciliation_settings
india_compliance.patches.v14.update_default_gstr1_settings
india_compliance.patches.v14.rename_gstr1_settings
india_compliance.patches.v14.stop_unnecessary_scheduled_jobs
india_compliance.patches.v14.add_match_found_in_purchase_reconciliation_status
india_compliance.patches.v14.unset_inward_supply_link_for_cancelled_purchase
Expand Down
11 changes: 11 additions & 0 deletions india_compliance/patches/v14/rename_gstr1_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import frappe


def execute():
settings = frappe.get_cached_doc("GST Settings")
if not settings.compare_gstr_1_data:
return

frappe.db.set_value(
"GST Settings", None, {"enable_gstr_1_api": 1, "compare_unfiled_data": 1}
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def execute():
frappe.db.set_single_value(
"GST Settings",
{
"compare_gstr_1_data": 1,
"enable_gstr_1_api": 1,
"freeze_transactions": 1,
"filing_frequency": "Monthly",
},
Expand Down

0 comments on commit f576494

Please sign in to comment.