Understanding Inbound E-Document Conversion

The Singapore PEPPOL-Ready e-Invoicing SuiteApp converts inbound XML e-documents into NetSuite transactions. During conversion, NetSuite identifies the vendor or customer, populates transaction fields, matches items, and assigns tax codes.

The following table shows the transaction created for each inbound document type:

Inbound Document

NetSuite Transaction

Supplier invoice

Vendor bill

Supplier credit note

Vendor credit

Customer purchase order

Sales order

The inbound e-document template determines how information from the XML document is used in the transaction. Some values are mapped directly from XML elements. Others, such as values that require record searches or additional processing, are supplied through a custom data source.

For more information, see Understanding E-Document Components and Records.

Conversion Prerequisites

Before importing inbound e-documents, ensure that item records contain the information required for conversion:

  • For a single vendor, the item name in the inbound e-document must match the Vendor Code/Name value on the item record.

  • If the Multivendor feature is enabled, the item name must match the applicable vendor code on the Vendors subtab.

  • For inventory items, a Location must be selected on the item record.

For more information, see Importing Inbound E-Documents and Converting them to Transactions.

Conversion Flow

Inbound document processing follows this general flow:

Import XML → Identify the vendor or customer → Populate transaction fields → Process lines and tax codes → Apply supported discounts to sales orders → Complete conversion.

The SuiteApp retrieves inbound XML e-documents from the Singapore PEPPOL API. By default, it retrieves only documents that have not already been imported. NetSuite creates an inbound e-document record and processes the document using the applicable template and conversion rules.

You can track processing on the Map/Reduce Script Status page. When DataPost is the selected access point, the import script is SG PEPPOL DataPost Import Inbound MR. The conversion script is Convert Inbound E-Document MR. Review the individual inbound e-document record to check its conversion outcome.

For import instructions and script deployment requirements, see Importing Inbound E-Documents and Converting them to Transactions.

Understanding XML Paths

The tables identify the XML elements used during conversion. Each table specifies the starting element for its paths.

Element names can repeat in different parts of an XML document. For example, cbc:ID can identify a document, a line, or a tax category. The full path identifies which value is used.

The prefixes cbc and cac identify XML namespaces used by the document.

Invoice and Credit Note Conversion

NetSuite converts an inbound supplier invoice into a vendor bill and an inbound supplier credit note into a vendor credit. The following sections describe the conversion sequence.

Identify the Vendor

NetSuite identifies the vendor by matching the sender's PEPPOL ID to the PEPPOL ID on an existing vendor record.

If no vendor matches, the inbound e-document record is marked Incomplete. Verify or correct the PEPPOL ID on the vendor record, select the vendor on the inbound e-document record, and save it before converting again.

For more information, see Handling Inbound E-Documents without Matching Customers or Vendors.

Populate the Transaction Details

NetSuite reads the document header to populate the vendor bill or vendor credit.

The following table identifies the header elements. Paths begin at Invoice or CreditNote.

Transaction Field

Invoice XML Element

Credit Note XML Element

Transaction reference number

Invoice/cbc:ID

CreditNote/cbc:ID

Transaction date

Invoice/cbc:IssueDate

CreditNote/cbc:IssueDate

Due date

Invoice/cbc:DueDate

CreditNote/cbc:DueDate

Memo

Invoice/cbc:Note

CreditNote/cbc:Note

Currency

Invoice/cbc:DocumentCurrencyCode

CreditNote/cbc:DocumentCurrencyCode

Process Document Lines

For each document line, NetSuite uses the XML item name as the vendor code or vendor name value to identify an existing item record. Matching depends on whether the Multivendor feature is enabled and how vendor information is configured on the item record.

The following table identifies the line elements. Invoice paths are relative to Invoice/cac:InvoiceLine. Credit note paths are relative to CreditNote/cac:CreditNoteLine.

Line Value

Invoice XML Element

Credit Note XML Element

Item name used for vendor code or name matching

cac:Item/cbc:Name

cac:Item/cbc:Name

Quantity

cbc:InvoicedQuantity

cbc:CreditedQuantity

Rate

cac:Price/cbc:PriceAmount

cac:Price/cbc:PriceAmount

Amount

cbc:LineExtensionAmount

cbc:LineExtensionAmount

Description

cac:Item/cbc:Description

cac:Item/cbc:Description

Tax category ID

cac:Item/cac:ClassifiedTaxCategory/cbc:ID

cac:Item/cac:ClassifiedTaxCategory/cbc:ID

Select Tax Codes for Item Lines

For each item line, NetSuite uses the XML tax category ID to find an active Singapore tax code that meets both conditions:

  • The SG PEPPOL Tax Code value on the Tax Code record exactly matches the XML tax category ID.

  • The Available On field is set to Purchase Transactions or Both on the Tax Code record.

NetSuite assigns the matching tax code to the vendor bill or vendor credit item line. It uses the XML tax category ID, rather than the XML tax percentage, to select the tax code.

Handle Unmatched Invoice Items

If an invoice item does not match an existing NetSuite item that supports purchase transactions, NetSuite can create an expense line using the vendor's Default Expense Account.

This expense line can use default tax settings instead of the tax-code mapping used for item lines. Its tax treatment can therefore differ from that of a matched item line.

Purchase Order Conversion

NetSuite converts a PEPPOL purchase order received from a customer into a sales order. The following sections describe the conversion sequence.

Identify the Customer

NetSuite identifies the customer by matching the buyer's PEPPOL ID to the PEPPOL ID on an existing customer record.

If no customer matches, the inbound e-document record is marked Incomplete. Verify or correct the PEPPOL ID on the customer record, select the customer on the inbound e-document record, and save it before converting again.

For more information, see Handling Inbound E-Documents without Matching Customers or Vendors.

Populate the Sales Order Header

NetSuite reads information from the purchase order to populate the sales order header. Some values are mapped directly from the XML. Others are supplied through conversion logic.

The following table identifies the header sources and conditions. XML paths are relative to Order.

Transaction Field

XML Source or Generated Value

Condition

Customer PO / Other Ref No.

cbc:ID

Mapped from the purchase order reference.

Memo

cbc:Note

Mapped from the document note.

Currency

cbc:DocumentCurrencyCode

Multi-Currency is enabled.

Message

OrderDocumentReference received via PEPPOL on <date and time>

Generated by NetSuite.

Sales Rep

cac:SellerSupplierParty/cac:Party/cac:Contact/cbc:ElectronicMail

The email address matches an employee designated as a sales representative.

Ship Date

cac:Delivery/cac:RequestedDeliveryPeriod/cbc:StartDate

The value is supplied.

Populate the Shipping Address

When delivery address values are supplied, NetSuite uses them to populate the shipping address.

The following table identifies the address elements. Paths are relative to Order/cac:Delivery/cac:DeliveryLocation/cac:Address.

Address Component

XML Element

Country

cac:Country/cbc:IdentificationCode

Address line 1

cbc:StreetName

Address line 2

cbc:AdditionalStreetName

Address line 3

cac:AddressLine/cbc:Line

City

cbc:CityName

State

cbc:CountrySubentity

Postal code

cbc:PostalZone

Process Order Lines

For each purchase order line, NetSuite reads the item information and transaction values. The XML item name must match a valid NetSuite item record. NetSuite uses the matching record to create a sales order item line. If no item matches, conversion fails.

The following table identifies the line elements. Paths are relative to Order/cac:OrderLine/cac:LineItem.

Line Value

XML Element

Item name

cac:Item/cbc:Name

Quantity

cbc:Quantity

Rate

cac:Price/cbc:PriceAmount

Amount

cbc:LineExtensionAmount

Description

cac:Item/cbc:Description

Tax category ID

cac:Item/cac:ClassifiedTaxCategory/cbc:ID

Select Tax Codes for Item Lines

For each item line, NetSuite uses the XML tax category ID to find an active Singapore tax code that meets both conditions:

  • The SG PEPPOL Tax Code value on the Tax Code record exactly matches the XML tax category ID.

  • The Available On field is set to Purchase Transactions or Both on the Tax Code record.

NetSuite assigns the matching tax code to the sales order item line. It uses the XML tax category ID, rather than the XML tax percentage, to select the tax code.

Apply Order Level Discounts

NetSuite reads order-level allowances from Order/cac:AllowanceCharge. An entry is treated as a discount only when its cbc:ChargeIndicator value is false.

The following table shows how NetSuite determines the discount. Paths are relative to Order/cac:AllowanceCharge.

Condition

Discount Applied

cbc:MultiplierFactorNumeric is present

Percentage discount using that value

cbc:MultiplierFactorNumeric is absent

Fixed-amount discount using cbc:Amount

NetSuite applies the discount using the item named Partner Discount.

For the example mappings, see Singapore PEPPOL Inbound Sales Order Template.

Complete Sales Order Conversion

Conversion succeeds when the customer, items, tax codes, and delivery data are valid.

Reviewing Conversion Outcomes

If conversion fails, review the Details column on the E-Document Audit Trail subtab of the Inbound E-Document record. Correct the related Inbound E-Document record or XML values and retry conversion.

For status descriptions, see Inbound E-Document Statuses.

General Notices