Skip to content

Commit

Permalink
fix: use get_gstin_list function for fetching list of gstins in GST…
Browse files Browse the repository at this point in the history
…R1 Report
  • Loading branch information
ljain112 committed Sep 4, 2024
1 parent c099283 commit 5e657ec
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions india_compliance/gst_india/report/gstr_1/gstr_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
get_hsn_data,
get_hsn_wise_json_data,
)
from india_compliance.gst_india.utils import get_escaped_name, get_gst_accounts_by_type
from india_compliance.gst_india.utils import (
get_escaped_name,
get_gst_accounts_by_type,
get_gstin_list,
)
from india_compliance.gst_india.utils.exporter import ExcelExporter
from india_compliance.gst_india.utils.gstr_1 import SUPECOM

Expand Down Expand Up @@ -2199,19 +2203,7 @@ def get_company_gstin_number(company, address=None, all_gstins=False):
gstin = frappe.db.get_value("Address", address, "gstin")

if not gstin:
filters = [
["is_your_company_address", "=", 1],
["Dynamic Link", "link_doctype", "=", "Company"],
["Dynamic Link", "link_name", "=", company],
["Dynamic Link", "parenttype", "=", "Address"],
["gstin", "!=", ""],
]
gstin = frappe.get_all(
"Address",
filters=filters,
pluck="gstin",
order_by="is_primary_address desc",
)
gstin = get_gstin_list(company)
if gstin and not all_gstins:
gstin = gstin[0]

Expand Down

0 comments on commit 5e657ec

Please sign in to comment.