修正
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user