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/
|
||||
bin/
|
||||
lib/
|
||||
|
||||
# Exclude other common files
|
||||
__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')
|
||||
|
||||
def file_account(self, file):
|
||||
return "Assets:Bank:POSTBANK"
|
||||
return "Assets:Bank:PostbankGiro"
|
||||
|
||||
def file_date(self, file):
|
||||
"""Returns the unique date of the file, if any."""
|
||||
@@ -44,17 +44,18 @@ class MyCSVImporter(importer.ImporterProtocol):
|
||||
# Bedrag = index 11
|
||||
# Valuta = index 17
|
||||
datum_str = row[0]
|
||||
ontvanter = row[3]
|
||||
ontvanger = row[3]
|
||||
omschrijving_str = row[4]
|
||||
bedrag_str = row[11]
|
||||
valuta = row [17]
|
||||
valuta = row[17]
|
||||
|
||||
dag, maand, jaar = datum_str.split('.')
|
||||
transactie_datum = data.D(int(jaar)), int(maand), int(dag))
|
||||
|
||||
payee = ontvanter
|
||||
payee = ontvanger
|
||||
narration = omschrijving_str
|
||||
bedrag = D(bedrag_str).replace(',','.')
|
||||
currency = valuta
|
||||
|
||||
meta = data.new_metadata(file.name, index)
|
||||
|
||||
@@ -93,7 +94,7 @@ class MyCSVImporter(importer.ImporterProtocol):
|
||||
|
||||
def _map_payee_to_account(self, payee):
|
||||
mapping = {
|
||||
"Lohn": "Income:Salary",
|
||||
"Lohn": "Income:Salaris",
|
||||
"Miete": "Expenses:Rent",
|
||||
"Sachsen":"Expenses:Electricity",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user