Aller au contenu principal

Document Templates

Document Templates

Document templates define how a specific type of JDE document (e.g. a customer invoice, a pro-forma) is processed. Unlike the three reserved system templates (global, e-invoicing, e-directory), document templates can be freely created and deleted.

Template storage

Document templates are stored in the -documents sibling config file (e.g. config-documents.properties). If this file does not exist, templates fall back to the main config file.

Each template is identified by a unique name (e.g. vrc_pro, isc_facture). The name is passed as the <tpl> argument to the -run CLI command.

Key properties

PropertyDescriptionExample
transformPath to the XSLT stylesheet that transforms JDE XML → UBL 2.1 XML%APP_HOME%/xsl/vrc_pro.xsl
rtfTemplatePath to the RTF template for PDF generation%APP_HOME%/templates/vrc_pro.rtf
burstKeyXPath expression to split a multi-document XML file into individual invoices/Batch/Invoice
dirInputOverride for the input directory (falls back to global.dirInput)%PROCESS_HOME%/vrc/input
dirOutputOverride for the output directory%PROCESS_HOME%/vrc/output
sendToPAY / N — override the e-invoicing setting for this templateY
devModeY to enable extra XSLT debug output for this templateN
devXSLAlternate XSLT stylesheet for development/testing
attachmentPath pattern for PDF attachments to include with the UBL submission

Creating a document template

Step 1 — Add the template entry to config-documents.properties:

{
"resources": [
{
"name": "my_invoice",
"type": "document",
"properties": {
"transform": "%APP_HOME%/xsl/my_invoice.xsl",
"rtfTemplate": "%APP_HOME%/templates/my_invoice.rtf",
"burstKey": "/Batch/Invoice",
"dirInput": "%PROCESS_HOME%/my_invoice/input",
"dirOutput": "%PROCESS_HOME%/my_invoice/output",
"sendToPA": "Y"
}
}
]
}

Step 2 — Create the XSLT stylesheet that maps JDE XML fields to UBL 2.1 elements. The stylesheet must output a valid Invoice document conforming to UBL 2.1 (urn:oasis:names:specification:ubl:schema:xsd:Invoice-2).

Step 3 — Test with UBL_VALIDATE mode before going live:

java -jar nomaubl.jar -run config.properties my_invoice test.xml UBL_VALIDATE 1001

This validates the generated UBL without sending it to the PA.

Template name conventions

It is recommended to use lowercase names with underscores, reflecting the JDE UBE report or document type:

vrc_pro → VRC customer invoice (pro-forma)
isc_facture → ISC supplier invoice
poa_credit → Purchase order credit note

Processing type per template

The -run command accepts a processing type that determines what the template produces:

Processing TypePDFUBLSent to PA
SINGLEYesNoNo
BURSTYes (multi)NoNo
UBLNoYesYes (if configured)
BOTHYesYesYes (if configured)
UBL_VALIDATENoYesNo

See Processing Types for full details.