Skip to content

Commit

Permalink
fix: update logs with specific gstin
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket322 committed Dec 5, 2024
1 parent 6eac348 commit 39bc072
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions india_compliance/gst_india/utils/gstin_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ def create_gst_return_log_for_quarter(gstin, log_names, filing_preference):
}
).insert()

update_logs_without_filing_preference()
update_logs_without_filing_preference(gstin)


def update_logs_without_filing_preference():
def update_logs_without_filing_preference(gstin):
gst_return_logs = frappe.get_all(
"GST Return Log",
filters={"filing_preference": ["is", "not set"]},
filters={"filing_preference": ["is", "not set"], "gstin": gstin},
fields=["name", "return_period", "gstin"],
)

Expand Down Expand Up @@ -445,8 +445,8 @@ def update_logs_without_filing_preference():
gst_return_log = frappe.qb.DocType("GST Return Log")
case_conditions = Case()

for name, preference_data in logs_to_update.items():
case_conditions.when(gst_return_log.name == name, preference_data)
for log_name, filing_preference in logs_to_update.items():
case_conditions.when(gst_return_log.name == log_name, filing_preference)

(
frappe.qb.update(gst_return_log)
Expand Down

0 comments on commit 39bc072

Please sign in to comment.