Add liability
This commit is contained in:
parent
69f08dc4a0
commit
30fd96ff50
17
g2f.py
17
g2f.py
@ -355,6 +355,23 @@ class GnuCashToFireflyMigrator:
|
|||||||
else:
|
else:
|
||||||
account_data["account_role"] = "defaultAsset" # default fallback
|
account_data["account_role"] = "defaultAsset" # default fallback
|
||||||
|
|
||||||
|
# add required fields for liability accounts
|
||||||
|
elif firefly_type == "liability":
|
||||||
|
# liability_type - mandatory when type is liability
|
||||||
|
if account.type in ["LOAN"] or "loan" in account.name.lower():
|
||||||
|
account_data["liability_type"] = "loan"
|
||||||
|
elif "mortgage" in account.fullname.lower():
|
||||||
|
account_data["liability_type"] = "mortgage"
|
||||||
|
else:
|
||||||
|
account_data["liability_type"] = "debt" # default for credit cards, etc.
|
||||||
|
|
||||||
|
# liability_direction - required by API
|
||||||
|
# "debit" means you owe the debt (most common case)
|
||||||
|
account_data["liability_direction"] = "debit"
|
||||||
|
|
||||||
|
# interest - mandatory when type is liability, defaults to "0"
|
||||||
|
account_data["interest"] = "0"
|
||||||
|
|
||||||
if account.code:
|
if account.code:
|
||||||
account_data["account_number"] = account.code
|
account_data["account_number"] = account.code
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user