Skip to content
Open
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
36 changes: 30 additions & 6 deletions kefiya/utils/fints_controller_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,38 @@ def import_fints_transactions(self, kefiya_import):

# curr_doc.start_date = tansactions[0]["date"]
# curr_doc.end_date = tansactions[-1]["date"]
first_txn = tansactions[0][0]
last_txn = tansactions[0][-1]
# PATCH: tansactions kann verschachtelt oder flach sein - normalisieren
if tansactions and isinstance(tansactions[0], list):
flat = []
for entry in tansactions:
if isinstance(entry, list):
flat.extend(entry)
else:
flat.append(entry)
tansactions = flat

# PATCH: Debug-Log fuer Diagnose (kann spaeter entfernt werden)
try:
frappe.log_error(
title="Kefiya FinTS Debug",
message="Count={} Type={} Sample={}".format(
len(tansactions),
type(tansactions[0]).__name__ if tansactions else 'N/A',
str(tansactions[0])[:500] if tansactions else 'empty'
)
)
except Exception:
pass

first_txn = tansactions[0]
last_txn = tansactions[-1]

curr_doc.start_date = first_txn.get("date") or first_txn.get("ValueDate.Date")
curr_doc.end_date = last_txn.get("date") or last_txn.get("ValueDate.Date")
curr_doc.start_date = first_txn.get("date") or first_txn.get("ValueDate.Date")
curr_doc.end_date = last_txn.get("date") or last_txn.get("ValueDate.Date")

importer = ImportBankTransaction(self.kefiya_login, self.interactive)
importer.kefiya_import(tansactions)
importer = ImportBankTransaction(self.kefiya_login, self.interactive)
# PATCH: old_kefiya_import statt kefiya_import - MT940-Format-Handler fuer FinTS
importer.old_kefiya_import(tansactions)

if len(importer.bank_transactions) == 0:
frappe.msgprint(_("No new payments found"))
Expand Down
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
name = "kefiya"
authors = [
{ name = "Phamos GmbH", email = "info@phamos.eu" },
]
description = "FinTS Connector for ERPNext (Germany)"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
dependencies = [
"fints==5.0.0b1"
]

[build-system]
requires = ["flit_core >=3.4,<4"]
build-backend = "flit_core.buildapi"

[tool.flit.module]
name = "kefiya"