Compare commits
No commits in common. "b91ff0e1efa031e2e9b17f3937ff73280bd91f59" and "40595979c68daee18398286f76d9a920c55428a4" have entirely different histories.
b91ff0e1ef
...
40595979c6
@ -2,7 +2,7 @@ from sqlor.dbpools import DBPools
|
|||||||
from .const import *
|
from .const import *
|
||||||
from accounting.accountingnode import get_parent_orgid
|
from accounting.accountingnode import get_parent_orgid
|
||||||
|
|
||||||
async def getAccountByName(sor, accounting_orgid, orgid, name, org1id):
|
async def getAccountByName(sor, accounting_orgid, orgid, name):
|
||||||
sql = """select a.* from account a, subject b
|
sql = """select a.* from account a, subject b
|
||||||
where a.subjectid = b.id and
|
where a.subjectid = b.id and
|
||||||
a.accounting_orgid = ${accounting_orgid}$ and
|
a.accounting_orgid = ${accounting_orgid}$ and
|
||||||
@ -15,10 +15,7 @@ where a.subjectid = b.id and
|
|||||||
});
|
});
|
||||||
if len(recs) == 0:
|
if len(recs) == 0:
|
||||||
return None
|
return None
|
||||||
for rec in recs:
|
return recs[0]['id']
|
||||||
if a.org1id == org1id:
|
|
||||||
return rec['id']
|
|
||||||
return None
|
|
||||||
|
|
||||||
async def getTransPayMode():
|
async def getTransPayMode():
|
||||||
pass
|
pass
|
||||||
@ -46,10 +43,10 @@ async def getCustomerBalance(sor, customerid):
|
|||||||
return None
|
return None
|
||||||
return balance
|
return balance
|
||||||
|
|
||||||
async def getAccountBalance(sor, accounting_orgid, orgid, subjectname, org1id):
|
async def getAccountBalance(sor, accounting_orgid, orgid, subjectname):
|
||||||
accid = await getAccountByName(sor, accounting_orgid,
|
accid = await getAccountByName(sor, accounting_orgid,
|
||||||
orgid,
|
orgid,
|
||||||
subjectname,org1id)
|
subjectname)
|
||||||
if accid is None:
|
if accid is None:
|
||||||
print(f'accid is None, {accounting_orgid=}, {orgid=}, {subjectname=}')
|
print(f'accid is None, {accounting_orgid=}, {orgid=}, {subjectname=}')
|
||||||
return None
|
return None
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
from ahserver.serverenv import ServerEnv
|
|
||||||
from accounting.openaccount import openAllResellerAccounts
|
|
||||||
from accounting.openaccount import openAllCustomerAccounts
|
|
||||||
from accounting.openaccount import openAllProviderAccounts
|
|
||||||
from accounting.openaccount import openRetailRelationshipAccounts
|
|
||||||
from accounting.openaccount import openOwnerAccounts
|
|
||||||
from accounting.recharge import recharge_accounting
|
|
||||||
from accounting.getaccount import getAccountBalance, getCustomerBalance
|
|
||||||
|
|
||||||
def load_accounting():
|
|
||||||
g = ServerEnv()
|
|
||||||
g.openAllResellerAccounts = openAllResellerAccounts
|
|
||||||
g.openAllCustomerAccounts = openAllCustomerAccounts
|
|
||||||
g.openAllProviderAccounts = openAllProviderAccounts
|
|
||||||
g.openRetailRelationshipAccounts = openRetailRelationshipAccounts
|
|
||||||
g.openOwnerAccounts = openOwnerAccounts
|
|
||||||
g.recharge_accounting = recharge_accounting
|
|
@ -16,7 +16,6 @@ class RechargeAccounting:
|
|||||||
self.db = DBPools()
|
self.db = DBPools()
|
||||||
self.recharge_log = recharge_log
|
self.recharge_log = recharge_log
|
||||||
self.customerid = recharge_log['customerid']
|
self.customerid = recharge_log['customerid']
|
||||||
self.summary = recharge_log['summary']
|
|
||||||
self.orderid = None
|
self.orderid = None
|
||||||
self.curdate = recharge_log['recharge_date']
|
self.curdate = recharge_log['recharge_date']
|
||||||
self.transamount = recharge_log['recharge_amt']
|
self.transamount = recharge_log['recharge_amt']
|
||||||
@ -63,25 +62,3 @@ class RechargeAccounting:
|
|||||||
await sor.C('bill', self.bill.copy())
|
await sor.C('bill', self.bill.copy())
|
||||||
# await sor.C('recharge_log', self.recharge_log.copy())
|
# await sor.C('recharge_log', self.recharge_log.copy())
|
||||||
|
|
||||||
async def recharge_accounting(sor, customerid, action, logid, trnasdate, recharge_amt):
|
|
||||||
"""
|
|
||||||
summary:recharge channe(handly, wechat, alipay)
|
|
||||||
"""
|
|
||||||
recharge_log = {
|
|
||||||
"customerid":customerid,
|
|
||||||
"recharge_date":transdate,
|
|
||||||
"recharge_logid":logid,
|
|
||||||
"recharge_amt":recharge_amt,
|
|
||||||
"action":action,
|
|
||||||
}
|
|
||||||
ra = RechargeAccounting(recharge_log)
|
|
||||||
if sor:
|
|
||||||
r = await ra.accounting(sor)
|
|
||||||
return True
|
|
||||||
|
|
||||||
db = DBPools()
|
|
||||||
dbname = await rfrun('get_module_dbname', 'accounting')
|
|
||||||
async with db.sqlorContext(dbname) as sor:
|
|
||||||
r = await ra.accounting(sor)
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
29
app/acc.py
29
app/acc.py
@ -1,29 +0,0 @@
|
|||||||
import json
|
|
||||||
import os
|
|
||||||
from time import time
|
|
||||||
|
|
||||||
from appPublic.worker import awaitify
|
|
||||||
from appPublic.jsonConfig import getConfig
|
|
||||||
from ahserver.serverenv import ServerEnv
|
|
||||||
from appPublic.registerfunction import RegisterFunction
|
|
||||||
from ahserver.webapp import webapp
|
|
||||||
from accounting.openaccount import openAllResellerAccounts
|
|
||||||
from accounting.openaccount import openAllCustomerAccounts
|
|
||||||
from accounting.openaccount import openAllProviderAccounts
|
|
||||||
from accounting.openaccount import openRetailRelationshipAccounts
|
|
||||||
from accounting.openaccount import openOwnerAccounts
|
|
||||||
from accounting.recharge import recharge_accounting
|
|
||||||
from accounting.getaccount import getAccountBalance, getCustomerBalance
|
|
||||||
from accounting.init import load_accounting
|
|
||||||
|
|
||||||
def get_db(module=''):
|
|
||||||
return 'test'
|
|
||||||
|
|
||||||
def init_func():
|
|
||||||
rf = RegisterFunction()
|
|
||||||
rf.register('get_module_dbname', get_db)
|
|
||||||
load_accounting()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
webapp(init_func)
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype":"VBox",
|
|
||||||
"options":{
|
|
||||||
"height":"100%"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
debug(f'{params_kw=}')
|
|
||||||
return {
|
|
||||||
'status':'ok',
|
|
||||||
'message':'is ok'
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
debug(f'{params_kw=}')
|
|
||||||
return {
|
|
||||||
'status':'ok',
|
|
||||||
'message':'is ok'
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype":"Form",
|
|
||||||
"options":{
|
|
||||||
"fields":[
|
|
||||||
{
|
|
||||||
"name":"recharge_amt",
|
|
||||||
"uitype":"float",
|
|
||||||
"required":true,
|
|
||||||
"label":"充值金额"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name":"channel",
|
|
||||||
"label":"选择充值方式",
|
|
||||||
"uitype":"checkbox",
|
|
||||||
"multicheck":false,
|
|
||||||
"required":true,
|
|
||||||
"value":"alipay",
|
|
||||||
"data":[
|
|
||||||
{
|
|
||||||
"value":"alipay",
|
|
||||||
"text":"支付宝"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value":"wechatpay",
|
|
||||||
"text":"微信支付"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype":"VBox",
|
|
||||||
"options":{
|
|
||||||
"height":"100%"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user