Automatically reverse signs for outbound UBL credit notes
The seeded UBL XSL transformations automatically identify credit memo transactions and apply credit note-specific sign-reversal logic to applicable monetary and quantity fields. Now, there's no need for manual XSL updates. Outbound credit note documents represent invoice reversals consistently for supported UBL message formats.
The following predefined message definitions have been updated as part of this feature:
- UBL-2.1-PEPPOL-Invoice-Out-V2
- UBL-2-1-AP-Invoice-Extract-Out
You can now:
- Reduce customer maintenance by removing the Accounts Receivables requirement to manually enable credit note processing in the XSL.
- Apply credit memo sign handling consistently to the supported monetary and line-level elements.
- Preserve the intended sign relationship for applicable credit memo monetary and quantity values rather than forcing all values to be positive.
- Reduce the risk of carrying credit memo amounts into the generated UBL credit note without the sign handling required by the applicable transformation.
- Help align outbound credit note output with UBL/PEPPOL reporting semantics and reduce the risk of validation errors.
Steps to enable and configure
Field mapping details for UBL-2-1-AP-Invoice-Extract-Out
Credit memo condition: apr:InvoiceTypeLookupCode = 'CREDIT'. Standard invoices use STANDARD.
This table outlines how data from the Accounts Payables source payload is mapped to the UBL credit note output for the predefined message definition UBL-2-1-AP-Invoice-Extract-Out, including the applicable credit memo sign-handling rules.
| Source | Target | Logic applied |
|---|---|---|
| apr:TotalTaxAmount (EUR) or apr:TotalTaxAmountExpressed (other currencies) | cac:TaxTotal/cbc:TaxAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalExtensionLineAmount | cac:LegalMonetaryTotal/cbc:LineExtensionAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalAllowanceAmount | cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalChargeAmount | cac:LegalMonetaryTotal/cbc:ChargeTotalAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalTaxExclusiveAmount | cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalTaxInclusiveAmount | cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalPrepaidAmount | cac:LegalMonetaryTotal/cbc:PrepaidAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalRoundedAmount | cac:LegalMonetaryTotal/cbc:PayableRoundingAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:TotalPayableRoundingAmount | cac:LegalMonetaryTotal/cbc:PayableAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| apr:QuantityInvoiced | cac:CreditNoteLine/cbc:CreditedQuantity | For credit notes, negate the quantity only when UnitPrice is greater than 0; otherwise retain the source quantity. |
| apr:Amount | cac:CreditNoteLine/cbc:LineExtensionAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
Field mapping details for UBL-2.1-PEPPOL-Invoice-Out-v2
Credit memo condition: tns:DocumentType = 'CM'. This condition automatically creates a UBL Credit Note; the passCreditNote variable is not required.
This table outlines how data from the Accounts Receivables source payload is mapped to the UBL credit note output for the predefined message definition UBL-2.1-PEPPOL-Invoice-Out-V2, including the applicable credit memo sign-handling rules.
| Source | Target | Logic applied |
|---|---|---|
| tns:TotalTaxAmount | cac:TaxTotal/cbc:TaxAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:TransferDocHeaderCharge/tns:ChargeAmount plus exempt taxable amount | cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount (generated charge-exempt subtotal) | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:TransferDocHeaderTax/tns:TaxableAmount | cac:TaxTotal/cac:TaxSubtotal/cbc:TaxableAmount (tax-rate subtotal) | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:TransferDocHeaderTax/tns:TaxAmount | cac:TaxTotal/cac:TaxSubtotal/cbc:TaxAmount (tax-rate subtotal) | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:LineExtensionAmount | cac:LegalMonetaryTotal/cbc:LineExtensionAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:TaxExclusiveAmount | cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:InvoiceAmount | cac:LegalMonetaryTotal/cbc:TaxInclusiveAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| Calculated total of tns:TransferDocPaymentTerm/tns:DiscountAmount | cac:LegalMonetaryTotal/cbc:AllowanceTotalAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| Calculated total of header charges, or line charges when no header charge exists | cac:LegalMonetaryTotal/cbc:ChargeTotalAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:PrepaymentAmount | cac:LegalMonetaryTotal/cbc:PrepaidAmount | Emit only when invoice country is France; then apply multiplier -1 for a credit memo. |
| France: tns:OrderRoundingAmount; non-France: tns:InvoiceAmount | cac:LegalMonetaryTotal/cbc:PayableRoundingAmount | Apply multiplier -1 to the selected source value. The non-France branch uses InvoiceAmount rather than OrderRoundingAmount. |
| tns:InvoiceAmount | cac:LegalMonetaryTotal/cbc:PayableAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:Quantity and tns:UnitSellingPrice | cac:CreditNoteLine/cbc:CreditedQuantity |
Uses the absolute quantity with the sign determined by UnitSellingPrice × Quantity. If the product is zero, applies the credit-memo sign-reversal multiplier. |
| tns:LineAmount | cac:CreditNoteLine/cbc:LineExtensionAmount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:TransferDocLineCharge/tns:ChargeAmount | cac:CreditNoteLine/cac:AllowanceCharge/cbc:Amount | Apply multiplier -1 for a credit memo; otherwise 1. |
| tns:UnitSellingPrice | cac:CreditNoteLine/cac:Price/cbc:PriceAmount |
Outputs the absolute value of UnitSellingPrice. |
Tips and considerations
- The transformation for Accounts Receivables now determines whether to create a credit note directly from the source DocumentType value. When DocumentType is CM, the transformation produces a UBL credit note. Customers no longer need to manually set the passCreditNote XSL variable.
- Credit memo output multiplies applicable monetary source values by -1 for fields that use the sign-reversal multiplier. Standard invoice output uses a multiplier of 1.
- In the Accounts Receivables transform, CreditedQuantity uses the absolute value of Quantity, with the sign determined by UnitSellingPrice × Quantity. If the product is zero, the XSL applies the credit memo sign-reversal multiplier.
- In the Accounts Receivables transform, PriceAmount uses the absolute value of UnitSellingPrice for both invoices and credit memos. It's not controlled by the credit memo sign-reversal multiplier.
- In the Accounts Receivables transform, PayableRoundingAmount uses OrderRoundingAmount for France and InvoiceAmount for non-France output.
- For Accounts Payables, the transformation automatically creates a UBL credit note when InvoiceTypeLookupCode = CREDIT. Standard invoices use InvoiceTypeLookupCode = STANDARD. No customer configuration is required.
- For Accounts Payables credit notes, applicable monetary totals and line extension amounts use the credit-memo sign-reversal multiplier of -1.
- For Accounts Payables CreditedQuantity, the XSL negates the quantity only when UnitPrice is greater than 0. Otherwise, it retains the source quantity.
- The Accounts Payables transformation outputs credit note type code 381 for a normal credit note, or 261 for ERS/self-billing output when Source = 'ERS' or GlobalAttribute1 is Y, Yes, or YES.
Access requirements
Users need all of the following privileges to access this feature. Privileges marked as new were introduced in this update.
| Privilege status | Privilege name and code |
|---|---|
| Previously delivered |
Manage B2B Trading Partners CMK_B2B_TRADING_PARTNERS_PRIV |
| Previously delivered |
Manage Service Provider CMK_MANAGE_SERVICE_PROVIDER_PRIV |
| Previously delivered |
Manage Collaboration Message Definitions by Web Service CMK_MANAGE_COLLAB_MESG_DEFINITION_WEB_SERVICE_PRIV |