ODBC-compatible databases
FCFORINVOICES allows you to connect a data set to an ODBC-compatible database (See Using vendor and business unit databases), to load data once, or to update a data set with data from an external database at regular intervals (See Updating data sets). Therefore, your first step should be deploying external data in an ODBC-compatible database, such as Microsoft Access, Microsoft SQL Server or Oracle.Eliminating duplicate records in the external database
It is important to determine the field in the external vendor (or business unit) database whose value must be obtained as result of detecting the vendor (or business unit) on an invoice. This field (or set of fields) should become the unique key of the data set. The unique key of a business unit data set is the Id field (see BusinessUnits data set). From the user’s point of view, this field is the result of FCFORINVOICES detecting the business unit to which the given invoice was issued. The unique key of a vendor data set should be the value passed to the external information system as a result of FCFORINVOICES detecting the vendor that issued the given invoice. If one vendor table is used, the unique key must be associated with the Id field of the data set. This value will be passed to the external information system when the vendor is detected in the invoice. If you are planning to process within one project invoices issued to different business units of your company, each of which has its own vendor database, you should associate the unique key of each business unit with the BusinessUnitId column of the Vendors data set, and the key of each vendor with the Id column of the Vendors data set. Therefore, the unique key of the vendor record to be passed to the external information system when the vendor is detected will be the pair of Id and BusinessUnitId values (see Vendors data set). In the explanations that follow, we will consider only vendor detection, as the situation is completely identical in the case of business units. The unique key of a record must determine the unique combination of parameters which are used for vendor detection. Very often, an external information system will consider a vendor record to be unique relying on more parameters than are specified in the invoice and/or are used for vendor detection. For example, an external information system may expect to receive an MCN_USD identifier if the vendor My Company Name Ltd. issues an invoice in US dollars, or it may expect an MCN_EUR identifier if the same company issued an invoice in euros. Even though the currency is stated in the invoice (and the occasion when the MCN_USD should be returned can be distinguished from the occasion when the MCN_EUR identifier should be returned), currency is not used for vendor detection. Therefore, the vendor detection mechanism cannot decide between MCN_USD and MCN_EUR. In cases like this, create an MCN identifier, which will correspond to both MCN_USD and MCN_EUR and which will be returned when the vendor is detected. Next, you can create a rule in the Document Definition that will choose between MCN_USD and MCN_EUR depending on the currency of the given invoice. To generalize, the unique identifier of a vendor record should have a unique set of parameters that are used for vendor detection, such as company name, company address, tax IDs (VATID, NationalVATID), and IBAN (see Vendors data set). Only then will the vendor detection mechanism be able to select the right vendor record for an invoice.Next, the program can capture additional fields and use rules in the Document Definition to fine-tune the result to obtain the required value.
Multiple-value columns in a data set
A data set can store multiple values for one logical column of one company record. Storing multiple values is necessary because such company parameters as company name, street, etc. may vary from invoice to invoice (e.g. we may have “My Company Name” and “MCN Ltd.”), but in order to detect the company reliably, the text in the data set must closely match the text captured from an invoice image. Besides, company may have multiple bank accounts or other attributes.Note that multiple-value columns in Data sets should be used to store the same information written in different ways. For example, “Karl Marx Street” and “K. Marx str.” are two different ways of writing the same address. However, company branches in London and Berlin should have two separate records.
| Unique key of data set* | Name1 | Name2 | … | NameN | … |
|---|---|---|---|---|---|
| 1 | My Company Name | MCN Ltd. | … | <empty value> | … |
| 2 | The Second Company, Inc. | S-Company | … | <empty value> | … |
| … | … | … | … | … | … |
| Column corresponding to unique key in data set* | Name | … |
|---|---|---|
| 1 | My Company Name | … |
| 1 | MCN Ltd. | … |
| … | … | … |
| N | <empty value> | … |
| 2 | The Second Company, Inc. | … |
| 2 | S-Company | … |
| … | … | … |
| N | <empty value> | … |
| … | … | … |
