desktop修正

This commit is contained in:
admin
2025-12-14 23:54:48 +09:00
parent f9f5eec35e
commit 74dcb88fe6
25 changed files with 1068 additions and 157 deletions

View File

@@ -0,0 +1,19 @@
from fastapi import HTTPException
from app.core.database import get_connection
def check_fiscal_year_unlocked(journal_date):
fiscal_year = journal_date.year
with get_connection() as conn, conn.cursor() as cur:
cur.execute("""
SELECT is_locked
FROM fiscal_year_locks
WHERE fiscal_year = %s
""", (fiscal_year,))
row = cur.fetchone()
if row and row["is_locked"]:
raise HTTPException(
status_code=400,
detail="この会計年度は既に確定されているため、仕訳を変更できません。"
)