Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TUTORIAL: Add "tax_lines" structure to standard fields #536

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Standard fields:
- `invoice_number`: unique number assigned to invoice by an issuer
- `amount`: total amount (with taxes)
- `vat`: [VAT identification number](https://en.wikipedia.org/wiki/VAT_identification_number)
- `tax_lines`: [structure](#tax_lines) containing detailed tax information

### Parser `regex`

Expand Down Expand Up @@ -343,6 +344,40 @@ Suggested values:
- 5: company specific template
- 6-10: company department/unit specific template

### tax_lines
Invoices / receipts often have a table near the bottom with a summary of the appied VAT taxes.
To correctly process the invoice in accounting programs we need separatly parse the amount per tax type.

Example invoice:
```
EXCL. VAT VAT-PERCENTAGE VAT-AMOUNT
0.00 0.0 0.0
0.00 9.0 0.0
42.73 21.0 8.97
```
Tax line Fields
| fieldname | type | Description |
| -------------- | :---------: | :-------------------------------------- |
| price_subtotal | float | The total amount of the tax rule excluding taxes. |
| line_tax_percent | float | The percentage of tax |
| line_tax_amount | float | The amount of tax for the tax line |


Example template:
```
tax_lines:
parser: lines
start: 'EXCL. VAT'
end: '\Z'
line:
- '(?P<price_subtotal>[\d+.]+)\s+(?P<line_tax_percent>[\d+.]+)\s+(?P<line_tax_amount>[\d+.]+)'
types:
price_subtotal: float
line_tax_percent: float
line_tax_amount: float
```


### Example of template using most options

issuer: Free Mobile
Expand Down
Loading