From 6b3f2710a4bc3941e6a949ea6433a4ae4767de3a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 16 Dec 2025 20:54:49 +0800 Subject: [PATCH 1/6] bugfix --- wwwroot/open_customer_accounts.dspy | 7 +++++++ wwwroot/open_owner_accounts.dspy | 7 +++++++ wwwroot/open_reseller_accounts.dspy | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 wwwroot/open_customer_accounts.dspy create mode 100644 wwwroot/open_owner_accounts.dspy create mode 100644 wwwroot/open_reseller_accounts.dspy diff --git a/wwwroot/open_customer_accounts.dspy b/wwwroot/open_customer_accounts.dspy new file mode 100644 index 0000000..255f483 --- /dev/null +++ b/wwwroot/open_customer_accounts.dspy @@ -0,0 +1,7 @@ +debug(f'{params_kw=}') +dbname = get_module_dbname('accounting') +db = DBPools() +async with db.sqlorContext(dbname) as sor: + await openCustomerAccounts(sor, '0', params_kw.orgid) + return f'{params_kw.orgid} accounts opened') +return f'{db.e_except=} diff --git a/wwwroot/open_owner_accounts.dspy b/wwwroot/open_owner_accounts.dspy new file mode 100644 index 0000000..f3b9813 --- /dev/null +++ b/wwwroot/open_owner_accounts.dspy @@ -0,0 +1,7 @@ +debug(f'{params_kw=}') +dbname = get_module_dbname('accounting') +db = DBPools() +async with db.sqlorContext(dbname) as sor: + await openOwnerAccounts(sor, '0') + return f'0 accounts opened') +return f'{db.e_except=} diff --git a/wwwroot/open_reseller_accounts.dspy b/wwwroot/open_reseller_accounts.dspy new file mode 100644 index 0000000..06e6083 --- /dev/null +++ b/wwwroot/open_reseller_accounts.dspy @@ -0,0 +1,7 @@ +debug(f'{params_kw=}') +dbname = get_module_dbname('accounting') +db = DBPools() +async with db.sqlorContext(dbname) as sor: + await openResellerAccounts(sor, '0', params_kw.orgid) + return f'{params_kw.orgid} accounts opened') +return f'{db.e_except=} From 058172c52aa8dccc5c1301c1d15e743776e7055b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Dec 2025 07:55:25 +0800 Subject: [PATCH 2/6] bugfix --- accounting/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounting/init.py b/accounting/init.py index 7d99d0d..051a587 100644 --- a/accounting/init.py +++ b/accounting/init.py @@ -8,7 +8,7 @@ from accounting.openaccount import openOwnerAccounts, openProviderAccounts, open from accounting.getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount from accounting.bizaccount import BizAccounting from accounting.recharge import RechargeBiz, recharge_accounting -from comsume import ConsumeBiz +from accounting.comsume import ConsumeBiz def load_accounting(): g = ServerEnv() From 91a1153181b21ca36ceb26132900aaf452177ad4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Dec 2025 07:58:49 +0800 Subject: [PATCH 3/6] bugfix --- accounting/init.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/accounting/init.py b/accounting/init.py index 051a587..2aa7662 100644 --- a/accounting/init.py +++ b/accounting/init.py @@ -2,13 +2,13 @@ from appPublic.registerfunction import RegisterFunction from appPublic.dictObject import DictObject from appPublic.log import debug, exception, error from ahserver.serverenv import ServerEnv -from accounting.accounting_config import Accounting -from accounting.bill import write_bill -from accounting.openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts -from accounting.getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount -from accounting.bizaccount import BizAccounting -from accounting.recharge import RechargeBiz, recharge_accounting -from accounting.comsume import ConsumeBiz +from .accounting_config import Accounting +from .bill import write_bill +from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts +from .getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount +from .bizaccount import BizAccounting +from .recharge import RechargeBiz, recharge_accounting +from .comsume import ConsumeBiz def load_accounting(): g = ServerEnv() From 9ec0754cae9c2f7e27e5a57f3a46a9ad92b7163a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Dec 2025 08:00:24 +0800 Subject: [PATCH 4/6] bugfix --- accounting/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounting/init.py b/accounting/init.py index 2aa7662..d0fefa2 100644 --- a/accounting/init.py +++ b/accounting/init.py @@ -8,7 +8,7 @@ from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAc from .getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount from .bizaccount import BizAccounting from .recharge import RechargeBiz, recharge_accounting -from .comsume import ConsumeBiz +from .consume import ConsumeBiz def load_accounting(): g = ServerEnv() From 70c83bafc7dda8fc92db490cb0342f476ef6b1e7 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Dec 2025 08:02:02 +0800 Subject: [PATCH 5/6] bugfix --- accounting/consume.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/accounting/consume.py b/accounting/consume.py index 3e8572b..ab1bbcb 100644 --- a/accounting/consume.py +++ b/accounting/consume.py @@ -54,16 +54,16 @@ class ConsumeBiz(PFBiz): ao = Accounting(self) await ao.do_accounting(sor) - async def get_orgid_by_trans_role(self, sor, leg, role): - if role == 'owner': - return '0' - if role == 'customer': - return self.customerid + async def get_orgid_by_trans_role(self, sor, leg, role): + if role == 'owner': + return '0' + if role == 'customer': + return self.customerid if role == 'reseller': return self.resellerid - if role is None or role == 'null': - return None - e = Exception(f'unknown role({role})') - exception(f'Exception:{e}') - raise e + if role is None or role == 'null': + return None + e = Exception(f'unknown role({role})') + exception(f'Exception:{e}') + raise e From 8d3676d21136a6d2fbeee7120816d97f3bd13e67 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Dec 2025 08:03:09 +0800 Subject: [PATCH 6/6] bugfix --- accounting/consume.py | 1 - 1 file changed, 1 deletion(-) diff --git a/accounting/consume.py b/accounting/consume.py index ab1bbcb..7b2d68c 100644 --- a/accounting/consume.py +++ b/accounting/consume.py @@ -9,7 +9,6 @@ from .const import * from .accountingnode import get_accounting_nodes from .excep import * from .getaccount import getAccountByName -from .businessdate import get_business_date class ConsumeBiz(PFBiz): def __init__(self, consume_logs):