Sales Order Invoicing Error

I am working on AX 2012 R2.

While invoicing the sales order I am getting below error message.

"DocStatus Is invalid for this operation"

Please suggest if any idea what is causing the issue

What are you invoicing? An unconfirmed order? What is the DocStatus of the order? Invoiced?

Hi Adam,

After confirming the SO I am invoicing then I am getting the above error…

The doc status is OpenOrder

Are you manually invoicing?

Have you shipped the item?

What parameter is set on invoicing?

On the invoice lines tab what is shown?

The above are the values in invoice lines tab.

I presume it is “All”. You would need to debug it, nothing looks wrong there.

I have debugged the class AVA_TaxEngine and the method is GetTax()

In the above marked code for the object iresultcode the value is populating as 2., in successful case it is zero.

But couldnt find from where the value two is coming.

Kindly suggest if you have any idea…/What_does_a_DocStatus_Error_mean?