E Invoicing GST Validation Error

Hi,

I am trying to setup E Invoicing for a client.

Though the documentation says that E Invoicing is supported on Ver 13, those options are available on ERPNext: v12.19.0 (version-12); Frappe Framework: v12.16.1 (version-12).

All instructions have been followed. Yet, when the Sales Invoice is saved in the Draft and Generate IRN is Clicked in the E Invoicing option, I get the following error:

E Invoice Validation Failed
Distance 0 should be between 1.0 and 9999.0
Distance 0 should be between 1.0 and 9999.0

The Distance value has been updated in the Distance field in the Transporter Section.

Here’s the relevant part from the Error Message:

“EwbDtls”: {
“TransName”: “Ajanta Roadlines”,
“TransMode”: “1”,
“Distance”: 435,
“TransDocDt”: “19/03/2021”,
“VehNo”: “HR38V4441”,
“VehType”: “R”

Not sure if the Distance value not being in “” has anything to do with it. Like does it have to be

    "Distance": "435",

for it to work correctly?

Does anybody know what the problem could be?

Thanks

Jay

Can somebody help, please?

Thanks

Jay

@Saqib_Ansari Can you look into it?

Distance should be an integer and not under quotes. Not sure what is the problem. Everything looks fine in the JSON.

Can you forward the message from the error log? I want to check if this is coming from erpnext validation or from IRP.

Hi Saqib,

Here’s the error from the console:

Traceback (most recent call last):
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/app.py”, line 67, in application
response = frappe.api.handle()
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/api.py”, line 59, in handle
return frappe.handler.handle()
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/handler.py”, line 24, in handle
data = execute_cmd(cmd)
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/handler.py”, line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/init.py”, line 1074, in call
return fn(*args, **newargs)
File “/home/mmpy27/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py”, line 813, in get_einvoice
return make_einvoice(invoice)
File “/home/mmpy27/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py”, line 372, in make_einvoice
throw_error_list(errors, _(‘E Invoice Validation Failed’))
File “/home/mmpy27/frappe-bench/apps/erpnext/erpnext/regional/india/e_invoice/utils.py”, line 379, in throw_error_list
frappe.throw(“

    {}
”.format(‘’.join(li)), title=title)
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/init.py”, line 380, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable)
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/init.py”, line 359, in msgprint
_raise_exception()
File “/home/mmpy27/frappe-bench/apps/frappe/frappe/init.py”, line 319, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.ValidationError:
  • Distance 0 should be between 1.0 and 9999.0
  • Distance 0 should be between 1.0 and 9999.0

Can’t figure out the cause. Try generating IRN without e-way bill details. Once IRN gets generated you can generate e-way bill using a separate option under E-invoicing group button.

I think I am missing a big piece over here. How does a self hosted (on the cloud though) instance of ERPNext do the E Invoicing handshakes with the GSP? So there are two different components here I guess:

ERPNext Instance to GSP (Adaequare Systems)

GSP to GST E Invoicing site

So, the credentials that you have to enter on ERPNext E Invoicing Settings page are credentials that are provided to you by your GSP, I guess.

And the credentials that you have to input on the GST Website is the credentials that Adaequare uses to negotiate the session with the GST Portal I guess.

Can you detail out how this works?

Thanks

Jay

The credentials we put under E-invoice Settings is generated from e-invoice portal by selecting Adequare GSP as suvidha provider. Hence the credentials generated are only for connecting with Adequare GSP.

Now, Adequare GSP manages all the needs to authenticate with IRP portal.

We just need credentials to connect with Adequare which a user can generate on their own.

Hi Saqib,

Will Adaequare allow any one to use their GSP services to file E Invoices? I’m guessing they will need to be paid for their services. Unless they are offering this as a free service.

ERPNext for the E Invoice talks to Adaequare, Adaequare then talks to the GST Portal. Now the credentials that are updated on ERPNext can very well be entered on the GST Portal too. But shouldn’t Adaequare have to provide those credentials? Is that the missing link in my setup?

Thanks

Jay

The subscription for these services has been taken up by us, Frappe team, which has provided us with credentials to authenticate multiple of our users.

Adequare just has to provide their users these client credentials which can be used by a single GSTIN or can be used to manage multiple.

We maintain a log for each API request made by every user, so that we can charge them at a later stage.

We initially decided to keep e-invoice generation free upto a particular limit.

Hi Jay,

We arr trying to setup e-invoice on v10 and have bought a subscription for adaequare for 12000 inr for 100,000 requests to the GST portal per year.

Dont know if this helps.

Regards,

Jai

Hi Saquib,

I came across this post right now but since it is D day for e invoicing, we have purchased a subscription from Adequare, because when we contacted them for credentials, they mentioned we have to purchase the subscription.

Also, on the main ERP Next documentation it is not mentioned users do not need to purchase subscription.

Can you please guide us on how will this work out. Also, after completing the configuration as per the guidance of Adequare, we are still stuck on the same error. Please help as from today onwards this functionality is business critical for many clients.

  • Distance 0 should be between 1.0 and 9999.0
  • Distance 0 should be between 1.0 and 9999.0

Have understood that only ERPNext.com users do not need a subscription. For Frappe.Cloud Users the subscription will be needed. Do confirm if the understanding is correct.

ERPNext.com users have their usage mapped with the ERPNext support application, so we can charge them accordingly. Hence they don’t need a subscription but they do pay for the e-invoicing service.

I am trying to debug this issue for a frappe cloud customer. I’ll update once I get it fixed.
It’ll get fixed today itself.

Meanwhile can you try generating IRN without entering transporter details? Do not set transported, distance, mode of transport. Keep every field blank and try

Thanks for your attention on this. I tried making every field in the Transporter Section blank. The Distance field gets updated to 0.00000000 after Save.

But same error still.

Thanks

Jay

Hi Saqib,

We have kept all the fields blank and still getting the same error. Same as mentioned by Mr. Jayram above.

If you can run bench commands on to your site, then please try running bench --site [site_name] clear-cache & if its on production run bench restart --web.

Not sure if this will resolve but recently I had faced an issue regarding the “repeating error message” that was resolved by this.

I have tried restoring a database of a site having the same problem. However, the issue wasn’t replicated locally even with the same database and exact same frappe & erpnext versions

Whoa! That seems to have done the trick. Will report back in a bit!

Thanks

Jay

@nextchamp.saqib

Where is the option to run bench --site [site_name] clear-cache command for Frappe Cloud user?

1 Like