Dear Jose
We understand that your question is related to the Spanish I.R.P.F., which is shown as a negative number on invoices because it is a withholding tax. An invoice could like this example:
Professional services: €100.00
IVA (VAT), 21%: €21.00
Tax total: €121.00
IRPF (withholding tax), -15%: -€18.15
Payable amount: €102.85
In UBL, the withholding tax has its own structure within the invoice, directly after the tax total, and is also available in UBL 2.1: https://docs.oasis-open.org/ubl/os-UBL-2.1/mod/summary/reports/UBL-Invoice-2.1.html#t-Invoice-53.
The above example could look like this:
<cac:WithholdingTaxTotal>
<cbc:TaxAmount currencyID="EUR">18.15</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">121.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">18.15</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>15</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>IRPF</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:WithholdingTaxTotal>
Hope this helps.
Best regards,
Kenneth Bengtsson