EHF Norway DAX 2012- setup
Reviewed 30/4-2015
You can use electronic invoicing in Microsoft Dynamics AX for sending electronic invoices to public enterprises in the Official Information Online Universal Business Language (OIOUBL) format – in Norway Electronic HandelsFormat (EHF). The current supported version is EHF 2.0.04.
Very useful document for file format and data on the file:
You can test whether your invoices, credit notes and reminders are in accordance with the requirements of electronic trading format (EHF) at:
.
Setting up EHF for Norway:
This document includes examples for
A Basic setup EHF
B AIF
C Batch processing
DSetup for company
ESetup for public sector customer
FNotes
- Basic setup
Set up the following folder structure in a shared location that can be accessed from the Application Object Server (AOS) computer and from any client computers that are used as batch servers in your system.
- Set up the following folder structure for project invoices:
\\Server\OIOUBL\Project\Error
\\Server\OIOUBL\Project\Processed files
\\Server\OIOUBL\Project\Source
\\Server\OIOUBL\Project\Target
\\Server\OIOUBL\Project\XSLT
Set up the following folder structure for sales invoices:
\\Server\OIOUBL\Sales\Error
\\Server\OIOUBL\Sales\Processed files
\\Server\OIOUBL\Sales\Source
\\Server\OIOUBL\Sales\Target
\\Server\OIOUBL\Sales\XSLT
The folders are used as:
Error –Error messages that are generated when the .xml file is converted to the OIOUBL format.
Source –Raw xml-file generated by Microsoft Dynamics AX.
Processed files – Storage for the raw xml-file after the final EHF-file has been generated. The raw xml-fileis moved from the Source folder to this folder.
Target – Used to save the final xml-file (this file is send to the access point).
XSLT – Used to save the eProjectInvoice_NO_OIOUBL oreSalesInvoice_NO_OIOUBL file (style sheet).
- In AOT | Resources | Open and export following style sheets to the corresponding location:
File Location
eProjectInvoice_NO_OIOUBL.xsl \\Server\OIOUBL\Project\XSLT
eSalesInvoice_NO_OIOUBL.xsl \\Server\OIOUBL\Sales\XSLT
- AIF
Use the Outbound ports form to create an outbound port, set up services and adapters for an outbound port, and specify the Application Integration Framework (AIF) settings that are required to generate Offentlig Information Online Universal Business Language (OIOUBL) electronic invoices.
- Click System administration > Setup > Services and Application Integration Framework > Outbound ports.
- In the Port name and Description fields, enter a name and a description for the outbound port.
NOTE: you need one port for sales invoices and one for project invoices.
- In the Adapter field, select File system adapter.
This adapter is used to create and save the OIOUBL electronic invoices.
- In the URI field, specify the location of the Source folder where the raw xml-file is created (ref. the folders setup in point A.).
- Click the Service contract customizations FastTab, and then click Service operations.
Select the SalesSalesEInvoiceService.read service operation for sales invoices, or the ProdProjEInvoiceService.read service operation for project invoices, and move it to the Selected service operations list. Close the form.
NOTE: If you for any reason do not see the needed service operation, you need to refresh Services:
AOT | Right click the service – Add-Ins | Register Service
- In the Outbound ports form, select the Customize documents check box, and then click Data policies.
- In the Document data policies form, click Enable all to select all XML schema elements, and then close the form (these fields with values are transferred to the raw xml-file; fields not used in the EHF-file can be omitted).
- Click the Processing options FastTab,
- Default encoding format field, select UTF-8.
- Mark up Apply value mapping. In the value mapping form, tab page Units, choose Document value External code and the desired Unit code:
- Click the Troubleshooting FastTab, and then in the Logging mode field, select All document versions.
- Select the Include exceptions in fault check box to display the X++ error messages.
- Click the Security FastTab, and then in the Restrict to company field, select the company for which the electronic invoices are generated.
- Click Activate to use the port to exchange data by using AIF and close the form.
- Follow the above steps for Project invoices.
- Batch processing
You need set up a batch job for sales outbound electronic invoices (here EHFS), and another batch job for project outbound electronic invoices (here EHFP).
- Click System administrationInquiriesBatch jobsBatch jobs.
- Press CTRL+N to create a batch job, and then in the Job description field, enter description for the batch job.
- Save the batch job, and then click View tasks.
You need to setup three tasks, one per class. The classes used are:
- AifOutboundProcessingService
- AifGatewaySendService
- EInvoiceFileTransform_OIOUBL
- In the Batch tasks form, press CTRL+N to create a new batch task (1. Task).
- Task description 1
- In the Company accounts field, select the company you are creating the batch job for
- Class name AifOutboundProcessingService
- Choose batch group with selected batch server
- CTRL+N to create a new batch task (2. Task).
- Task description 2
- In the Company accounts field, select the company you are creating the batch job for
- Class name AifGatewaySendService
- Choose batch group with selected batch server
- On the lower pain of the Batch task form, click Ctrl+N and add condition where 1. Task has status Ended (before the selected task, here task 2, can start)
- CTRL+N to create a new batch task (3. Task).
- Task description 3
- In the Company accounts field, select the company you are creating the batch job for
- Class name EInvoiceFileTransform_OIOUBL
- Choose batch group with selected batch server
- On the lower pain of the Batch task form, click Ctrl+N and add condition where 2. Task has status Ended (before the selected task, here task 3, can start)
- Still on the 3. Task, click Parameters
- In the E-invoice OIOUBL XSL File Transformation form, specify the locations of the Source, Target, Processed, and Error file storage folders. For the XSLT file path, select the path for the eSalesInvoice_NO_OIOUBL file for sales invoices (here EHFS), or the path for the eProjectInvoice_NO_OIOUBL (EHFP) file for project invoices, and click OK.
- Close the Batch task form.
- On Batch job form, choose Recurrence and define the desired recurrence (for testing purposes 2 minutes works fine).
- After batch job setup, choose Functions | Change status and change the status to Waiting
- Company setup
The country code for company primary address is NOR in order to enable eInvoice field on the customer setup.
- General ledger | Setup | Organization | Legal entities (here DEMF) – Primary address country code NOR for Norway
- Company VAT number:
- Company bank account (bank account connected the default method of payment on the public sector customer – the payee’s bank account number)
DEMF/Cash and bank management/Common/Bank accounts (example for testing purposes):
3.1.Method of payment DEMF/Accounts receivable/Setup/Payment/ Method of payments (example)
- Sales tax code values
Sales tax code values used in Norway are converted to sales tax (VAT) categories. In order to get the correct categories on the file, the sales tax code values used on the invoice must have the sales tax code value used in Norway.
Rates used as of January 2015 with corresponding VAT categories:
Source:
EHF Implementation guide
Invoice and Credit note
Version: 2.0.4
Date: March 01, 2015
Example:
- Unit codes
Unit code MUST be coded according to the UN/ECE Recommendation 20; Source:
DIFI EHF Implementation guide
Invoice and Credit note
Version: 2.0.2
Date: August 19, 2014
The code list:
In AX (example; if the unit in AX is pcs, the value used on the file is the external code value; here C62):
DEMF/Organization administration/Setup/Units
- Publicsector agency (customer account)
Choose the desired customer: Accounts receivable > Common > Customers > All customers (here 1000 – Norwegian PS)
- In the Customers form, click Edit, and then click the Addresses FastTab to verify that the country/region code, ZIP/postal Code, and street name are entered for the primary address.
- Click the Invoice and delivery fastTab and mark the field for eInvoice and ensure the Tax exempt number is filled in with the organization number + MVA.
- Click the Payment defaults FastTab, and then in the Method of payment field, select a method of payment for the customer. Company bank account number is fetched from the bank account number on the default method of payment on the customer.
- On the Action Pane, click Contacts > Ensure the selected customer has contact setup
- Notes
- Registering invoice, Customer requisition and Reference are recommended:
Example: Free text invoice header
- The buyer's accounting code applied to the Invoice Line SHOULD be provided according to EHF. This choice can be done on the invoice header:
And the dimension account on invoice line level:
- In order to sent the invoice to batch queue, the invoice must be sent to printer when posting the invoice.
If for any reason the invoice is not set to batch queue, the invoice can be re-sent electronically by choosing invoice journal and Send:
Page 1of18