Specifying validation rules

To specify field validation rules:

  1. Navigate to the Extraction service that corresponds to the account level you want to adjust.

    Note that you cannot adjust the validation rules on the buyer level.

  2. Click EDIT and click the document type that you want to edit. The document type view appears.
  3. On the Rules tab, enable the validations that you want to use by selecting the checkbox on the VERIFY and/or WORKFLOW column. These columns determine whether rules are performed during verification, an approval workflow or both.

    Validation rules cannot be overridden while in a workflow step. If you receive a validation error while processing a document in a workflow, you must correct the error to proceed.

  4. Adjust the settings of each enabled rule according to the descriptions later in this topic.
  5. Click OK to return to the previous view, and click SAVE to save your changes.

    After you save the settings, the changes are immediately available during verification and approval.

Available field validation rules

The validations in your system can vary, depending on your setup.

Bankgiro Performs a checksum validation of Swedish bankgiro account numbers.

The validation rule is available for Swedish document types.

Creditor reference

Performs length, identifier and checksum validations on the PaymentReferenceNumber field to ensure the validity of creditor reference numbers.

This validation is currently only available for Swiss document types and requires the PaymentReferenceNumber field.

Due date Validates the due date field.

This validation makes sure that the date:

  • occurs on or after today’s date.
  • does not occur too far in the future.
  • is a valid date. Note that English date formats are valid on all document types, including non-English document types.

Due-date limit (days) - Due dates are only valid if they do not exceed the current date plus the number of days you specify here.

Calculate due date from payment-terms master data - Uses payment terms master data to validate and optionally supply the due date.

Payment-terms master data is only utilized during extraction and when a document is opened during verification.

Duplicate invoice check Warns if invoices with the same supplier number, invoice number, invoice date or invoice amount exist during verification or workflow processes. This can prevent duplicate invoices caused by:
  • the supplier resending the same invoice by mistake or on purpose.
  • the same invoice being scanned more than once.
  • scanning software errors.
  • an error in ReadSoft Online.
  • original invoice attachments that are not recognized as an attachments and treated as separate invoices.

ReadSoft Online checks for duplicates:

  • After document extraction.

  • During verification.

  • During approval.

    • During document registration and post.

  • During export.

The supplier number must be specified in order for this validation to work.

If a duplicate invoice is detected during verification or approval, the validation error is set on all relevant fields. For example, if Include invoice date and Include invoice amount are selected, and a duplicate invoice is detected, then the validation error is set on the invoice number, invoice date and invoice amount fields.

All relevant fields necessary for the duplicate invoice check are required. For example, if Include invoice date and Include invoice amount are selected, then invoice number, invoice date and invoice amount are all required in the document type. If any field is missing, the duplicate check will not execute.

The supplier number and invoice number are always checked when performing this validation, however, Include invoice date and Include invoice amount checks are optional and can be toggled in the Duplicate invoice check setting. If Include invoice date and Include invoice amount are selected, the invoice number, invoice date and invoice amount must all be the same as a previously processed invoice in order to be considered a duplicate. If you select Include invoice amount, the total amount field is used. However, if the total amount field is missing from the document type, the net amount field is used.

If a user overrides this validation, it is noted in the document history.

This validation relies on data collection that is only gathered when this validation is enabled. Therefore, duplicate invoices are not validated against invoices that were processed prior to enabling this validation.

The duplicate invoice check is performed per buyer, so it is possible to have invoices with the same invoice number, for example, if they are for different buyers.

Duplicate-invoice information is saved for each invoice in a registry when:

  • The invoice is verified.

  • The invoice is changed in a workflow, for example, if you add a coding line or change a field value.

  • The invoice is sent to the target system.

Therefore, if you use Workflow services and bypass verification via the data verification settings, the validation might not detect duplicate invoices until post in some circumstances.

Storage services are no longer required to use the duplicate invoice check.
If you delete an invoice after it is sent to the target system, the duplicate check registry is not updated. However, if you delete the invoice from ReadSoft Online Storage, the invoice is removed from the duplicate check registry.
Goods received quantity

Ensures that invoiced quantities match the quantities of goods received (3-way matching) by performing two checks:

  • The quantity on the invoice must be equal to or less than the delivered quantity of the goods received on the purchase order:

    invoice quantity ≤ PO goods received quantity

  • The quantity on the invoice must be equal to or less than the delivered quantity of the goods received on the purchase order minus the invoiced quantity on purchase order:

    invoice quantity ≤ (PO goods received quantity - PO invoiced quantity)

Invoices that fail this validation are automatically put on hold.

Automatic retry (days) - specifies the number of days ReadSoft Online will continue to automatically check the goods received quantity before sending the invoice to the next step. Automatic retry is only triggered if you override this validation during verification or approval and approve the invoice. Checks will be made automatically and continuously until the document passes validation or until the number of days you specify here passes, whichever comes first. If you change this setting, the new value is applied to invoices that are already on

In order to use this validation, you must enable the Purchase order service.
In order to use this validation, your purchase-order data must include the DeliveredQuantity field in PurchaseOrderLine.

IBAN Performs a checksum validation (ISO 7064) to ensure IBAN numbers are valid.

If the document type contains multiple IBAN fields, all of the IBAN fields are validated.

Invoice date Validates the invoice date field.

This validation makes sure that the date.

  • occurs before or equal to today’s date.
  • does not occur too far in the past.
  • is a valid date.

Invoice-date limit (days) - Invoice dates are only valid if they are not older than the current date, minus the number of days you specify here.

Process limit (days) - Invoices are stopped, if the invoice date is older than the current date minus the number of days you specify here. Unlike Invoice-date limit, you cannot override this validation error by pressing Enter during verification. The value you specify here must be greater than Invoice-date limit, unless you specify 0 to disable this setting (default value: 0).

Line items cannot be empty Makes sure line items are specified on invoices. If no line items are found during extraction, or if all line items are missing or removed during verification or approval, the validation fails and a warning message is displayed. The validation error is set on the total amount field, and you cannot override this validation error. In other words, you cannot process the invoice further without line items.
Line-item row Ensures that the amounts add up to the row total when verifying line items. If no line-item rows are found on the invoice, this validation is not performed.

This validation handles amounts up to 5 decimal places.

The validation compares the product of the delivered quantity and unit price with the total on each line item row. The validation is performed using two methods in this order:

  1. The discount is applied to the total amount.

    LIT_VatExcludedAmount = (LIT_DeliveredQuantity * LIT_UnitPriceAmount) * (1 - LIT_DiscountPercentage) – | LIT_DiscountAmount|

  2. The discount is applied to the unit price.

    LIT_VatExcludedAmount = LIT_DeliveredQuantity * (LIT_UnitPriceAmount * (1 - LIT_DiscountPercentage) – |LIT_DiscountAmount|

Note that the absolute value of the discount amount is used. Fields in bold must be selected (enabled) in the Document type view in order for the validation to work properly.

The validation also uses two different margins of error when comparing the calculated value with the row total. An absolute tolerance of 1 and a relative tolerance (the row total times 0.01) is used.

Line-item total amount Ensures that the total amount of the invoice matches the total sum of all line-item rows when verifying line items.

The validation compares the sum of the amount fields and the total sum of all line-item rows with the total amount.

InvoiceTotalVATIncludedAmount = SumOfTotalNetAmountFromLineItems + InvoiceTotalVATAmount + DeliveryCost + DeliveryCostPackaging + DeliveryCostInsurance + DeliveryCostToll + DeliveryCostPostage - InvoiceDiscountAmount

Maximum total amount
  • Maximum total amount limit - Makes sure that the total amount field (InvoiceTotalVATIncludedAmount) does not exceed the value you specify here. If you do not use the total amount field, the net amount field (InvoiceTotalVATExcludedAmount) is checked instead.

If the total amount is greater than the value you specify here, the field is marked with a warning icon, but you can override the validation.

  • Process limit (amount) - This validation works like the Maximum total amount limit, however, you cannot override the validation. Therefore, if you receive an invoice that exceeds the process limit, you must increase the value of this setting to continue, or delete the invoice.
OCR number Performs a checksum validation for OCR numbers on Swedish invoices.

You can only enable this validation for Swedish document types.

Organization number Performs a checksum validation for organization numbers on Swedish invoices.

You can only enable this validation for Swedish document types.

Payment type Validates various payment fields, depending on the payment type. You can only use this validation for Danish, Norwegian and Swedish document types.

Default cash-account number - The default cash account to use when you specify Entry only as the payment type.

See also:

Plusgiro Validates Swedish plusgiro account numbers.

You can only enable this validation for Swedish document types.

PO number (deprecated) This setting has been replaced by the settings in the purchase order service.
Prevent total amount of zero Makes sure that the total amount field (InvoiceTotalVATIncludedAmount) does not equal zero. If you do not use the total amount field, the net amount field (InvoiceTotalVATExcludedAmount) is checked instead.
Purchase order quantity

Ensures that the invoiced quantities match the quantities on the purchase order (2-way matching) by performing two checks:

  • Quantities on the invoice must be equal to or less than the quantities on the purchase order.

    invoice quantity ≤ PO quantity

  • The quantity on the invoice must be equal to or less than the purchase order quantity minus the invoiced quantity on purchase order.

    invoice quantity ≤ (PO quantity - PO invoiced quantity)

Purchase order over-quantity tolerance (percent) - Determines how much the quantity on the invoice can exceed the purchase order quantity.

For example, assume you type 10 in this setting to allow a tolerance of 10%. You have a purchase order with a line-item quantity of 20 items. The matching invoice line, however, has a quantity of 22. Because 20 plus 10% is 22, the quantity is within the tolerance and passes validation. If the matching invoice line had a quantity of 23, it would exceed the 10% tolerance and fail validation.

In order to use this validation, you must enable the Purchase order service.

Purchase order unit price

Ensures that the invoiced unit prices match the unit prices on the purchase order (2-way matching).

The unit prices on the invoice must be equal to or less than the unit prices on the purchase order to pass this validation.

invoice unit price ≤ PO unit price

Purchase order over-price tolerance (percent) - Determines how much the price on the invoice can exceed the purchase order price.

For example, assume you type 10 in this setting to allow a tolerance of 10%. You have a purchase order with a line-item price of $20. The matching invoice line, however, has a price of $22. Because 20 plus 10% is 22, the price is within the tolerance and passes validation. If the matching invoice line had a price of $23, it would exceed the 10% tolerance and fail validation.

In order to use this validation, you must enable the Purchase order service.

Remittance advice line-item total amount

Ensures that the total amount matches the total sum of all line-item rows when verifying line items on remittance advices. In other words, InvoiceTotalVATIncludedAmount must equal the sum of all LI_InvoiceTotal fields. The totals can differ by +/- 0.5 to account for rounding.

Example: If the total amount is 200.00, the validation will pass if the sum of all line-item rows is between 199.50 and 200.50.

Example: If the total amount is 200.00, the validation will fail if the sum of all line-item rows is 0 or if no line-item rows are found.

This validation is only available for remittance advice document types.

Supplier tax code Applies default tax codes to header and line-item fields.
Swiss bank account Makes sure the account numbers are formatted correctly and that required field values are specified. The validation requires that all of the fields from at least one of these field groups are specified:
  • IBAN
  • ESR Ref, ESR No and ESR Amount
  • PC Account, BLZ, BICSwift and Bank account

This validation is only available for Swiss document types, and all of the fields above must have Accept empty value and Enforce validation selected in the field view.

Swiss QR reference

Checks the validity of QR references found in QR-IBAN numbers.

This validation is only available for Swiss document types and requires the QrReference field.

Total amount Ensures that the amount fields add up to the total amount field on the invoice. See how .

This validation handles amounts up to 5 decimal places and supports a margin of error that you specify in the Maximum difference allowed setting.

Net amount sum = InvoiceTotalVATExcludedAmount + DeliveryCost + DeliveryCostPackaging + DeliveryCostInsurance + DeliveryCostToll + DeliveryCostPostage - InvoiceDiscountAmount

Total amount sum = Net amount sum + InvoiceTotalVATAmount - WithholdingTaxAmount - WithholdingTaxAmount2

To pass the validation, the absolute value of Total amount sum minus InvoiceTotalVATIncludedAmount must be greater than Maximum difference allowed

ABS(Total amount sum - InvoiceTotalVATIncludedAmount) > MaximumDifferenceAllowed

Maximum difference allowed

Specifies the margin of error (plus or minus) that is permitted when comparing the total amount field with the calculated total amount.

Example: If you specify 0.5 here and the total amount on the invoice is 23.00, the validation will pass if the calculated total amount is anywhere between 22.50 and 23.50.

Total tax amount This validation ensures that the sum of all sub-tax-fields equals the value of the total tax field.

InvoiceTotalVatAmount = InvoiceTaxAmount1 + InvoiceTaxAmount2 + InvoiceTaxAmount3 + InvoiceTaxAmount4

At least one of these fields must be selected (enabled) in the Document type dialog in order for the validation to work properly:

  • InvoiceTaxAmount1
  • InvoiceTaxAmount2
  • InvoiceTaxAmount3
  • InvoiceTaxAmount4

Maximum difference allowed

Specifies the margin of error (plus or minus) that is permitted when comparing the total tax field with the sum of the other tax fields.

Example: If you specify 0.5 here and the total tax on the invoice is 23.00, the validation will pass if the sum of the other tax fields is anywhere between 22.50 and 23.50.

If you change any of the tax amounts, the total tax amount is automatically updated with the new sum.

VAT rate Ensures that the VAT rate is one of the rates specified in the Allowed VAT rates box. Use semicolons (;) to separate valid VAT rates. You can write the VAT rates using any standard method of writing a percentage. For example, if you want to allow rates of 0%, 12.5% and 25%, you can type the following values in the Allowed VAT rates box:

0.0;12.5;25.0

During verification, you cannot add rates that do not exist in the document type, but you can remove rates that you do not want validated.

This validation handles amounts up to 5 decimal places. The margin of error between the captured rate and the calculated rate cannot exceed 0.005.