The Debit/Credit field for XML invoices
Note that there is a separate topic for the debit/credit field in connection with paper or image-based invoices.
XML invoices may contain text that indicates whether it is an invoice or a credit note, such as "Invoice" or "Credit", to which the field can be mapped, but more often, for example, the value 380 is used to indicate an invoice and any other value determines that the invoice is a credit note.
Learning the Debit/Credit field for XML invoices in Optimize
To specify if an XML invoice is a debit invoice or a credit note:
-
Map
the
Invoice credit field to the correct XML element/attribute
using standard rules. See image.
- Translate the value found to one Kofax ReadSoft Invoices understands using an advanced rule such as this one. See additional examples below.
Note that different XML standards may require different rules to extract the correct value. From Kofax ReadSoft Invoices' perspective, it suffices to say that if the resulting value is 1, the XML invoice is interpreted to be a credit invoice, and if it turns out to be anything else, the invoice is interpreted to be a debit invoice. Use the example in step two above and the additional examples below for inspiration when new XML invoice profiles are created or the existing ones need to be adjusted.
Once the field has been mapped and the values are found and interpreted correctly, the status of the field is automatically set to Completewhen XML invoices are processed.
Additional examples for mapping the Debit/Credit field in different XML standards:
e2b standard
- First map the field to the XML element found at /InvoiceType using standard rules.
-
Then create an advanced rule with these conditions:
No condition: Matches both true and false
Value (Node[/InvoiceType]) =="380"
- Select the second condition in step 2, and add these rules:
- First map the field to the XML element found at /InvoiceDetails/InvoiceTypeCode using standard rules.
-
Then create an advanced rule with these conditions:
No condition: Matches both true and false Value(Node[/InvoiceDetails/InvoiceTypeCode]) =="INV01" AND Value(Node[/InvoiceDetails/invoiceTotalVatIncludedAmount]) >"0"
-
Select the second condition in step 2, and add these rules:
if((Value(Node[/InvoiceDetails/InvoiceTypeCode]) =="INV01" AND Value(Node[/InvoiceDetails/invoiceTotalVatIncludedAmount]) >"0" ==true) { Field.FieldValue = "0"; return; } if((Value(Node[/InvoiceDetails/InvoiceTypeCode]) =="INV01" AND Value(Node[/InvoiceDetails/invoiceTotalVatIncludedAmount]) >"0" ==false) { Field.FieldValue ="1"; return; }
if((Value(Node[/InvoiceType]) =="380") == true
{
Field.FieldValue = "0";
return;
}
if((Value(Node[/InvoiceType]) =="380") == false)
{
Field.FieldValue ="1";
return;
}
Finvoice standard
For Finvoice, you also need to check if the value is greater than 0: