ready to test
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,7 @@
|
|||||||
# Exclude virtual environment directory
|
# Exclude virtual environment directories
|
||||||
venv/
|
venv/
|
||||||
|
bin/
|
||||||
|
lib/
|
||||||
|
|
||||||
# Exclude other common files
|
# Exclude other common files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|||||||
20
main.beancount
Normal file
20
main.beancount
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
; Deze regel vertelt Beancount waar het je importer kan vinden.
|
||||||
|
; De path is relatief ten opzichte van dit bestand.
|
||||||
|
option "import-files" "./postbank_csv_importer.py"
|
||||||
|
|
||||||
|
; Dit is het jaar waarin je begint met je boekhouding.
|
||||||
|
option "operating_currency" "EUR"
|
||||||
|
|
||||||
|
; Hier definieer je al je rekeningen.
|
||||||
|
; De datum '2024-01-01' is de datum waarop de rekening is geopend.
|
||||||
|
; Deze accounts moeten overeenkomen met de accounts die je in je importer gebruikt.
|
||||||
|
2025-01-01 open Assets:Bank:PostbankGiro EUR
|
||||||
|
2025-01-01 open Expenses:Levensmiddelen EUR
|
||||||
|
2025-01-01 open Expenses:Rent EUR
|
||||||
|
2025-01-01 open Expenses:Electricity EUR
|
||||||
|
2025-01-01 open Expenses:Uncategorized EUR
|
||||||
|
2025-01-01 open Income:Salaris EUR
|
||||||
|
|
||||||
|
; Je kunt meer rekeningen toevoegen zoals:
|
||||||
|
; 2024-01-01 open Assets:Cash EUR
|
||||||
|
; 2024-01-01 open Expenses:Transport EUR
|
||||||
@@ -11,7 +11,7 @@ class MyCSVImporter(importer.ImporterProtocol):
|
|||||||
return file.name.endswith('.csv')
|
return file.name.endswith('.csv')
|
||||||
|
|
||||||
def file_account(self, file):
|
def file_account(self, file):
|
||||||
return "Assets:Bank:POSTBANK"
|
return "Assets:Bank:PostbankGiro"
|
||||||
|
|
||||||
def file_date(self, file):
|
def file_date(self, file):
|
||||||
"""Returns the unique date of the file, if any."""
|
"""Returns the unique date of the file, if any."""
|
||||||
@@ -44,7 +44,7 @@ class MyCSVImporter(importer.ImporterProtocol):
|
|||||||
# Bedrag = index 11
|
# Bedrag = index 11
|
||||||
# Valuta = index 17
|
# Valuta = index 17
|
||||||
datum_str = row[0]
|
datum_str = row[0]
|
||||||
ontvanter = row[3]
|
ontvanger = row[3]
|
||||||
omschrijving_str = row[4]
|
omschrijving_str = row[4]
|
||||||
bedrag_str = row[11]
|
bedrag_str = row[11]
|
||||||
valuta = row[17]
|
valuta = row[17]
|
||||||
@@ -52,9 +52,10 @@ class MyCSVImporter(importer.ImporterProtocol):
|
|||||||
dag, maand, jaar = datum_str.split('.')
|
dag, maand, jaar = datum_str.split('.')
|
||||||
transactie_datum = data.D(int(jaar)), int(maand), int(dag))
|
transactie_datum = data.D(int(jaar)), int(maand), int(dag))
|
||||||
|
|
||||||
payee = ontvanter
|
payee = ontvanger
|
||||||
narration = omschrijving_str
|
narration = omschrijving_str
|
||||||
bedrag = D(bedrag_str).replace(',','.')
|
bedrag = D(bedrag_str).replace(',','.')
|
||||||
|
currency = valuta
|
||||||
|
|
||||||
meta = data.new_metadata(file.name, index)
|
meta = data.new_metadata(file.name, index)
|
||||||
|
|
||||||
@@ -93,7 +94,7 @@ class MyCSVImporter(importer.ImporterProtocol):
|
|||||||
|
|
||||||
def _map_payee_to_account(self, payee):
|
def _map_payee_to_account(self, payee):
|
||||||
mapping = {
|
mapping = {
|
||||||
"Lohn": "Income:Salary",
|
"Lohn": "Income:Salaris",
|
||||||
"Miete": "Expenses:Rent",
|
"Miete": "Expenses:Rent",
|
||||||
"Sachsen":"Expenses:Electricity",
|
"Sachsen":"Expenses:Electricity",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user