обновление докстринг
This commit is contained in:
parent
4b98ff2a24
commit
b3260ab288
@ -28,7 +28,7 @@ async def list_rules_with_accounts(
|
|||||||
|
|
||||||
|
|
||||||
async def latest_effective_version_no(session: AsyncSession, as_of: date) -> int | None:
|
async def latest_effective_version_no(session: AsyncSession, as_of: date) -> int | None:
|
||||||
"""Максимальный номер версии правил, действующей на дату создания"""
|
"""Максимальный номер версии правил §4, действующей на дату создания."""
|
||||||
return await session.scalar(
|
return await session.scalar(
|
||||||
select(func.max(EliminationRule.version_no)).where(
|
select(func.max(EliminationRule.version_no)).where(
|
||||||
EliminationRule.valid_from <= as_of,
|
EliminationRule.valid_from <= as_of,
|
||||||
@ -43,7 +43,7 @@ def is_valid_for_version(rule: EliminationRule | None, version_no: int) -> bool:
|
|||||||
|
|
||||||
|
|
||||||
async def list_rules(session: AsyncSession, version_no: int) -> list[EliminationRule]:
|
async def list_rules(session: AsyncSession, version_no: int) -> list[EliminationRule]:
|
||||||
"""Все правила заданной версии, включая ББ и ОФР, в порядке типа отчётности и номера."""
|
"""Все правила §4 заданной версии, включая ББ и ОФР, в порядке типа отчётности и номера."""
|
||||||
stmt = (
|
stmt = (
|
||||||
select(EliminationRule)
|
select(EliminationRule)
|
||||||
.where(EliminationRule.version_no == version_no)
|
.where(EliminationRule.version_no == version_no)
|
||||||
@ -55,7 +55,7 @@ async def list_rules(session: AsyncSession, version_no: int) -> list[Elimination
|
|||||||
async def list_rule_accounts(
|
async def list_rule_accounts(
|
||||||
session: AsyncSession, rule_ids: Collection[uuid.UUID]
|
session: AsyncSession, rule_ids: Collection[uuid.UUID]
|
||||||
) -> list[tuple[EliminationRuleAccount, str]]:
|
) -> list[tuple[EliminationRuleAccount, str]]:
|
||||||
"""Счета правил с кодами из плана счетов; `company_no` задаёт сторону, `is_excluded` — исключение."""
|
"""Счета правил §4 с кодами из плана счетов; `company_no` задаёт сторону, `is_excluded` — исключение."""
|
||||||
if not rule_ids:
|
if not rule_ids:
|
||||||
return []
|
return []
|
||||||
stmt = (
|
stmt = (
|
||||||
|
|||||||
@ -198,7 +198,7 @@ def calculate_matrix(
|
|||||||
member_companies: Sequence[IntercompanyMatrixCompanyOut],
|
member_companies: Sequence[IntercompanyMatrixCompanyOut],
|
||||||
selection: MatrixSelection,
|
selection: MatrixSelection,
|
||||||
) -> IntercompanyMatrixOut:
|
) -> IntercompanyMatrixOut:
|
||||||
"""Суммы по парам компаний;
|
"""Суммы по парам компаний для шахматки (§6).
|
||||||
|
|
||||||
Сторона 1: дебет ОСВ компании A по контрагенту Б.
|
Сторона 1: дебет ОСВ компании A по контрагенту Б.
|
||||||
Сторона 2: кредит ОСВ компании Б по контрагенту A.
|
Сторона 2: кредит ОСВ компании Б по контрагенту A.
|
||||||
@ -318,7 +318,7 @@ def calculate_result_table(
|
|||||||
member_companies: Sequence[IntercompanyMatrixCompanyOut],
|
member_companies: Sequence[IntercompanyMatrixCompanyOut],
|
||||||
accounts: Sequence[ChartOfAccount],
|
accounts: Sequence[ChartOfAccount],
|
||||||
) -> IntercompanyResultTableOut:
|
) -> IntercompanyResultTableOut:
|
||||||
"""Фиксированные статьи ВГО: сальдо по всем контрагентам периметра для каждого ЮЛ."""
|
"""Фиксированные статьи ВГО: сальдо по всем контрагентам периметра для каждого ЮЛ (§6)."""
|
||||||
by_id, children = _make_account_tree(accounts)
|
by_id, children = _make_account_tree(accounts)
|
||||||
by_code = {account.code: account.id for account in accounts}
|
by_code = {account.code: account.id for account in accounts}
|
||||||
required_codes = {code for article in RESULT_ARTICLES for code in (*article.account_codes, *article.excluded_codes)}
|
required_codes = {code for article in RESULT_ARTICLES for code in (*article.account_codes, *article.excluded_codes)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user