File tree Expand file tree Collapse file tree
gst_india/doctype/purchase_reconciliation_tool Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 save_gstr_2a ,
5454 save_gstr_2b ,
5555)
56+ from india_compliance .utils import get_hash
5657
5758STATUS_MAP = {
5859 "Accept" : "Reconciled" ,
@@ -135,6 +136,16 @@ def download_gstr(
135136
136137 TaxpayerBaseAPI (company_gstin ).validate_auth_token ()
137138
139+ job_id = get_hash (
140+ {
141+ "company_gstin" : company_gstin ,
142+ "date_range" : date_range ,
143+ "return_type" : return_type ,
144+ "return_period" : return_period ,
145+ "gst_categories" : gst_categories ,
146+ }
147+ )
148+
138149 frappe .enqueue (
139150 download_gstr ,
140151 company_gstin = company_gstin ,
@@ -144,6 +155,7 @@ def download_gstr(
144155 force = force ,
145156 gst_categories = gst_categories ,
146157 queue = "long" ,
158+ job_id = job_id ,
147159 now = frappe .flags .in_test ,
148160 timeout = 1800 ,
149161 )
Original file line number Diff line number Diff line change 1+ import hashlib
2+ import json
3+
4+
5+ def get_hash (data : list | dict | str ) -> str :
6+ if isinstance (data , dict | list ):
7+ data = json .dumps (data , sort_keys = True )
8+
9+ if isinstance (data , str ):
10+ data = data .encode ()
11+
12+ return hashlib .sha256 (data ).hexdigest ()
You can’t perform that action at this time.
0 commit comments