bugfix
This commit is contained in:
parent
ab77c6905b
commit
44758bf2b1
@ -7,10 +7,12 @@ from accounting.bill import write_bill
|
|||||||
from accounting.openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts
|
from accounting.openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts
|
||||||
from accounting.getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount
|
from accounting.getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount
|
||||||
from accounting.bizaccount import BizAccounting
|
from accounting.bizaccount import BizAccounting
|
||||||
|
from accounting.recharge import RechargeAccounting, recharge_accounting
|
||||||
|
|
||||||
def load_accounting():
|
def load_accounting():
|
||||||
g = ServerEnv()
|
g = ServerEnv()
|
||||||
g.Accounting = Accounting
|
g.Accounting = Accounting
|
||||||
|
g.RechargeAccounting = RechargeAccounting
|
||||||
g.write_bill = write_bill
|
g.write_bill = write_bill
|
||||||
g.openOwnerAccounts = openOwnerAccounts
|
g.openOwnerAccounts = openOwnerAccounts
|
||||||
g.openProviderAccounts = openProviderAccounts
|
g.openProviderAccounts = openProviderAccounts
|
||||||
@ -21,3 +23,4 @@ def load_accounting():
|
|||||||
g.getAccountByName = getAccountByName
|
g.getAccountByName = getAccountByName
|
||||||
g.get_account_total_amount = get_account_total_amount
|
g.get_account_total_amount = get_account_total_amount
|
||||||
g.BizAccounting = BizAccounting
|
g.BizAccounting = BizAccounting
|
||||||
|
g.recharge_accounting = recharge_accounting
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from appPublic.uniqueID import getID
|
from appPublic.uniqueID import getID
|
||||||
|
from appPublic.log import debug, exception
|
||||||
from sqlor.dbpools import DBPools
|
from sqlor.dbpools import DBPools
|
||||||
from appPublic.timeUtils import curDateString
|
from appPublic.timeUtils import curDateString
|
||||||
from appPublic.argsConvert import ArgsConvert
|
from appPublic.argsConvert import ArgsConvert
|
||||||
@ -33,7 +34,7 @@ class RechargeAccounting:
|
|||||||
'id':self.billid,
|
'id':self.billid,
|
||||||
'customerid':self.recharge_log['customerid'],
|
'customerid':self.recharge_log['customerid'],
|
||||||
'resellerid':None,
|
'resellerid':None,
|
||||||
'orderid':None,
|
'orderid':recharge_log['orderid'],
|
||||||
'business_op':self.recharge_log['action'],
|
'business_op':self.recharge_log['action'],
|
||||||
'amount':self.recharge_log['recharge_amt'],
|
'amount':self.recharge_log['recharge_amt'],
|
||||||
'bill_date':self.curdate,
|
'bill_date':self.curdate,
|
||||||
@ -63,15 +64,21 @@ 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, orderid, transdate, recharge_amt):
|
async def recharge_accounting(sor, customerid, action, orderid,
|
||||||
|
transdate, recharge_amt, recharge_fee):
|
||||||
"""
|
"""
|
||||||
summary:recharge channe(handly, wechat, alipay)
|
summary:recharge channe(handly, wechat, alipay)
|
||||||
"""
|
"""
|
||||||
|
if action not in ['RECHARGE', 'RECHARGE_REVESE']:
|
||||||
|
e = Exception(f'get a wrong recharge action({action})'
|
||||||
|
exception(f'{e}')
|
||||||
|
raise e
|
||||||
recharge_log = {
|
recharge_log = {
|
||||||
"customerid":customerid,
|
"customerid":customerid,
|
||||||
"transdate":transdate,
|
"transdate":transdate,
|
||||||
"orderid":orderid,
|
"orderid":orderid,
|
||||||
"recharge_amt":recharge_amt,
|
"recharge_amt":recharge_amt,
|
||||||
|
"recharge_fee": recharge_fee,
|
||||||
"action":action,
|
"action":action,
|
||||||
}
|
}
|
||||||
ra = RechargeAccounting(recharge_log)
|
ra = RechargeAccounting(recharge_log)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user