Compare commits

..

2 Commits

Author SHA1 Message Date
76acdb6a3b bugfix 2026-01-04 16:56:00 +08:00
6a1b09269e bugfix 2026-01-04 16:55:47 +08:00
5 changed files with 21 additions and 9 deletions

View File

@ -5,7 +5,7 @@ from ahserver.serverenv import ServerEnv
from sqlor.dbpools import get_sor_context
from .accounting_config import Accounting
from .bill import write_bill
from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts
from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts, openRetailRelationshipAccounts
from .getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount
from .bizaccount import BizAccounting
from .recharge import RechargeBiz, recharge_accounting
@ -78,3 +78,4 @@ def load_accounting():
g.recharge_accounting = recharge_accounting
g.get_accdetail = get_accdetail
g.all_my_accounts = all_my_accounts
g.openRetailRelationshipAccounts = openRetailRelationshipAccounts

View File

@ -1,7 +1,8 @@
debug(f'{params_kw=}')
dbname = get_module_dbname('accounting')
orgid = await get_userorgid()
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=}
await openCustomerAccounts(sor, '0', orgid)
return f'{orgid} customer accounts opened'
return f'{db.e_except=}'

View File

@ -3,5 +3,5 @@ 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=}
return f'0 accounts opened'
return f'{db.e_except=}'

View File

@ -1,7 +1,8 @@
debug(f'{params_kw=}')
dbname = get_module_dbname('accounting')
orgid = await get_userorgid()
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=}
await openResellerAccounts(sor, '0', orgid)
return f'{orgid} reseller accounts opened'
return f'{db.e_except=}'

View File

@ -0,0 +1,9 @@
debug(f'{params_kw=}')
dbname = get_module_dbname('accounting')
assert params_kw.providerid
assert params_kw.resellerid
db = DBPools()
async with db.sqlorContext(dbname) as sor:
await openRetailRelationshipAccounts(sor, '0', params_kw.providerid, params_kw.resellerid)
return f'{orgid} reseller accounts opened'
return f'{db.e_except=}'