Removed the account code from the journal entry form for mobile screens.

This commit is contained in:
2023-04-18 07:55:00 +08:00
parent a9acc18a6f
commit b6ae946f32
12 changed files with 70 additions and 19 deletions

View File

@ -267,6 +267,19 @@ class LineItemForm(FlaskForm):
self.journal_entry_form: JournalEntryForm | None = None
"""The source journal entry form."""
@property
def account_title(self) -> str:
"""Returns the title of the account.
:return: The title of the account.
"""
if self.account_code.data is None:
return ""
account: Account | None = Account.find_by_code(self.account_code.data)
if account is None:
return ""
return account.title
@property
def account_text(self) -> str:
"""Returns the text representation of the account.

View File

@ -32,6 +32,8 @@ class AccountOption:
"""The account ID."""
self.code: str = account.code
"""The account code."""
self.title: str = account.title
"""The account title."""
self.query_values: list[str] = account.query_values
"""The values to be queried."""
self.__str: str = str(account)

View File

@ -54,6 +54,14 @@ class DescriptionAccount:
"""
return str(self.__account)
@property
def title(self) -> str:
"""Returns the account title.
:return: The account title.
"""
return self.__account.title
def add_freq(self, freq: int) -> None:
"""Adds the frequency of an account.