bugfix
This commit is contained in:
parent
96a21d0c01
commit
662a511648
@ -1,5 +1,6 @@
|
|||||||
from appPublic.log import debug, exception
|
from appPublic.log import debug, exception
|
||||||
from sqlor.dbpools import DBPools
|
from sqlor.dbpools import DBPools
|
||||||
|
from ahserver.serverenv import ServerEnv, get_serverenv
|
||||||
from .const import *
|
from .const import *
|
||||||
from accounting.accountingnode import get_parent_orgid
|
from accounting.accountingnode import get_parent_orgid
|
||||||
|
|
||||||
@ -77,19 +78,13 @@ where a.subjectid = b.id and
|
|||||||
async def getTransPayMode():
|
async def getTransPayMode():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def getParentOrganization(sor, childid):
|
|
||||||
sql="select a.* from organization a, organization b where b.parentid=a.id and b.id = ${childid}$"
|
|
||||||
ns = {
|
|
||||||
"childid":childid
|
|
||||||
}
|
|
||||||
recs = await sor.sqlExe(sql, ns)
|
|
||||||
if len(recs) == 0:
|
|
||||||
return None
|
|
||||||
return recs[0]
|
|
||||||
|
|
||||||
async def getCustomerBalance(sor, customerid):
|
async def getCustomerBalance(sor, customerid):
|
||||||
name = '业务账'
|
name = '客户资金账户'
|
||||||
orgid = await get_parent_orgid(sor, customerid)
|
get_owner_orgid = get_serverenv('get_owner_orgid')
|
||||||
|
if get_owner_orgid is None:
|
||||||
|
debug('get_owner_orgid function is not a serverenv function')
|
||||||
|
return None
|
||||||
|
orgid = await get_owner_orgid(sor, customerid)
|
||||||
if orgid is None:
|
if orgid is None:
|
||||||
print(f"{customerid=}'s parent organization not found")
|
print(f"{customerid=}'s parent organization not found")
|
||||||
return None
|
return None
|
||||||
|
@ -5,6 +5,7 @@ from ahserver.serverenv import ServerEnv
|
|||||||
from accounting.accounting_config import Accounting
|
from accounting.accounting_config import Accounting
|
||||||
from accounting.bill import write_bill
|
from accounting.bill import write_bill
|
||||||
from accounting.openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts
|
from accounting.openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts
|
||||||
|
from getaccount import getAccountBalance, getCustomerBalance
|
||||||
|
|
||||||
def load_accounting():
|
def load_accounting():
|
||||||
g = ServerEnv()
|
g = ServerEnv()
|
||||||
@ -14,3 +15,6 @@ def load_accounting():
|
|||||||
g.openProviderAccounts = openProviderAccounts
|
g.openProviderAccounts = openProviderAccounts
|
||||||
g.openResellerAccounts = openResellerAccounts
|
g.openResellerAccounts = openResellerAccounts
|
||||||
g.openCustomerAccounts = openCustomerAccounts
|
g.openCustomerAccounts = openCustomerAccounts
|
||||||
|
g.getAccountBalance = getAccountBalance
|
||||||
|
g.getCustomerBalance = getCustomerBalance
|
||||||
|
|
||||||
|
8
script/roleperm.sh
Executable file
8
script/roleperm.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
python ~/py/rbac/script/roleperm.py sage accounting owner superuser account_config accounting_config subject
|
||||||
|
python ~/py/rbac/script/roleperm.py sage accounting reseller operator account acc_detail acc_balance accounting_log bill bill_detail ledger
|
||||||
|
python ~/py/rbac/script/roleperm.py sage accounting reseller sale account acc_detail acc_balance accounting_log bill bill_detail ledger
|
||||||
|
python ~/py/rbac/script/roleperm.py sage accounting reseller accountant account acc_detail acc_balance accounting_log bill bill_detail ledger
|
||||||
|
python ~/py/rbac/script/roleperm.py sage accounting customer customer account acc_detail acc_balance accounting_log bill bill_detail ledger
|
||||||
|
|
Loading…
Reference in New Issue
Block a user