This commit is contained in:
admin
2026-02-07 20:04:42 +09:00
parent 331953bb7f
commit c60cbf2d9a
29 changed files with 1851 additions and 1246 deletions

View File

@@ -41,6 +41,7 @@ def fetch_trial_balance(date_from: str, date_to: str):
""")
accounts = cur.fetchall()
# 科目データを格納
account_data: Dict[str, Dict[str, Any]] = {}
@@ -99,7 +100,7 @@ def fetch_trial_balance(date_from: str, date_to: str):
row = cur.fetchone()
debit = D(row["debit"])
credit = D(row["credit"])
closing = opening + debit - credit
# 負債・資本は絶対値で表示(見やすくするため)
@@ -295,7 +296,7 @@ def fetch_trial_balance(date_from: str, date_to: str):
total_credit = sum(data["credit"] for data in account_data.values())
total_closing = sum(data["closing_balance"] for data in account_data.values())
return {
result = {
"totals": {
"opening_balance": str(total_opening),
"debit": str(total_debit),
@@ -306,3 +307,5 @@ def fetch_trial_balance(date_from: str, date_to: str):
"accounts": result_accounts,
"grand_total_closing": str(grand_total_closing)
}
return result