diff --git a/accounting/openaccount.py b/accounting/openaccount.py index f131fe6..3c0efcb 100644 --- a/accounting/openaccount.py +++ b/accounting/openaccount.py @@ -45,24 +45,18 @@ where a.subjectid = b.id """ \ debug(f'{r=}') 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): - return await _openPartyAccounts(accounting_orgid, orgid, PARTY_RESELLER) + return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_RESELLER) 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): 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): - return await _openPartyAccounts(accounting_orgid, orgid, PARTY_PROVIDER) + return await openPartyAccounts(sor, accounting_orgid, orgid, PARTY_PROVIDER) async def openAllCustomerAccounts(sor, accounting_orgid): rf = RegisterFunction()