From d5719ad2233cff8c599c2351f94838096b7ffe05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 28 Nov 2023 08:03:04 +0800 Subject: [PATCH] Refined to enable the selection of Accumulated Profit or Loss accounts other than 3351-001, facilitating the consolidation of existing balances. --- src/accounting/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/accounting/models.py b/src/accounting/models.py index df84366..bc8eccd 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -304,7 +304,8 @@ class Account(db.Model): cls.base_code.startswith("78"), cls.base_code.startswith("8"), cls.base_code.startswith("9")), - cls.base_code != "3351", + sa.not_(sa.and_(cls.base_code == "3351", + cls.no == 1)), cls.base_code != "3353")\ .order_by(cls.base_code, cls.no).all() @@ -326,7 +327,8 @@ class Account(db.Model): cls.base_code.startswith("74"), cls.base_code.startswith("8"), cls.base_code.startswith("9")), - cls.base_code != "3351", + sa.not_(sa.and_(cls.base_code == "3351", + cls.no == 1)), cls.base_code != "3353")\ .order_by(cls.base_code, cls.no).all()