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 templates #472

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
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
73 changes: 73 additions & 0 deletions src/invoice2data/extract/templates/be/be.accor.invest.ibis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
issuer: Accor Invest Belgium nv SA
fields:
amount:
parser: regex
regex: Total to pay EUR\s+(\d?.?\d{1,4},\d{2})
type: float
amount_tax:
parser: regex
regex: \d{2}[%]\s+\w\s+\d{1,4}[,]\d{2}\s+(\d{1,4}[,]\d{2})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably just use % instead of [%] (same applies to [,] and other regexes below)

type: float
amount_untaxed:
parser: regex
regex: \d{2}[%]\s+\w\s+(\d{1,4}[,]\d{2})\s+\d{1,4}[,]\d{2}
type: float
date:
parser: regex
regex: '\w+\S\s(\d{1,2}[/]\d{1,2}[/]\d{4})\n'
type: date
date_due:
parser: regex
regex: '\w+\S\s(\d{1,2}[/]\d{1,2}[/]\d{4})\n'
type: date
invoice_number:
parser: regex
regex: Our ref[.]\s[:](.*)\s[(]
iban:
parser: regex
regex: '[A-Z]{2}\d{2}?\w{4}?\d{4}?\d{4}?\d{0,2}'
bic:
parser: regex
regex: '(?i)BIC[:]\s+(\w{8,11})'
static_vat: BE0673923435
partner_website:
parser: static
value: all.accor.com
partner_name:
parser: static
value: Accor Invest Belgium nv SA
country_code:
parser: static
value: be
partner_zip:
parser: static
value: B-1000
partner_city:
parser: regex
regex: Brussel
partner_street:
parser: static
value: Square de Meeus 35
narration:
parser: regex
regex: Ibis\s+\S+
lines:
start: Datum\s\S\s+Omschrijving
end: (?i)Totaal\ste
line: (?P<name>(\d+[-]\d+[-]\w+(?:\s+\S+){1,8}))\s+(?P<qty>\d+)\s+(?P<price_subtotal>\d+[,]\d{2})
types:
qty: float
price_unit: float
price_subtotal: float
taxpercent: float
keywords:
- (?i)Accor
- 'BE\s0673\s923'
- 'Factuur'
options:
currency: EUR
languages:
- nl
- be
- en
decimal_separator: ','
38 changes: 30 additions & 8 deletions src/invoice2data/extract/templates/com/com.namecheap.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
issuer: Namecheap, Inc.
fields:
amount: Ordertotal\$(\d+\.\d+)
amount:
parser: regex
regex: TOTAL\s+[$](\d+\.\d+)
type: float
date:
- Orderdate(\d+\­\d+\­\d{2})
parser: regex
regex: Order\sDate\s+[:]\s+(\d+.\d+.\d{4})
type: date
invoice_number:
- Ordernumber(\d+)
parser: regex
regex: Order\sNumber\s+[:]\s(\d+)
partner_website:
parser: static
value: namecheap.com
partner_name:
parser: static
value: Namecheap, Inc.
partner_city:
parser: regex
regex: Phoenix
partner_street:
parser: static
value: East Washington Street 305
partner_email:
parser: static
value: support@namecheap.com
country_code:
parser: static
value: US
keywords:
- NameSilo
- 0818922
- (?i)NameCheap
- RECEIPT
options:
remove_whitespace: true
remove_whitespace: false
currency: USD
date_formats:
- '%Y-%m-%d'
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
issuer: Digital River Ireland, Ltd.
fields:
amount:
parser: regex
regex: Totaal [(]EUR[)]\s+(\d?.?\d{1,4}[,]\d{2})
type: float
amount_tax:
parser: regex
regex: Totale btw-kosten\s+(\d?.?\d{1,4}[,]\d{2})
type: float
date:
parser: regex
regex: 'Factuurdatum\s+(\d{1,2}[.]\d{1,2}[.]\d{4})'
type: date
invoice_number:
parser: regex
regex: Factuurnummer\s+(\d+)
iban:
parser: regex
regex: '[A-Z]{2}\d{2}?\w{4}?\d{4}?\d{4}?\d{0,2}'
bic:
parser: regex
regex: '(?i)BIC[:]\s+(\w{8,11})'
static_vat: NL815471166B01
partner_website:
parser: static
value: lenovo.com
partner_name:
parser: static
value: Digital River Ireland, Ltd.
country_code:
parser: static
value: ie
partner_city:
parser: regex
regex: Dublin
partner_street:
parser: static
value: Park Lane
narration:
parser: regex
regex: Volgnummer factuur:\s+\S+
lines:
start: Productbeschrijving
end: (?i)Producttotaal
line: (?P<name>(\w+(?:\s+\S+){1,8}))\s+(?P<qty>\d)\s+(?P<price_subtotal>\d?[.]?\d+[,]\d{2})
types:
qty: float
price_unit: float
price_subtotal: float
taxpercent: float
keywords:
- (?i)Digital\sRiver
- 'NL815471166B01'
- 'Factuur'
options:
currency: EUR
languages:
- nl
decimal_separator: ','
4 changes: 3 additions & 1 deletion src/invoice2data/extract/templates/nl/nl.action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ fields:
date: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
invoice_number: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
static_partner_name: action
country_code:
parser: static
value: nl
payment_method:
- (AMEX)
- (VISA)
Expand Down Expand Up @@ -42,5 +45,4 @@ options:
- [', ', ',']
- ['°', ' ']
- ['©', ' ']
- [',.', ',']
- ['(\s)([0-9]+)\.([0-9]{2})(\s)', '\1\2,\3\4'] # workaround for ocr
4 changes: 3 additions & 1 deletion src/invoice2data/extract/templates/nl/nl.albron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ fields:
date: (\d{1,2}[-|\/]\d{2}[-|\/]\d{2})
invoice_number: (\d{1,2}[-|\/]\d{2}[-|\/]\d{2})
static_partner_name: Albron
country_code:
parser: static
value: nl
payment_method:
- (AMEX)
- (VISA)
Expand Down Expand Up @@ -53,5 +56,4 @@ options:
- [', ', ',']
- ['°', ' ']
- ['©', ' ']
- [',.', ',']
- ['(\s)([0-9]+)\.([0-9]{2})(\s)', '\1\2,\3\4'] # workaround for ocr
4 changes: 3 additions & 1 deletion src/invoice2data/extract/templates/nl/nl.gamma.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ fields:
parser: regex
regex:
- '([+]\d{2}\s+\d{1,4}\s+\d{3,7})'
country_code:
parser: static
value: nl
date: Datum[:]\s+(\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
invoice_number: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
payment_method:
Expand Down Expand Up @@ -50,5 +53,4 @@ options:
- [', ', ',']
- ['°', ' ']
- ['©', ' ']
- [',.', ',']
- ['(\s)([0-9]+)\.([0-9]{2})(\s)', '\1\2,\3\4'] # workaround for ocr
4 changes: 3 additions & 1 deletion src/invoice2data/extract/templates/nl/nl.karwei.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ fields:
parser: regex
regex:
- '([+]\d{2}\s+\d{1,4}\s+\d{3,7})'
country_code:
parser: static
value: nl
date: Datum[:]\s+(\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
invoice_number: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
payment_method:
Expand Down Expand Up @@ -50,4 +53,3 @@ options:
- [', ', ',']
- ['°', ' ']
- ['©', ' ']
- [',.', ',']
12 changes: 9 additions & 3 deletions src/invoice2data/extract/templates/nl/nl.koffiehenk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ fields:
group: sum
bic: BIC.(\w{8,11})
iban: IBAN.(\w{10,30})
date: datum\s+(\d{1,2} .+ \d{4})
date:
parser: regex
regex: Factuurdatum[:]\s+(\d{1,2} .+[.] \d{4})
type: date
invoice_number: Factuurnummer.?\s+(\d{5,17})
static_vat: NL001409338B42
country_code:
parser: static
value: nl
payment_method:
- (iDEAL)
- (AMEX)
Expand All @@ -26,8 +32,8 @@ fields:
- (?i)(Paypal)
lines:
start: Art.nr.
end: Subtotaal (excl. BTW)
line: (?P<barcode>\d+)\s+(?P<product>\w+.*)\s+(?P<price_unit>[€]\s+(\d+,\d{2}))\s+(?P<qty>\d+)
end: Subtotaal [(]excl. BTW[)]
line: (?P<barcode>\d+)\s+(?P<product>\w+.*)\s+[€]\s+(?P<price_unit>(\d+.\d{2}))\s+(?P<qty>\d+)
types:
qty: float
price_unit: float
Expand Down
19 changes: 14 additions & 5 deletions src/invoice2data/extract/templates/nl/nl.praxis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ fields:
parser: regex
regex:
- '(\d{1,3}[-]\d{5,6})'
date: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
invoice_number: (\d{1,2}[-|\/]\d{2}[-|\/]\d{4})
date:
parser: regex
regex:
- \s(\d{1,2}.\d{2}.\d{4})\s
- \s(\d{4}-\w{3}-\d{2})\s
type: date
invoice_number:
parser: regex
regex: \s(\d{4}-\w{3}-\d{2})\s
static_vat: NL004371021B01
country_code:
parser: static
value: nl
partner_name:
parser: regex
regex:
Expand All @@ -39,8 +49,8 @@ lines:
end: BTW SPECIFICATIE
line: '.(?P<product>\w+).?\s+.?d+.\d{1,2}'
keywords:
- Praxis
- EUR
- (?i)Praxis
- (?i)Doe\sHet\s
options:
currency: EUR
date_formats:
Expand All @@ -56,5 +66,4 @@ options:
- [', ', ',']
- ['°', ' ']
- ['©', ' ']
- [',.', ',']
- ['(\s)([0-9]+)\.([0-9]{2})(\s)', '\1\2,\3\4'] # workaround for ocr
3 changes: 3 additions & 0 deletions src/invoice2data/extract/templates/nl/nl.transip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ fields:
invoice_number: Factuur.\s+(F\d+[.]\d+[.]\d+[.]\d+)
static_vat: NL812334966B01
partner_coc: KvK\s(\d{8})
country_code:
parser: static
value: nl
lines:
start: Aantal
end: Subtotaal\s
Expand Down
35 changes: 19 additions & 16 deletions src/invoice2data/extract/templates/nl/nl.vodafone.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# SPDX-License-Identifier: MIT
issuer: Vodafone Libertel B.V.
fields:
amount: Totaal te betalen\s+.\s(\d+,\d{2})
amount_untaxed: Totaal exclusief btw\s+(\d+.\d{2})
date: Datum\s+(\d{1,2} \w{3,9}\s\d{4})
date_due: Dit bedrag wordt omstreeks (\d{1,2}\s\w{3,8}\s\d{4})
invoice_number: Rekeningnummer.\s+(\d+)
static_vat: NL800755133B01
keywords:
- NL800755133B01
options:
currency: EUR
languages:
- nl
decimal_separator: ','
# SPDX-License-Identifier: MIT
issuer: Vodafone Libertel B.V.
fields:
amount: Totaal te betalen\s+.\s(\d+,\d{2})
amount_untaxed: Totaal exclusief btw\s+(\d+.\d{2})
date: Datum\s+(\d{1,2} \w{3,9}\s\d{4})
date_due: Dit bedrag wordt omstreeks (\d{1,2}\s\w{3,8}\s\d{4})
invoice_number: Rekeningnummer.\s+(\d+)
static_vat: NL800755133B01
country_code:
parser: static
value: nl
keywords:
- NL800755133B01
options:
currency: EUR
languages:
- nl
decimal_separator: ','
3 changes: 3 additions & 0 deletions src/invoice2data/extract/templates/nl/nl.yezzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ fields:
static_vat: NL855570477B01
date_start: (\d{2}-\d{2}-\d{4}) tot
date_end: tot (\d{2}-\d{2}-\d{4})
country_code:
parser: static
value: nl
lines:
start: (\d{2}-\d{2}-\d{4}) tot (\d{2}-\d{2}-\d{4})
end: Totaal
Expand Down