Using earn codes in Payroll Export XML

Traditionally, Payroll Export XML logic includes complex match_output sections to translate combinations of time codes, hour types, calculation groups, and projects into a single earn code. Earn code configuration centralizes this logic in WFM admin portal and simplifies the Payroll Export XML.

Traditional Payroll Export XML - without earn code configuration

Without earn code configuration, the XML must explicitly match the attributes that define an earn code. For example:

<match_output>
    <match field="tcode_name" value="SATURDAY_FLX"/>
    <match field="htype_name" value="SUP"/>
    <match field="calcgrp_name">
        <value>EXEMPT</value>
        <value>NON EXEMPT</value>
        <value>PF NON EXEMPT</value>
    </match>
    <match field="proj_name">
        <value>3111</value>
        <value>3112</value>
        <value>3113</value>
    </match>
    <output_row>
        <map field="earn_code" value="113"/>
        <map field="hours" from_field="wrkd_minutes"/>
    </output_row>
</match_output>

Each business rule must be modeled explicitly in the XML, which increases complexity and maintenance costs.

Sample PET XML data element list

A new field, ecode_name, is introduced as part of the updated earn code configuration. This field must be defined in the data section, above the match output, so it can be referenced by downstream mappings and XMLs.

<data>
	<field name='paygrp_name'/>
	<field name='wrkd_work_date'/>
	<field name='emp_name'/>
	<field name='wrkd_start_time'/>
    <field name='wrkd_end_time'/>
	<field name='wrkd_minutes'/>
	<field name='tcode_name'/>
	<field name='htype_name'/>
    <field name='ecode_name'/>
	<field name='wrkd_rate'/>
	<field name='wrks_authorized'/>
	<field name='retro'/>
	<dummy_field name='earn_code'/>
</data>

Simplified Payroll Export XML - with earn code configuration

When you define the same rules in the Earn Code Mapping configuration, the XML no longer needs to express the details of the mapping. Instead, you match on the earn code that has already been calculated by the system.

The earn code mapping configuration handles the logic of which rows receive the specific earn code. The Payroll Export XML only needs to reference the resulting ecode_name field.

In some cases, if every combination that should be exported has an earn code, you can remove all match logic for time code and hour type and rely entirely on the core earn code field in the format section, such as:

<!-- EARN_CODE -->
<header>
<constant>ecode_name</constant><constant>,</constant>
<new_line/>
</header>
<body>
<string field='ecode_name'/><constant>,</constant>
<new_line/>
</body>

This approach reduces the number of match_output blocks in the Payroll Export XML, moves mapping maintenance from XML to WFM admin portal, and makes configuration more accessible to system administrators who do not edit XML.

For backward compatibility, existing configurations that use the traditional earn code identifiers continue to be supported. For new implementations and future configurations, Infor recommends using ecode_name.