forked from resilient-tech/india-compliance
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
india_compliance/patches/v14/delete_gstr_import_log_with_error_type_RET2B1023.py
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
india_compliance/patches/v14/delete_not_generated_gstr_import_log.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", ""), | ||
}, | ||
) |