From 0a01dd9e6912cd84b9821255824e6be03e414bec Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 30 Mar 2026 17:16:47 +0800 Subject: [PATCH 1/2] bugfix --- accounting/accounting_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounting/accounting_config.py b/accounting/accounting_config.py index af058d1..bf87ace 100644 --- a/accounting/accounting_config.py +++ b/accounting/accounting_config.py @@ -153,8 +153,8 @@ class Accounting: acc_balance -= l['amount'] else: acc_balance += l['amount'] - if acc_balance < 0.000000: - e = AccountOverDraw(curacc, l['acc'].balance, leg['amount']) + if acc_balance < 0.000001: + e = AccountOverDraw(curacc, l['acc'].balance, l['amount']) exception(f'{e},{legs=}') raise e l['new_balance'] = acc_balance From f1074cc3ae9936ec296f0ab58e11c5e2736c490b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 31 Mar 2026 10:44:31 +0800 Subject: [PATCH 2/2] bugfix --- accounting/getaccount.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounting/getaccount.py b/accounting/getaccount.py index 2cacb7a..6af3fba 100644 --- a/accounting/getaccount.py +++ b/accounting/getaccount.py @@ -47,11 +47,11 @@ async def getAccountByName(sor, accounting_orgid, orgid, name, org1id): async def getCustomerBalance(sor, customerid): name = '客户资金账户' - get_owner_orgid = get_serverenv('get_owner_orgid') + env = ServerEnv() + get_owner_orgid = env.get_owner_orgid if get_owner_orgid is None: debug('get_owner_orgid function is not a serverenv function') return None - debug(f'{get_owner_orgid=}') orgid = await get_owner_orgid(sor, customerid) if orgid is None: debug(f"{customerid=}'s parent organization not found")