Compare commits

..

No commits in common. "76acdb6a3b9701e9de07583ee5662e18af9936bf" and "45ea640ca129dd24f8b0018c6065a6955af661a3" have entirely different histories.

5 changed files with 9 additions and 21 deletions

View File

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

View File

@ -1,8 +1,7 @@
debug(f'{params_kw=}') debug(f'{params_kw=}')
dbname = get_module_dbname('accounting') dbname = get_module_dbname('accounting')
orgid = await get_userorgid()
db = DBPools() db = DBPools()
async with db.sqlorContext(dbname) as sor: async with db.sqlorContext(dbname) as sor:
await openCustomerAccounts(sor, '0', orgid) await openCustomerAccounts(sor, '0', params_kw.orgid)
return f'{orgid} customer accounts opened' return f'{params_kw.orgid} accounts opened')
return f'{db.e_except=}' return f'{db.e_except=}

View File

@ -3,5 +3,5 @@ dbname = get_module_dbname('accounting')
db = DBPools() db = DBPools()
async with db.sqlorContext(dbname) as sor: async with db.sqlorContext(dbname) as sor:
await openOwnerAccounts(sor, '0') await openOwnerAccounts(sor, '0')
return f'0 accounts opened' return f'0 accounts opened')
return f'{db.e_except=}' return f'{db.e_except=}

View File

@ -1,8 +1,7 @@
debug(f'{params_kw=}') debug(f'{params_kw=}')
dbname = get_module_dbname('accounting') dbname = get_module_dbname('accounting')
orgid = await get_userorgid()
db = DBPools() db = DBPools()
async with db.sqlorContext(dbname) as sor: async with db.sqlorContext(dbname) as sor:
await openResellerAccounts(sor, '0', orgid) await openResellerAccounts(sor, '0', params_kw.orgid)
return f'{orgid} reseller accounts opened' return f'{params_kw.orgid} accounts opened')
return f'{db.e_except=}' return f'{db.e_except=}

View File

@ -1,9 +0,0 @@
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=}'