Reordered the methods in the JournalEntryLineItem data model.

This commit is contained in:
依瑪貓 2023-04-08 14:05:19 +08:00
parent a3507494e5
commit a8f318b0bb

View File

@ -722,14 +722,6 @@ class JournalEntryLineItem(db.Model):
"""
return self.account.code
@property
def debit(self) -> Decimal | None:
"""Returns the debit amount.
:return: The debit amount, or None if this is not a debit line item.
"""
return self.amount if self.is_debit else None
@property
def is_need_offset(self) -> bool:
"""Returns whether the line item needs offset.
@ -744,6 +736,14 @@ class JournalEntryLineItem(db.Model):
return False
return True
@property
def debit(self) -> Decimal | None:
"""Returns the debit amount.
:return: The debit amount, or None if this is not a debit line item.
"""
return self.amount if self.is_debit else None
@property
def credit(self) -> Decimal | None:
"""Returns the credit amount.