Skip to content

Commit

Permalink
TUTORIAL: Update documentation of "fields"
Browse files Browse the repository at this point in the history
1. Drop "regex" part as fields can use various parsers
2. Describe common (standard) field names

Signed-off-by: Rafał Miłecki <[email protected]>
  • Loading branch information
Rafał Miłecki committed Sep 19, 2021
1 parent c8f9e58 commit cc209ac
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ Let's look at each field:

### Fields

All the regex `fields` you need extracted. Required fields are `amount`,
`date`, `invoice_number`. It's up to you, if you need more fields
extracted. Each field can be defined as:
This section defines what information (fields) should be extracted from
invoice and how.

Each field can be defined as:

- an **associative array** with `parser` specifying parsing method
- a single regex with one capturing group
Expand All @@ -65,6 +66,35 @@ extracted. Each field can be defined as:
The first method is preferred. It was introduced to make templates
syntax cleaner and more flexible. It aims to replace old methods.

Every template must specify at least `amount`, `date` and
`invoice_number` fields.

More fields can be extracted as required. For some common fields
following names should be used:

- Seller:

- ``company_id``: tax identifier (e.g. VAT identification number)
- ``electronic_mail``: e-mail address
- ``telephone``: phone number

- Amounts:

- ``tax_exclusive_amount``: invoice amount with taxes excluded

- Data:

- ``sale_date``: date of actual sale (may differ from issue date)

- Payment:

- ``bic``: Business Identifier Code
- ``due_date``: date by which invoice has to be paid
- ``iban``: International Bank Account Number
- ``payment_means_name``: payment method

Other fields can use custom field names.

### Parser `regex`

It\'s the basic parser that allows parsing content using regexes. The
Expand Down

0 comments on commit cc209ac

Please sign in to comment.