Simplified the code in the query_values pseudo property of the JournalEntryLineItem data model.

This commit is contained in:
依瑪貓 2023-03-24 09:15:29 +08:00
parent 5c4f6017b8
commit 93ba086548

View File

@ -770,12 +770,10 @@ class JournalEntryLineItem(db.Model):
frac: Decimal = (value - whole).normalize() frac: Decimal = (value - whole).normalize()
return str(whole) + str(abs(frac))[1:] return str(whole) + str(abs(frac))[1:]
journal_entry_day: date = self.journal_entry.date return ["{}/{}/{}".format(self.journal_entry.date.year,
description: str = "" if self.description is None else self.description self.journal_entry.date.month,
return [description, self.journal_entry.date.day),
"{}/{}/{}".format(journal_entry_day.year, "" if self.description is None else self.description,
journal_entry_day.month,
journal_entry_day.day),
format_amount(self.amount)] format_amount(self.amount)]