resilient-tech / india-compliance

Simple, yet powerful compliance solutions for Indian businesses
https://indiacompliance.app
GNU General Public License v3.0
150 stars 139 forks source link

Handle transaction where GST No. is not Set in Purchase Reco Tool #2115

Closed ljain112 closed 5 months ago

ljain112 commented 6 months ago

https://support.frappe.io/app/hd-ticket/14946

RouteForm/Purchase Reconciliation Tool/Purchase Reconciliation Tool

    TracebackTraceback (most recent call last):

     File "apps/frappe/frappe/app.py", line 110, in application

     response = frappe.api.handle(request)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/api/__init__.py", line 49, in handle

     data = endpoint(**arguments)

     ^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call

     return frappe.handler.handle()

     ^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/handler.py", line 49, in handle

     data = execute_cmd(cmd)

     ^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/handler.py", line 85, in execute_cmd

     return frappe.call(method, **frappe.form_dict)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/__init__.py", line 1768, in call

     return fn(*args, **newargs)

     ^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper

     return func(*args, **kwargs)

     ^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs

     doc.save()

     File "apps/frappe/frappe/model/document.py", line 337, in save

     return self._save(*args, **kwargs)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/model/document.py", line 373, in _save

     self.run_before_save_methods()

     File "apps/frappe/frappe/model/document.py", line 1091, in run_before_save_methods

     self.run_method("validate")

     File "apps/frappe/frappe/model/document.py", line 962, in run_method

     out = Document.hook(fn)(self, *args, **kwargs)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/model/document.py", line 1322, in composer

     return composed(self, method, *args, **kwargs)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/model/document.py", line 1304, in runner

     add_to_return_value(self, fn(self, *args, **kwargs))

     ^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/frappe/frappe/model/document.py", line 959, in fn

     return method_object(*args, **kwargs)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/india_compliance/india_compliance/gst_india/doctype/purchase_reconciliation_tool/purchase_reconciliation_tool.py", line 83, in validate

     _Reconciler.reconcile(row["original"], row["amended"])

     File "apps/india_compliance/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py", line 791, in reconcile

     purchases = self.get_pan_level_data(purchases)

     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

     File "apps/india_compliance/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py", line 941, in get_pan_level_data

     pan = gstin[2:-3]

     ~~~~~^^^^^^

    TypeError: 'NoneType' object is not subscriptable

    Request Data{

     "type": "POST",

     "args": {

            "doc": "{\"name\":\"Purchase Reconciliation Tool\",\"owner\":\"Administrator\",\"modified\":\"2024-05-10 16:58:08.839766\",\"modified_by\":\"[hr.kbpcivil@gmail.com](mailto:hr.kbpcivil@gmail.com)\",\"docstatus\":0,\"idx\":\"0\",\"company\":\"KBP Civil Engineering Services (Partnership)\",\"include_ignored\":0,\"company_gstin\":\"27AAQFK6955L1ZF\",\"purchase_period\":\"Custom\",\"purchase_from_date\":\"2022-01-01\",\"purchase_to_date\":\"2023-03-31\",\"inward_supply_period\":\"Custom\",\"inward_supply_from_date\":\"2022-01-01\",\"inward_supply_to_date\":\"2023-03-31\",\"gst_return\":\"GSTR 2B\",\"is_modified\":0,\"reconciliation_data\":null,\"doctype\":\"Purchase Reconciliation Tool\",\"__onload\":{\"has_missing_2b_documents\":false},\"__unsaved\":true}",

     "action": "Save"

     },

     "freeze": true,

     "headers": {},

     "error_handlers": {},

     "url": "/api/method/frappe.desk.form.save.savedocs",

     "request_id": "923950a9-d029-41db-9f26-7fd802b2c4ac"

    }

    Response Data{

     "exception": "TypeError: 'NoneType' object is not subscriptable",

     "exc_type": "TypeError",

     "_exc_source": "india_compliance (app)"

    }
india-compliance-bot commented 5 months ago

:tada: This issue has been resolved in version 14.26.6 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

india-compliance-bot commented 5 months ago

:tada: This issue has been resolved in version 15.7.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: