Skip to content

Commit

Permalink
chore: simplify update gst category
Browse files Browse the repository at this point in the history
  • Loading branch information
vorasmit committed Jul 12, 2024
1 parent fec5bf2 commit 3d14d7f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions india_compliance/gst_india/doctype/gst_settings/gst_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,21 +365,15 @@ def update_gst_category():

# party-wise addresses
category_map = {}
gstin_wise_detail = {}
gstin_info_map = {}

for address in address_without_category:
gstin = address.gstin

if gstin not in gstin_wise_detail:
gstin_info = get_gstin_info(gstin)
gstin_wise_detail[gstin] = gstin_info
if gstin not in gstin_info_map:
gstin_info_map[gstin] = get_gstin_info(gstin)

gstin_info = gstin_wise_detail[gstin]

if not gstin_info:
continue

gst_category = gstin_wise_detail[gstin].get("gst_category")
gst_category = gstin_info_map[gstin].gst_category

category_map.setdefault(gst_category, []).append(address.name)

Expand Down

0 comments on commit 3d14d7f

Please sign in to comment.