This commit is contained in:
yumoqing 2025-03-06 18:16:53 +08:00
parent 44b3d73974
commit f357210990

View File

@ -45,24 +45,18 @@ where a.subjectid = b.id """ \
debug(f'{r=}') debug(f'{r=}')
await openAccount(sor, accounting_orgid, orgid, r, org1id=org1id) await openAccount(sor, accounting_orgid, orgid, r, org1id=org1id)
async def _openPartyAccounts(accounting_orgid, orgid, party_type):
db = DBPools()
dbname = await rfexe('get_module_dbname', 'accounting')
async with db.sqlorContext(dbname) as sor:
await openPartyAccounts(sor, accounting_orgid, orgid, party_type)
async def openResellerAccounts(sor, accounting_orgid, orgid): async def openResellerAccounts(sor, accounting_orgid, orgid):
return await _openPartyAccounts(accounting_orgid, orgid, PARTY_RESELLER) return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_RESELLER)
async def openCustomerAccounts(sor, accounting_orgid, orgid): async def openCustomerAccounts(sor, accounting_orgid, orgid):
return await _openPartyAccounts(accounting_orgid, orgid, PARTY_CUSTOMER) return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_CUSTOMER)
async def openOwnerAccounts(sor, accounting_orgid): async def openOwnerAccounts(sor, accounting_orgid):
orgid = accounting_orgid orgid = accounting_orgid
return await _openPartyAccounts(accounting_orgid, orgid, PARTY_OWNER) return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_OWNER)
async def openProviderAccounts(sor, accounting_orgid, orgid): async def openProviderAccounts(sor, accounting_orgid, orgid):
return await _openPartyAccounts(accounting_orgid, orgid, PARTY_PROVIDER) return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_PROVIDER)
async def openAllCustomerAccounts(sor, accounting_orgid): async def openAllCustomerAccounts(sor, accounting_orgid):
rf = RegisterFunction() rf = RegisterFunction()