Sales Order

The following sample of the sales order e-document template and Custom Data Source plug-in implementation should be used with the sales order template. You must use the below template mapping and plug-in to successfully convert the PEPPOL XML file to a sales order transaction.

  1. Inbound Sales Order Template

    File Name: Sales_Order_Peppol_Template_Generic.txt

    Location: Bundle 436209/Sample Templates

  2. Custom Data Source Plug-in (Sales Order)

    File Name: pl_custom_data_source_sales_order_inbound.js

    Location: Bundle 436209/src/comp/pl

    Plug-in Implementation name: Sales Order Inbound CDS

Note:

The following points are applicable to use the sales order template:

  1. 1. You can paste the content from the Sales_Order_Peppol_Template_Generic.txt file in the Field Mapping for Inbound E-Document field of the new E-Document Template Creation page.

  2. Select the transaction type as sales order. In the template, in create mode, select Sales Order Inbound CDS from the Inbound Custom Data Source Plug-in Implementation list.

Limitations of Sample Template and Plug-in

Follow the below table for mapping details:

S.NO

JSON Key in Template

XML Element Applied from XML Reference

Information for the Key

1

otherrefnum

D:Order/cbc:ID

Displays the PO# field value in the sales order.

2

currency

D:Order/cbc:DocumentCurrencyCode

Displays the currency name (International Organization for Standarization – ISO Code) in the purchase order. The value of this field is derived from the Custom Data Source plug-in (CDS) used in the template.

The Custom Data Source plug-in retrieves the currency name from the currency ISO code present in the XML reference. Multi-Currency feature must be enabled in the account.

3

message

 

Displays the following custom message on the sales order:

OrderDocumentReference received via PEPPOL on {DATE_TIME}.

4

salesrep

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

Displays the sales representative (employee). The value of this field is derived from the Custom Data Source plug-in (CDS) used in the template.

The Custom Data Source retrieves the employee id from the email present in the XML reference.

5

shipdate

D:Order/cac:Delivery/cac:RequestedDeliveryPeriod/cbc:StartDate

Displays the ship date. The value of this field is derived from the Custom Data Source plug-in (CDS) used in the template.

Valid format is YYYY-MM-DD.

6

shipaddress

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address

Consists of all the keys with ship address data.

7

country

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cac:Country/cbc:IdentificationCode

Displays the country in the ship address.

Valid format is the ISO code of country.

8

addr1

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:StreetName

Displays the address 1 in the ship address.

9

addr2

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:AdditionalStreetName

Displays the address 2 in the ship address.

10

addr3

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cac:AddressLine/cbc:Line

Displays the address 3 in the ship address.

11

city

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:CityName

Displays the city in the ship address.

12

state

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:CountrySubentity

Displays the state in the ship address.

13

zip

D:Order/cac:Delivery/cac:DeliveryLocation/cac:Address/cbc:PostalZone

Displays the zip in the ship address.

14

item

D:Order/cac:OrderLine

Contains details of all line items in the XML reference.

15

item

D:Order/cac:OrderLine/cac:LineItem/cac:Item/cbc:Name

Displays the item name or display name of the item.

16

quantity

D:Order/cac:OrderLine/cac:LineItem/cbc:Quantity

Displays the quantity of each line item.

The element value with a decimal separator (.) or a whole number is valid. Group separator (Thousands separator) or more than one decimal separator is invalid.

17

rate

D:Order/cac:OrderLine/cac:LineItem/cac:Price/cbc:PriceAmount

Displays the net price or unit price of the item. It displays the rate of each line item, exclusive of tax.

Group separator (Thousands separator) or more than one decimal separator is invalid.

18

amount

D:Order/cac:OrderLine/cac:LineItem/cbc:LineExtensionAmount

Displays the sales order line net amount.

The amount is net without tax, that is, including line level allowances.

19

description

D:Order/cac:OrderLine/cac:LineItem/cac:Item/cbc:Description

Displays the description of the item.

20

taxcode

D:Order/cac:OrderLine/cac:LineItem/cac:Item/cac:ClassifiedTaxCategory/cbc:Percent

(We are fetching the tax percent and from that we are finding the corresponding tax code in the account)

Provides tax codes that are extracted from the tax rate in the XML reference. The tax code which belongs to the specific tax rate for the applicable country.

In OneWorld accounts, this key will retrieve the subsidiary country information. In accounts without OneWorld, this key will retrieve information about the country from the Company Information page.

Below are the possible error scenarios for the Sales Order Inbound CDS plug-in:

  • The following conditions can stop the conversion of inbound e-document to sales order transaction, and throw an error:

    • If the account has more than one tax code applicable for Sale or Both tax type present for a tax rate in the account.

    • If no tax code is present for a tax rate.

    • If the tax code applicable is inactive.

    • If more than one applicable tax code is present for a tax rate.

    These conditions can fail the inbound conversion and throw the following error:

    An appropriate tax code was not found for one of the following reasons:

    • No such tax code exists.

    • Multiple tax codes with the same tax rate.

    • Tax code is not of Sale type or Both type.

    • Tax code is inactive.

    Rectify the tax codes and make the combination of tax code to tax rate unique for the applicable country.

  • If you try to use this template along with CDS in SuiteTax enabled accounts, then the conversion will fail, and you will get the below error:

    Inbound conversion to Sales Order is not supported for SuiteTax accounts.

General Notices