Replaced the hard-coded cash account codes with the CASH constant and the cash() method of the Account data model.

This commit is contained in:
2023-03-08 07:38:57 +08:00
parent 47e8944f06
commit 329e3d5362
2 changed files with 5 additions and 5 deletions

View File

@ -588,7 +588,7 @@ class Transaction(db.Model):
for currency in self.currencies:
if len(currency.debit) > 1:
return False
if currency.debit[0].account.code != "1111-001":
if currency.debit[0].account.code != Account.CASH:
return False
return True
@ -602,7 +602,7 @@ class Transaction(db.Model):
for currency in self.currencies:
if len(currency.credit) > 1:
return False
if currency.credit[0].account.code != "1111-001":
if currency.credit[0].account.code != Account.CASH:
return False
return True