diff --git a/domain/currency.py b/domain/currency.py index c2cbe7b..b1c8d49 100644 --- a/domain/currency.py +++ b/domain/currency.py @@ -15,8 +15,10 @@ CURRENCY_SYMBOLS = { # ISO 4217 minor units per currency (https://en.wikipedia.org/wiki/ISO_4217). # Keys are uppercase 3-letter codes, values are the number of decimal digits used -# when DISPLAYING the currency. Internal arithmetic keeps full Decimal precision -# (do not modify — see T8 decision `internal_precision`). +# when DISPLAYING the currency. Дисплейное округление задаётся здесь и НЕ равно +# точности внутренней арифметики: `convert()` квантует результат до 2 знаков +# (`Decimal("0.01")`, ROUND_HALF_UP) независимо от числа знаков валюты. +# Изменение этого поведения — Tier 2 (D15), сейчас оно зафиксировано как есть. # # - 0 decimals: JPY (Japanese yen) # - 2 decimals: most currencies (RUB, USD, EUR, GBP, CNY, KZT, UAH, ...) diff --git a/infrastructure/cli/services.py b/infrastructure/cli/services.py index 2dbbf9f..7bd8642 100644 --- a/infrastructure/cli/services.py +++ b/infrastructure/cli/services.py @@ -55,8 +55,10 @@ def convert_value(converter: CurrencyConverter, amount: Decimal, from_curr: str, def fmt_amount(amount: Decimal | float, currency: str, symbol: str = "") -> str: """Format money via the canonical display rule. - `symbol` is retained as a positional parameter for backward compatibility with - existing callers (compare.py / forecast.py / scenario.py / whatif.py); the - symbol/layout decision is centralised in `CurrencyConverter.format_money`. + `symbol` НЕ читается: символ и раскладку определяет + `CurrencyConverter.format_money` по коду валюты. Параметр оставлен только + ради совместимости с существующими вызовами + (compare.py / forecast.py / scenario.py / whatif.py), которые передают его + позиционно. """ return CurrencyConverter.format_money(amount, currency) diff --git a/infrastructure/repositories/excel_repository.py b/infrastructure/repositories/excel_repository.py index 757be43..2ead5a2 100644 --- a/infrastructure/repositories/excel_repository.py +++ b/infrastructure/repositories/excel_repository.py @@ -1,4 +1,8 @@ -"""ExcelRepository — хранит FinancialModel в .xlsx (5 листов + ModelInfo).""" +"""ExcelRepository — хранит FinancialModel в .xlsx (6 листов данных + ModelInfo). + +Листы данных: Accounts, Transactions, Recurring, Assets, Liabilities, +ExchangeRates. Плюс служебный лист ModelInfo (base_currency). +""" from pathlib import Path from uuid import UUID