Skip to content

Commit

Permalink
fix: Link Integration Requests with GST Returns Log
Browse files Browse the repository at this point in the history
(cherry picked from commit acaf0c5)
  • Loading branch information
vishakhdesai authored and mergify[bot] committed Aug 22, 2024
1 parent 9f4778b commit 06a3685
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions india_compliance/gst_india/api_classes/taxpayer_returns.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import frappe
from frappe import _

from india_compliance.gst_india.api_classes.taxpayer_base import TaxpayerBaseAPI


Expand Down Expand Up @@ -58,6 +61,19 @@ def get_data(self, action, return_period, otp=None):
class GSTR1API(ReturnsAPI):
API_NAME = "GSTR-1"

def setup(self, doc=None, *, company_gstin=None):
if doc:
company_gstin = doc.gstin
self.default_log_values.update(
reference_doctype=doc.doctype,
reference_name=doc.name,
)

if not company_gstin:
frappe.throw(_("Company GSTIN is required to use the GSTR-1 API"))

super().setup(company_gstin=company_gstin)

def get_gstr_1_data(self, action, return_period, otp=None):
return self.get(
action=action,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,13 @@
],
"in_create": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-07-14 18:35:34.743195",
"links": [
{
"link_doctype": "Integration Request",
"link_fieldname": "reference_docname"
}
],
"modified": "2024-08-14 17:53:03.509293",
"modified_by": "Administrator",
"module": "GST India",
"name": "GST Return Log",
Expand Down
2 changes: 1 addition & 1 deletion india_compliance/gst_india/utils/gstr_1/gstr_1_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def download_gstr1_json_data(gstr1_log):

is_queued = False
json_data = frappe._dict()
api = GSTR1API(gstin)
api = GSTR1API(gstr1_log)

if gstr1_log.filing_status == "Filed":
return_type = "GSTR1"
Expand Down

0 comments on commit 06a3685

Please sign in to comment.