This commit is contained in:
FNOS-WIN11ENT\choshoukaku
2025-12-18 15:30:39 +09:00
parent 88163423e0
commit 87fa1aaa1f
12 changed files with 742 additions and 192 deletions

View File

@@ -33,6 +33,7 @@ def fetch_trial_balance(date_from: str, date_to: str):
SELECT COALESCE(SUM(l.debit - l.credit), 0) AS opening
FROM journal_lines l
JOIN journal_entries j ON j.journal_id = l.journal_id
AND j.is_deleted = false
WHERE l.account_id = %s
AND j.journal_date < %s
""", (aid, date_from))
@@ -45,6 +46,7 @@ def fetch_trial_balance(date_from: str, date_to: str):
COALESCE(SUM(l.credit), 0) AS credit
FROM journal_lines l
JOIN journal_entries j ON j.journal_id = l.journal_id
AND j.is_deleted = false
WHERE l.account_id = %s
AND j.journal_date BETWEEN %s AND %s
""", (aid, date_from, date_to))