Renamed the "journal_entry_date" parameter to "date" in the "sort_journal_entries_in" function in the "accounting.journal_entry.forms.reorder" module.

This commit is contained in:
依瑪貓 2023-04-26 13:29:14 +08:00
parent 10f5e75752
commit 969e8c76a6

View File

@ -26,17 +26,15 @@ from accounting import db
from accounting.models import JournalEntry from accounting.models import JournalEntry
def sort_journal_entries_in(journal_entry_date: dt.date, def sort_journal_entries_in(date: dt.date, exclude: int | None = None) -> None:
exclude: int | None = None) -> None:
"""Sorts the journal entries under a date after changing the date or """Sorts the journal entries under a date after changing the date or
deleting a journal entry. deleting a journal entry.
:param journal_entry_date: The date of the journal entry. :param date: The date of the journal entry.
:param exclude: The journal entry ID to exclude. :param exclude: The journal entry ID to exclude.
:return: None. :return: None.
""" """
conditions: list[sa.BinaryExpression] \ conditions: list[sa.BinaryExpression] = [JournalEntry.date == date]
= [JournalEntry.date == journal_entry_date]
if exclude is not None: if exclude is not None:
conditions.append(JournalEntry.id != exclude) conditions.append(JournalEntry.id != exclude)
journal_entries: list[JournalEntry] = JournalEntry.query\ journal_entries: list[JournalEntry] = JournalEntry.query\