A country-specific hotfix to support Electronic invoice under GST for India in Microsoft Dynamics AX 2012 R3

Applies to: Dynamics AX 2012 R3

Summary


An electronic invoice is a legally accepted digital taxreceipt document that your organization registers at Invoice RegistrationPortal (IRP). By using Microsoft Dynamics AX to generate electronic invoices,you help make sure that the electronic invoices that your organizationgenerates are secure, confidential, authentic, and legally acceptable. You canalso make sure that required standards are applied to your electronic invoices.

 

You can generate an electronic invoice for the followingdocuments:

  • Customer invoice
  • Free text invoice
  • Project invoice
  • and their Credit notes

More information


Prerequisites for using electronic invoices

To use electronic invoices in your organization, you mustcomplete the following tasks as prerequisite:

Note: You will need your GSTIN, Username,Password, Client ID and the Client secret.

Configure a digital certificate for communicationwith IRP

Complete the below steps to extract certificateand import it for the local computer:

 1. Double-click the downloaded certificate filehaving '.cer' extension.

image.png

2. In the opened window click "InstallCertificate…":

image.png

3. In the next window select "LocalMachine" and click Next:


image.png
4. In the next window select the option "Placeall certificates in the following store" and click Browse:
image.png


   Select "Personal" folder and click OK:

image.png

   Then click Next.
5. In the next window click Finish:
image.png


6. Installation is complete:

image.png
 

Information that is included in electronic invoices

An electronic invoice includes the followingdetails:

  • The name, address, contact information and GSTINnumbers of the organization (seller) and a customer (buyer)
  • The invoice number, the date, and the documenttype
  • Details of goods and services for each item sold:
    • Serial number of the item
    • Indication whether it is a service supply
    • SAC \ HSN code
    • Quantity, unit of measure and unit price
    • GST rate
    • Applied charges or discounts
    • Totals for invoice line
  • The document total details containingitemization of invoice totals

Configuring system to use electronic invoicing

Please complete the below procedures to set up the system touse electronic invoicing for India.

Set up unit of measure

You need to repeat that for all units of measure that youuse in electronic invoices to match allowed external codes.

  1. Go to Organizationadministration > Setup > Units > Units.
  2. Select one of units,eg. "ea" unit and click External codes.
  3. Enter Code (eg.EInv_IN) and External code definition

    Note: Code will beused across all units of measure to identify master data set of units ofmeasure codes accepted by electronic invoicing.
  4. Select your createdelectronic invoicing unit external code (eg."Einv_IN") and enter the Value(eg. "NOS") in the bottom grid of the form

 

Set up electronic invoice parameters

Goto Accounts receivable > Setup > eInvoices > Electronicinvoices parameters (India), fill in the following parameters:

Parameter

Parameter description

GSTIN

Your Goods and Services Taxpayer Identification Number, used for IRP integration.

User name

Your user name provided by NIC, used for IRP integration

User password

Your user password provided by NIC, used for IRP integration

Client Id

Your Client Id provided by NIC, used for IRP integration

Client secret

Your Client secret provided by NIC, used for IRP integration

Certificate

Your Certificate provided by NIC, used for IRP integration

Authorization URL path

Electronic invoice authorization URL path

Registration URL path

Electronic invoice registration URL path

Cancel URL path

Electronic invoice cancellation URL path

Unit code

Eternal code type for converting units of measure. Created earlier

Validate before posting

You can enable additional validation against all mandatory information to be included in the electronic invoice at the invoice posting time.

 

Set up HSN codes and products

The below procedures illustrate only the process of setting up a HSN code andassigning it to the product.

Define HSN code

  1. Go to General ledger> Setup > Tax > India > HSNcodes.
  2. Create a record.
  3. In the Chapter field,enter a value.
  4. In the Heading field,enter a value.
  5. In the Subheading field,enter a value.
  6. In the Country/regionextension field, enter a value.
  7. In the Statisticalsuffix field, enter a value.
  8. Save the record, and verify thatthe HSN code field is updated.
  9. In the Description field,enter a value.
  10. Select Close.

Assign HSN codes to products

  1. Go to Product information management >Products > Released products.
  2. Select a product, and then select Edit.
  3. On the General FastTab, if the producttype is Item, select a value in the HSN code field.

Set up tax registration numbers

Details how to setup GSTIN master data can be found in https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/ind-set-up-tax-registration-numbers. The below procedure illustrates only simplified process of setting upregistration numbers for use in electronic invoicing.

  1. Go to Generalledger > Setup > Enterprise tax registration numbers
  2. Crate a new record
  3. Select Tax type= GST and Registration number type = Company
  4. Enter the Registrationnumber and save the data
  5. Crate a new record
  6. Select Tax type= GST and Registration number type = Customer
  7. Enter the Registrationnumber and save the data

Set up your legal entity

1.       Go to Organizationadministration > Setup > Organization > Legalentities

2.       Expand the Addressestab and use button Add to create new or Edit already existing primary address

3.       Enter or update ZIP,Street, City, District, State and County

image.png

Note: Please note that States should have Statecodes assigned in Organizationadministration > Setup > Addresses> Address setup > State/province tab.

4.       In Editaddresses form expand Tax information fast tab

5.       Use Add to setName or description (eg. “GST”) and select previously created Company registrationnumber in GSTIN/GDI/UID field

6.       Close the Taxinformation and Address form

7.       Expand Contactinformation fast tab in Legal entities form to add Primary phone andPrimary email

 

Set up your customers

Open the customer master from Accountsreceivable > Common > Customers> All customers to enter or edit information required forelectronic invoicing.

Set up tax information

1.      Expand the Addresses tab for a selected customeraccount and use button Add to create new or Edit already existing primaryaddress

2.      Enter or update ZIP, Street, City,District, State and County

Note: Please note that States should have Statecodes assigned in Organizationadministration > Setup > Addresses> Address setup > State/province tab.

3.      In Edit addresses form expand Taxinformation fast tab

4.      Use Add to set Name or description(eg. “GST”) and select previously created customer registration number in GSTIN/GDI/UIDfield

5.      Close the Tax information and Addressform

Set up contact information

  1. Use Contacts button to either editexisting or create a new customer contact
  2. In Sales demographics tab of Customermaster, select existing Primary contact
  3. Expand Contact information fast tab in Customersform to add Primary phone and Primary email

Enable customer for electronic invoicing

  1. Expand Invoice and delivery fast tab in Customersform
  2. Check the eInvoice checkbox for a customer

Note: If this option is set to Yes,the system will be marking invoices posted for this customer account as readyfor electronic invoice processing.

Working with electronic invoices

When you post an invoice for e-invoice enabled customer froma sales order, Free text invoice or Project invoice proposal, the electronic invoicewill be created. You get information in notification center that Electronicinvoice [……..] has been created.

The central place to work all electronic invoices is Accountsreceivable > Periodic > eInvoices > Electronicinvoices (India). Review Details tab to see all the informationwhich will be populated at different stages of electronic invoice processing.

Field

Description

Sent data

Data sent to the service in JSON format

Acknowledgement number

Indian electronic invoice transaction number

Acknowledgement date and time

Date and time on which invoice is registered

Signed QR code

Signed QR code of the invoice received from IRP

Signed invoice

Signed invoice text received from IRP

Error message

The text of the error received from IRP

Created by

User ID that created an electronic invoice

Created date and time

Date and time when invoice was created

Sent by

User ID that sent an electronic invoice

Sent date and time

Date and time when invoice was sent

Cancelled by

User ID that cancelled an electronic invoice

Cancelled date and time

Date and time when invoice was cancelled

 

Source invoice opens an invoice journal for theinvoice used as base for electronic invoice. Upon electronic invoiceregistration, among other information you get the IRN and QR code that can beprinted in Tax invoice and Debit\Credit reports available in the Salesor Project invoice journals:

image.png

 

 

Register electronic invoice

You must have at least one electronic invoice with status Createdor Sending error to register invoices at IRP.

  1. Go to Accounts receivable > Periodic> eInvoices > Electronic invoices (India) and select one ormultiple invoices to be sent for registration at IRP
  2. Click Send button
  3. You can use Send electronic invoices formand query to change selection criteria for invoices to send.

Note: You can use Batch tab to definerecurrence and register posted invoices without user interaction.

 

Cancel electronic invoice

You may cancel invoice previously registered at IRP. Youmust have at least one electronic invoice with status Sent or Cancelingerror to cancel invoices at IRP.

  1. Go to Accounts receivable > Periodic> eInvoices > Electronic invoices (India) and select one ormultiple invoices to be cancelled at IRP
  2. Click Cancel button
  3. You can use Send electronic invoices formand query to change selection criteria for invoices to send.

Note: You can use Batch tab to definerecurrence and register posted invoices without user interaction.

Adding a field to JSON electronic invoice

This topic is addressed to users customizing the JSONelectronic invoice to include additional information, in necessary. It isprovided only as guidance and illustration for a person possessing requiredskills to customize the product using X++.

  1. Identify the contract which corresponds to theJSON part you are going to modify. Einvoice contract classes have the followingname pattern Einvoice*Contract_IN. For example:
    • EInvoiceSupplierInformationContract_IN(with 2 descendants for customer and project invoices:EInvoiceSupplierInfoCustInvContract_IN andEInvoiceSupplierInfoProjInvContract_IN)
    • EInvoiceBuyerInformationContract_INwith 2 descendants for customer and project invoices:EInvoiceBuyerInfoCustInvoiceContract_IN and EInvoiceBuyerInfoProjInvoiceContract_IN)
  2. Add a method to the parent abstract class whichwill return the needed data. In case data is extracted differently for customerand project invoices, override this method in each descendant and provide thenecessary implementation. Otherwise, method can be added to the abstract parentclass only.
  3. Identify the class responsible for JSONgeneration. Such classes have the following name pattern"Einvoice*Details_IN" and implement ITaxEngineJsonSerializableinterface. For example:
    • EInvoiceSellerDetails_IN
    • EInvoiceBuyerDetails_IN
  4. Add a variable to the class declarationcorresponding to the parameter you are going to add to the JSON file.
  5. Add a parm- method for this variable.
  6. Modify getJsonAttributes method correspondinglyby adding the newly created parm- method to the end of the list returned by thegetJsonAttributes  method. Also, in thegetJsonAttributes you will have to add the attribute name - just the same asshould be written in JSON file.
  7. In the EInvoiceCreateOutputFile_IN class locatethe method responsible for creating a JSON part which you are changing. Forexample:
    • insertSeller
    • insertBuyer
  8. Add a line to this method in order to add newdata to the JSON. For example
_sellerDetails.parmGSTIN(supplierInformationContract.getGSTIN());

This line will get the GSTIN number from the contract and will pass it to the "Details" class.
If your parameter cannot be empty, use the following pattern for additional validation:
    if (!_sellerDetails.parmGSTIN(supplierInformationContract.getGSTIN()))

    {

        ret = checkFailed(strFmt("@SYS136411", "@SYP4887805"));

    }

Note: Compile the project with your changes and restart all the AOSes before testing these changes.

Q: Can I specify additional criteria to be considered whenselecting invoices for electronic processing, either to register or cancelinvoice?

You can review and modify queriesused for invoice after using Send or Cancel function in Accountsreceivable > Periodic > eInvoices > Electronicinvoices (India). Button Select opens system query form to setup additionalor modify existing query criteria.

image.png

Q: Where can I find detailed information what went wrong foran invoice which was not successfully registered?

You can review received error code end messagein Accounts receivable > Periodic > eInvoices > Electronicinvoices (India).

image.png

 

Q: What is not is cope of electronic invoice solution forIndia?

  • Digital signature by seller
  • Generation of IRN
  • ISD Invoice
  • AP e-Invoice import

Q: What are the supported formats of electronic invoice forIndia?

The export of electronic invoicecan be done in JSON format that containing all required fields definedin technical specification. If there is another format or you need to add extrainformation to the electronic invoice message, it is to be done as customization.Please refer to Adding a field to JSON electronic invoice section ofthis article, for more details how to extend the supported JSON format.

Q: What are the supported integrations for Indian electronicinvoice registration?

The supported out of the box integrationis to IRP directly. Any other integration, for example with any GSP ofyour choice, is to be custom built by your ISV or implementation partner.

Note: Integration through GSP isnot supported by Microsoft natively.