Get started with electronic invoicing for Malaysia
This article provides information to help you get started with electronic invoicing for Malaysia. It guides you through the configuration steps that are country/region-dependent in Microsoft Dynamics 365 Finance or Dynamics 365 Supply Chain Management.
After you configure electronic invoicing, you can generate, digitally sign, and submit the XML files of electronic invoices according to the regulatory requirements in Malaysia.
Note
The electronic invoicing approach that this article describes is implemented by using an invoicing service that's applicable only to cloud deployments of Finance or Supply Chain Management.
Prerequisites
Before you begin the procedures in this article, the following prerequisites must be met:
- The primary address of the legal entity must be in Malaysia.
- Your company must be a registered taxpayer in Malaysia and must have the following registration numbers: Tax Identification Number (TIN) and Business Registration Number (BRN).
- Obtain Client ID and Client secret values in the Inland Revenue Board of Malaysia (IRBN) (Lembaga Hasil Dalam Negeri Malaysia [LHDN]). These values serve as credentials that are used to establish a secure connection to the IRBN portal.
- Obtain a digital signature certificate from one of the Malaysian certification authorities. This certificate is used for digital signing of generated electronic invoices.
- Become familiar with electronic invoicing as it's described in Electronic Invoicing service overview.
- Do the common part of electronic invoicing service configuration as described in Electronic invoicing configuration.
Configure Azure Key Vault
Create an Azure key vault to store the required certificates and secrets that are issued for your company. For more information, see Configure Azure resources for Electronic invoicing.
Add the following required elements in the key vault:
- The secret for the Client secret value that's used to establish secure communication to IRBN.
- The secret for the Client ID value that's used to establish secure communication to IRBN.
- The certificate that's used for digital signing of outgoing electronic invoices.
Configure Key Vault parameters for electronic invoicing
To configure Key Vault parameters for electronic invoicing, follow these steps.
Go to Organization administration > Setup > Electronic document parameters.
On the Electronic invoicing tab, in the Key Vault settings section, in the Key Vault field, select the reference to the key vault that you created in the previous section.
In the SAS token secret field, select the name of the storage account secret URL that must be used to authenticate access to the storage account.
Select Key Vault parameters.
On the Key Vault parameters page, in the Certificates section, select Add to create new elements of the appropriate type for each certificate or secret that's described in the previous section.
- A Client secret element of the Secret type
- A Client ID element of the Secret type
- A Certificate element of the Certificate type
Note
The values in the Name column should match the names of the certificates or secrets that are described in the previous section.
Configure the electronic invoicing feature
Some of the parameters from the Malaysian electronic invoicing (MY) electronic invoicing feature are published with default values. Before you deploy this feature to the service, review the default values, and update them as required, so that they better reflect your business operations.
To configure the electronic invoicing feature, follow these steps.
Import the latest version of the Malaysian electronic invoicing (MY) Globalization feature as described in Import features from the repository.
Create a copy of the imported Globalization feature, and select your configuration provider for it. For more information, see Create Globalization features.
On the Versions tab, verify that the Draft version is selected.
On the Setups tab, in the grid, select the Sales invoice derived feature setup, and then select Edit.
On the Processing pipeline tab, in the Processing pipeline section, select the Sign document for Malaysia action.
In the Parameters section, select the Certificate name parameter, and then, in the Value field, select the name of the digital certificate that you created.
In the Processing pipeline section, select the Integrate with MyInvois (Submit document) action.
In the Parameters section, select the Client secret parameter, and then, in the Value field, select the name of the secret that you created.
Select the Client ID parameter, and then, in the Value field, select the name of the client ID that you created.
In the Parameters section, select the Web service URL and Login service URL parameters. In the Value fields, enter the testing or production URLs, depending on the implementation stage. Review the list of available URLs in MyInvois system environment URLs.
Note
Alternatively, you can leave the Web service URL and Login service URL parameters blank. Instead, you can select the Environment type parameter, and then, in the Value field, select the type of the environment, depending on the implementation stage. In this case, the required URLs are automatically constructed. If the Web service URL and Login service URL parameters are defined, they have higher priority than the Environment type parameter.
Repeat steps 7 through 10 for the Integrate with MyInvois (Get document) action.
On the Processing pipeline tab, in the Processing pipeline section, select the Generate QR code for Malaysia action.
In the Parameters section, select the Environment type parameter, and then, in the Value field, select the type of the environment, depending on the implementation stage.
Select Save, and close the page.
Repeat steps 4 through 14 for the Project invoice derived and Self invoice derived feature setups.
The copy of the feature is always created as a Draft version. Regardless of whether you made changes, complete and deploy the feature as described in Complete and deploy a Globalization feature.
Configure electronic document parameters
To configure electronic document parameters, follow these steps.
Make sure that the country/region-specific Electronic reporting (ER) configurations for the document context and electronic document model mapping that are required for Malaysia are imported. For more information, see Set up Electronic document parameters.
Note
After you import the Malaysian electronic invoicing (MY) electronic invoicing feature, electronic documents are configured by default. Follow the remaining steps of this procedure if you must make changes. Otherwise, consider this section informational only.
Go to Organization administration > Setup > Electronic document parameters.
On the Electronic document tab, add records for the Customer Invoice journal, Vendor Invoice journal, and Project invoice table names.
For each table name, set the Document context and Electronic document model mapping fields in accordance with step 1.
For each table name, select Response types, select New to create a response type, and enter the following values:
In the Response type field, enter ResponseData (the default value).
In the Description field, enter any meaningful name. Alternatively, leave the field blank.
In the Submission status field, select Pending.
In the Data entity name field, select one of the following values, depending on the table name that you're configuring:
- For the Customer Invoice journal table name, select Sales invoice entity.
- For the Project invoice table name, select Project invoice entity.
- For the Vendor Invoice journal table name, select Self invoice entity.
In the Model mapping field, select MY response data details format.
Note
ResponseData is the default name of the response type. If you must change it, make sure that the new name matches the name that was defined for the related variable of the To client type in the corresponding feature setups. To validate the variable's value, go to Globalization Studio, and select the Electronic invoicing tile. On the Electronic invoicing features page, verify that the Malaysian electronic invoicing (MY) feature is selected. On the Setups tab, in the grid, select the Sales invoice derived feature setup. Then select Edit or View, depending on the status of the feature version.
Select Save, and close the page.
Note
The setup that's described here lets you submit electronic invoices for the following posted source documents:
- Customer invoices that are based on sales orders
- Free text invoices
- Project invoices
- Self invoices that are based on vendor invoices from foreign vendors
- Credit notes and debit notes for all the previously described invoice types
- Refund notes, which represent credit notes for already paid invoices.
On the Features tab, select and enable the Malaysian electronic invoice feature.
Save your changes on the Electronic document parameters page, and then close the page.
Configure registration numbers
Note
When the output files of electronic invoices are generated, registration numbers of the Enterprise ID (COID) category are used as Business Registration Numbers (BRNs). If the Enterprise ID (COID) registration category already exists and has been assigned to a registration type, skip this procedure.
- Go to Organization administration > Global address book > Registration types > Registration types.
- Create a registration type.
- In the Country/region field, select MYS - Malaysia.
- Go to Organization administration > Global address book > Registration types > Registration categories.
- Create a registration category.
- In the Registration types field, select the registration type that you created in step 2.
- In the Registration categories field, select Enterprise ID (COID).
Configure Sales and Service Tax numbers
To configure Sales and Service Tax (SST) numbers, follow the instructions in GST/SST registration number.
Note
Make sure that the configured SST registration number is in the VAT ID registration category.
Configure electronic document property types
To configure the electronic document property type that's required to define the taxpayer activity code, follow these steps.
- Go to Accounts receivable > Setup > Electronic document property types.
- Select New to create an electronic document property type.
- In the Type field, enter ActivityCode. You must enter the value exactly as it appears here.
- On the Action Pane, select Applicability.
- In the Table name field, select CompanyInfo.
- Save and close the Electronic document property type applicability setup page.
- Select New to create another electronic document property type.
- In the Type field, enter ActivityDescription. You must enter the value exactly as it appears here.
- On the Action Pane, select Applicability.
- In the Table name field, select CompanyInfo.
- Select New to create the record for another applicable table.
- In the Table name field, select VendTable.
- Save and close the Electronic document property type applicability setup page.
- Save and close the Electronic document property types page.
Configure address structure
To configure the structure of the postal address to define all required elements, follow these steps.
Go to Organization administration > Global address book > Addresses > Address setup.
Make sure that all the following mandatory elements are configured:
- Country code
- Postal code
- City name
- Street
- State code
For the states, on the State/province tab, in the State code field, define the official state code according to the published requirements.
Configure legal entity data
Enter the address
To enter the address, follow these steps.
- Go to Organization administration > Organizations > Legal entities.
- Select a legal entity.
- On the Addresses FastTab, add a valid primary address for the selected legal entity.
Enter the registration numbers
To enter the registration numbers, follow these steps.
- Go to Organization administration > Organizations > Legal entities.
- Select a legal entity, and then, on the Tax registration FastTab, in the Tax registration number field, enter the company's TIN.
- On the Action Pane, select Registration IDs.
- On the Registration ID FastTab, select Add to create a registration ID.
- In the Registration type field, select the BRN registration type that you created earlier.
- In the Registration number field, enter a valid BRN registration number for the selected legal entity.
- Select Add to create another registration ID, if required.
- In the Registration type field, select the SST registration type that you created earlier.
- In the Registration number field, enter a valid SST registration number for the selected legal entity.
Enter a business activity code and description
To enter a business activity code and description, follow these steps.
- Go to Organization administration > Organizations > Legal entities.
- Select a legal entity, and then, on the Action Pane, select Electronic document properties.
- Select the line where the Type field is set to ActivityCode.
- In the Value field, enter the taxpayer business activity code.
- Select the line where the Type field is set to ActivityDescription.
- In the Value field, enter the taxpayer business activity description.
Note
The contact information for the legal entity is automatically retrieved from the related Person that is associated with the current user in Dynamics 365 Finance.
Configure customer data
Enter the address
To enter the address, follow these steps.
- Go to Accounts receivable > Customers > All customers.
- Select a customer.
- On the Addresses FastTab, add a valid address for the selected customer.
Enter the contact person
To enter the contact person, follow these steps.
Go to Accounts receivable > Customers > All customers.
Select a customer.
On the Sales demographics FastTab, in the Primary contact field, select the person who is considered the buyer's contact.
Note
All available contact persons must already be defined for the selected customer. Make sure that the selected contact person has a valid email address and phone number.
Enter the registration numbers
To enter the registration numbers, follow these steps.
Go to Accounts receivable > Customers > All customers.
Select a customer, and then, on the Invoice and delivery FastTab, in the Tax exempt number field, enter a valid TIN for the customer.
On the Action Pane, on the Customer tab, in the Registration group, select Registration IDs.
On the Registration ID FastTab, select Add to create a registration ID.
In the Registration type field, select the BRN registration type that you created earlier.
In the Registration number field, enter a valid BRN registration number for the selected customer.
Select Add to create another registration ID, if required.
In the Registration type field, select the SST registration type that you created earlier.
In the Registration number field, enter a valid SST registration number for the selected customer.
Note
For foreign customers, actual tax registration numbers aren't always mandatory. If no tax registration numbers are defined for them, the following general numbers are used:
- EI00000000020 is used as the customer's TIN.
- NA is used as the customer's BRN and SST.
Additional property configuration
Customizable electronic document property types can be used to extend the properties of legal entities, customers, vendors, and invoice journals. Users can configure them to cover some specific scenarios through configuration only. No coding is required.
To configure additional buyer and journal properties, follow these additional configuration steps.
Go to Accounts receivable > Setup > Electronic document property types.
Select New to create an electronic document property type.
In the Type field, enter BuyerRegistrationName. You must enter the value exactly as it appears here.
On the Action Pane, select Applicability.
In the Table name field, select CustInvoiceJour.
To create the record for another applicable table, select New.
In the Table name field, select CustTable as required.
Save your changes, and close the Electronic document property type applicability setup page.
Repeat steps 2 through 8 for the remaining properties:
- BuyerTIN
- BuyerBRN
- BuyerAddressLine
- BuyerCityName
- BuyerCountrySubentityCode
- BuyerIdentificationCode
- BuyerTelephone
- BuyerSST
- BuyerTTX
- BuyerNRIC
- BuyerPASSPORT
- BuyerARMY
Save your changes, and close the Electronic document property types page.
To enter the values for the previously described electronic document properties at the customer level, follow these steps.
- Go to Accounts receivable > Customers > All customers.
- Select a customer, and then, on the Action Pane, on the Customer tab, select Electronic document properties.
- For each property that must be overridden in the electronic invoice, enter the required value in the Value field.
To enter the values for the electronic document properties at the invoice level, follow these steps.
- Go to Account receivable > Inquiries and reports > Invoices > Invoice journal.
- Select a required invoice, and then, on the Action Pane, on the Invoice tab, select Electronic document properties.
- For each property that must be overridden in the electronic invoice, enter the required value in the Value field.
Note
Non-blank values in the previously described electronic document properties override the corresponding default values that are automatically populated from either customer or invoice master data.
Values must be entered for the electronic document properties before electronic invoices are submitted to the authorities.
Configure funding sources
If business processes assume that project invoices are issued, follow these additional configuration steps.
Go to Project management and accounting > Projects > Project contracts.
Create a new project contract, or select an existing project contract.
On the Funding sources FastTab, create or select a funding source of the Customer type, and then select Details.
On the Funding source details page, on the Other FastTab, in the Contact section, in the Contact ID field, select a valid contact person.
Note
All available contact persons must already be defined for the selected customer. Make sure that the selected contact person has a valid email address and phone number.
Configure vendor data
If business processes assume that self invoices are issued, you must also configure required vendor data.
Enter the address
To enter the address, follow these steps.
- Go to Accounts payable > Vendors > All vendors.
- Select a vendor.
- On the Addresses FastTab, add a valid address for the selected vendor.
Enter the contact person
To enter the contact person, follow these steps.
Go to Accounts payable > Vendors > All vendors.
Select a vendor.
On the Purchasing demographics FastTab, in the Primary contact field, select the person who is considered the buyer's contact.
Note
All available contact persons must already be defined for the selected vendor. Make sure that the selected contact person has a valid email address and phone number.
Enter the registration numbers
To enter the registration numbers, follow these steps.
Go to Accounts payable > Vendors > All vendors.
Select a vendor, and then, on the Invoice and delivery FastTab, in the Tax exempt number field, enter a valid TIN for the vendor.
On the Action Pane, on the Vendor tab, in the Registration group, select Registration IDs.
On the Registration ID FastTab, select Add to create a registration ID.
In the Registration type field, select the BRN registration type that you created earlier.
In the Registration number field, enter a valid BRN registration number for the selected vendor.
Select Add to create another registration ID, if required.
In the Registration type field, select the SST registration type that you created earlier.
In the Registration number field, enter a valid SST registration number for the selected vendor.
Note
For foreign vendors, actual tax registration numbers aren't always mandatory. If no tax registration numbers are defined for them, the following general numbers are used:
- EI00000000030 is used as the vendor's TIN.
- NA is used as the vendor's BRN and SST.
Enter a business activity code and description
To enter a business activity code and descriptions, follow these steps.
- Go to Accounts payable > Vendors > All vendors.
- Select a vendor, and then, on the Action Pane, on the Vendor tab, select Electronic document properties.
- Select the line where the Type field is set to ActivityCode.
- In the Value field, enter the business activity code.
- Select the line where the Type field is set to ActivityDescription.
- In the Value field, enter the business activity description.
Note
A Malaysian Standard Industrial Classification (MSIC) code might not be applicable to foreign vendors. In this case, the fixed value 00000 is used for the activity code, and the value NA is used as the activity description.
Configure the application-specific parameters
This setup is required to establish a mapping between sales tax codes that are used in the system and legally required tax types.
Make sure that the following ER format configurations are imported:
- Sales invoice (MY)
- Project invoice (MY)
- Self invoice (MY)
To complete the configuration, follow these steps.
In the Globalization Studio workspace, select the Electronic reporting tile, and then select the Reporting configurations tile.
On the Configurations page, select the Sales invoice (MY) format configuration.
On the Configurations menu, in the Application specific parameters section, selected Setup.
In the Lookups section, make sure that the $TaxTypes lookup is selected.
In the Conditions section, select Add to add a condition.
In the Name column for the new condition, select the sales tax code that's defined in the application. Then, in the Lookup result column, select a tax type code according to the official list of tax type codes.
Add specific conditions for each sales tax code that's defined in the system, and save your changes.
Note
In the Name column, you can select the *Blank* or *Not blank* placeholder value instead of a specific sales tax code.
In the State field, select Completed. Then select Save.
Repeat steps 2 through 8 for the Project invoice (MY) and Self invoice (MY) format configurations, as required.
Configure sales tax codes
To cover scenarios for non-taxable, zero-rated, or exempted operations, define tax exempt codes in the system by following these steps.
- Go to Tax > Setup > Sales tax > Sales tax exempt codes.
- Add the required exempt codes together with descriptions.
- Save your changes, and close the page.
- Go to Tax > Indirect taxes > Sales tax > Sales tax groups.
- In the Setup section, select the row for a required sales tax code, and then, in the Exempt column, mark the sales tax code as exempt.
- In the Exempt code field, reference one of the exempt codes that you created in step 1.
- Save your changes, and close the page.
Configure units of measure
To configure units of measure, follow these steps.
Go to Organization administration > Setup > Units > Units.
Select a unit ID, and then select External codes.
On the External codes page, in the Overview section, in the Code column, enter a code that is equal to the selected unit ID.
In the Standard code column, select the checkbox.
In the Value section, in the Value field, enter the external code to use as the units according to the required codification.
Note
For scenarios where no specific units of measure are assumed, the default value EA is used.
Issue electronic invoices
After you complete all the required configuration steps, you can generate and submit electronic invoices for posted invoices by going to Organization administration > Periodic > Electronic documents > Submit electronic documents. For more information about how to generate electronic invoices, see Submit electronic documents.
You can inquire about the results of a submission by going to Organization administration > Periodic > Electronic documents > Electronic document submission log and selecting the required document type. For more information, see Work with Electronic document submission log.
Configure printable invoice layouts
To enable QR code printing in full and simplified invoices, follow these steps.
- Go to Accounts receivable > Setup > Forms > Form setup.
- Select Print management.
- Select the Customer invoice report, and then, in the Report format field, reference the SalesInvoice.ReportFull_MY or SalesInvoice.ReportSimplified_MY layout.
- Select the Free text invoice report, and then, in the Report format field, reference the FreeTextInvoice.ReportFull_MY or FreeTextInvoice.ReportSimplified_MY layout.
If you use project invoices, follow these steps.
- Go to Project management and accounting > Setup > Forms > Form setup.
- Select Print management.
- Select the Project invoices without billing rules report, and then, in the Report format field, reference the PSAProjInvoice.ReportFull_MY or PSAProjInvoice.ReportSimplified_MY layout.
- Select the Project invoices with billing rules report, and then, in the Report format field, reference the PSAContractLineInvoice.ReportFull_MY or PSAContractLineInvoice.ReportSimplified_MY layout.
If you use self invoices, follow these steps.
- Go to Accounts payable > Setup > Forms > Form setup.
- Select Print management.
- Select the Vendor invoice report, and then, in the Report format field, reference the VendInvoiceDocument.ReportMY layout.
Note
The QR code that's shown on the printouts of invoices represents the URL that takes you to the official portal of MyInvois system, where you can find the details of the related electronic invoice.
QR codes are printed only for invoices that were successfully submitted, validated, and accepted by the MyInvois system.
Batch submission of electronic invoices
In addition to submitting electronic invoices individually, as described in the previous sections, you can submit posted invoices in batches as consolidated electronic invoices.
By default, all invoices that originate from retail operations can be consolidated, but they can't be submitted individually. Nevertheless, you can force specific retail-related invoices to be submitted individually.
To activate batch submission of invoices, enable the Electronic document batch submission feature in Feature management. For more information, see Feature management overview.
Configure electronic document parameters
Before you begin to configure electronic document parameters for batch submission, import the Consolidated Invoice Model Mapping (MY) ER configuration from the repository. For more information, see Import Electronic reporting (ER) configurations from Dataverse.
To configure electronic document parameters for batch submission, follow these steps.
- Go to Organization administration > Setup > Electronic document parameters.
- On the Electronic document tab, on the Electronic reporting FastTab, add a record for the Customer Invoice journal table name.
- In the Batch submission column, select the checkbox.
- In the Document context column, select the Batch submission mapping name from the Customer invoice context model configuration.
- In the Electronic document model mapping column, select the Consolidated Invoice Model Mapping (MY) mapping name from the Consolidated Invoice Model Mapping (MY) configuration.
- On the Batch submission id FastTab, in the Number sequence field, select the number sequence that should be used to number the batches that are generated. The number sequence that you select must be continuous.
Configure the electronic invoicing feature
To configure the electronic invoicing feature, follow these steps.
Import the latest version of the Malaysian electronic invoicing (MY) Globalization feature (version 10 or later) as described in Import features from the repository.
Note
Make sure that the Consolidated invoice (MY) ER format configuration is imported after you import the Malaysian electronic invoicing (MY) Globalization feature. If it isn't imported, manually import it. This format configuration is based on the Invoices Communication Model configuration and also on the Consolidated Invoice Model Mapping (MY) configuration that you imported in the previous section.
Create a copy of the imported Globalization feature, and select your configuration provider for it. For more information, see Create Globalization features.
On the Versions tab, verify that the Draft version is selected.
On the Setups tab, in the grid, select the Consolidated invoice derived feature setup, select Edit, and configure the following processing pipeline action parameters.
Note
Configure these parameters just as you configured them for the Sales invoice derived feature setup.
Processing pipeline action Parameters to configure Sign document for Malaysia - Certificate name
Integrate with MyInvois (Submit document) - Client secret
- Client ID
- Web service URL
- Login service URL
- Environment type
Integrate with MyInvois (Get document) - Client secret
- Client ID
- Web service URL
- Login service URL
- Environment type
Select Save, and close the page.
Complete and deploy the feature as described in Complete and deploy a Globalization feature.
Issue consolidated electronic invoices
To generate and submit electronic invoices in batches for posted Customer invoices, follow these steps.
Go to Organization administration > Periodic > Electronic documents > Submit electronic documents.
To submit invoices in batches, set the Submit document batch option to Yes. To submit retail invoices individually, set the Submit retail invoices individually option to Yes.
Important
Batch submission and individual submission are mutually exclusive and can't be run simultaneously. During a given run, only batch submissions or individual submissions can be processed.
If you must submit some retail invoices individually, you must do the individual submission before the batch submission. All individually submitted retail invoices will be excluded from batches.
On the Records to include FastTab, select Filter to open the Inquiry dialog box, where you can build a query to select only required documents.
Select OK to start submission.
To inquire about the submission results, follow these steps.
- Go to Organization administration > Periodic > Electronic documents > Electronic document submission log.
- In the Document type field, select Batch submission.
- Select a specific batch that has one of the following statuses: Scheduled, Completed, or Failed.
- On the Action Pane, select Inquiries > Submission details to view the details of the submission execution logs.
- On the Action Pane, select Inquiries > Batch submission invoices to view the invoices that were submitted in the selected batch.
Note
Because of restrictions that the authorities impose on the size of submitted data, the maximum number of invoices that can be included in one batch is 60. If more than 60 invoices are being processed, multiple batches are automatically generated.