Skip to content

Commit

Permalink
fix: changes as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket322 committed May 21, 2024
1 parent dafce77 commit e61b7af
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 29 deletions.
12 changes: 10 additions & 2 deletions india_compliance/gst_india/utils/gstr_2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ def download_gstr_2a(gstin, return_periods, otp=None, gst_categories=None):
return response

if response.error_type == "not_generated":
frappe.msgprint("No data has found for {0}".format(return_period))
frappe.msgprint(
_(
"No record is found in GSTR-2B or generation is still in progress"
),
title=_("Not Generated"),
)
continue

if response.error_type == "no_docs_found":
Expand Down Expand Up @@ -155,7 +160,10 @@ def download_gstr_2b(gstin, return_periods, otp=None):
return response

if response.error_type == "not_generated":
frappe.msgprint("No data has found for {0}".format(return_period))
frappe.msgprint(
_("No record is found in GSTR-2B or generation is still in progress"),
title=_("Not Generated"),
)
continue

if response.error_type == "no_docs_found":
Expand Down
2 changes: 1 addition & 1 deletion india_compliance/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ execute:from erpnext.stock.doctype.repost_item_valuation.repost_item_valuation i
india_compliance.patches.v14.set_item_details_from_purchase_invoice_to_bill_of_entry
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.delete_gstr_import_log_with_error_type_RET2B1023
india_compliance.patches.v14.delete_not_generated_gstr_import_log

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import json

import frappe


def execute():
requests = frappe.get_all(
"Integration Request",
filters={
"url": ("like", "%gstr2b%"),
"data": ("!=", ""),
"output": ("like", "%RET2B1023%"),
},
fields=["data", "output"],
)

for request in requests:
request_data = json.loads(request.data)

frappe.db.delete(
"GSTR Import Log",
filters={
"data_not_found": 1,
"return_type": "GSTR2b",
"gstin": request_data.get("gstin", ""),
"return_period": request_data.get("rtnprd", ""),
},
)

0 comments on commit e61b7af

Please sign in to comment.