Compare commits
No commits in common. "5bf21ac024f470a4780c1025c244d01693a431ec" and "202fe6b5783d5e32474e5d5dad05f624a8cf0204" have entirely different histories.
5bf21ac024
...
202fe6b578
@ -7,7 +7,6 @@ from .accounting_config import Accounting
|
|||||||
from .bill import write_bill
|
from .bill import write_bill
|
||||||
from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts, openRetailRelationshipAccounts
|
from .openaccount import openOwnerAccounts, openProviderAccounts, openResellerAccounts, openCustomerAccounts, openRetailRelationshipAccounts
|
||||||
from .getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount
|
from .getaccount import getAccountBalance, getCustomerBalance, getAccountByName, get_account_total_amount
|
||||||
from .stats import get_accounting_stats
|
|
||||||
from .recharge import RechargeBiz, recharge_accounting
|
from .recharge import RechargeBiz, recharge_accounting
|
||||||
from .consume import consume_accounting
|
from .consume import consume_accounting
|
||||||
|
|
||||||
@ -72,4 +71,3 @@ def load_accounting():
|
|||||||
g.get_accdetail = get_accdetail
|
g.get_accdetail = get_accdetail
|
||||||
g.all_my_accounts = all_my_accounts
|
g.all_my_accounts = all_my_accounts
|
||||||
g.openRetailRelationshipAccounts = openRetailRelationshipAccounts
|
g.openRetailRelationshipAccounts = openRetailRelationshipAccounts
|
||||||
g.get_accounting_stats = get_accounting_stats
|
|
||||||
|
|||||||
@ -1,77 +0,0 @@
|
|||||||
from appPublic.log import debug, exception
|
|
||||||
from sqlor.dbpools import get_sor_context
|
|
||||||
from datetime import datetime, timedelta
|
|
||||||
|
|
||||||
async def get_accounting_stats(request):
|
|
||||||
"""Get accounting statistics for the current user's organization"""
|
|
||||||
env = request._run_ns
|
|
||||||
userorgid = await env.get_userorgid()
|
|
||||||
|
|
||||||
now = datetime.now()
|
|
||||||
today_start = now.strftime('%Y-%m-%d')
|
|
||||||
month_start = now.strftime('%Y-%m-01')
|
|
||||||
tomorrow = (now + timedelta(days=1)).strftime('%Y-%m-%d')
|
|
||||||
|
|
||||||
stats = {
|
|
||||||
'total_balance': 0,
|
|
||||||
'today_amount': 0,
|
|
||||||
'month_amount': 0,
|
|
||||||
'account_count': 0
|
|
||||||
}
|
|
||||||
|
|
||||||
async with get_sor_context(request._run_ns, 'accounting') as sor:
|
|
||||||
# Total balance across all accounts
|
|
||||||
sql_balance = """
|
|
||||||
SELECT COALESCE(SUM(CASE WHEN balance_at = '1' THEN balance ELSE -balance END), 0) as total
|
|
||||||
FROM account
|
|
||||||
WHERE orgid = ${orgid}$
|
|
||||||
"""
|
|
||||||
recs = await sor.sqlExe(sql_balance, {'orgid': userorgid})
|
|
||||||
if recs:
|
|
||||||
stats['total_balance'] = float(recs[0].total or 0)
|
|
||||||
|
|
||||||
# Account count
|
|
||||||
sql_count = """
|
|
||||||
SELECT COUNT(*) as cnt FROM account WHERE orgid = ${orgid}$
|
|
||||||
"""
|
|
||||||
recs = await sor.sqlExe(sql_count, {'orgid': userorgid})
|
|
||||||
if recs:
|
|
||||||
stats['account_count'] = int(recs[0].cnt or 0)
|
|
||||||
|
|
||||||
# Today's consumption (acc_dir=1 means debit/consumption)
|
|
||||||
sql_today = """
|
|
||||||
SELECT COALESCE(SUM(amount), 0) as total
|
|
||||||
FROM acc_detail a
|
|
||||||
JOIN account b ON a.accountid = b.id
|
|
||||||
WHERE b.orgid = ${orgid}$
|
|
||||||
AND a.acc_dir = 1
|
|
||||||
AND a.acc_date >= ${from_date}$
|
|
||||||
AND a.acc_date < ${to_date}$
|
|
||||||
"""
|
|
||||||
recs = await sor.sqlExe(sql_today, {
|
|
||||||
'orgid': userorgid,
|
|
||||||
'from_date': today_start,
|
|
||||||
'to_date': tomorrow
|
|
||||||
})
|
|
||||||
if recs:
|
|
||||||
stats['today_amount'] = float(recs[0].total or 0)
|
|
||||||
|
|
||||||
# This month's consumption
|
|
||||||
sql_month = """
|
|
||||||
SELECT COALESCE(SUM(amount), 0) as total
|
|
||||||
FROM acc_detail a
|
|
||||||
JOIN account b ON a.accountid = b.id
|
|
||||||
WHERE b.orgid = ${orgid}$
|
|
||||||
AND a.acc_dir = 1
|
|
||||||
AND a.acc_date >= ${from_date}$
|
|
||||||
AND a.acc_date < ${to_date}$
|
|
||||||
"""
|
|
||||||
recs = await sor.sqlExe(sql_month, {
|
|
||||||
'orgid': userorgid,
|
|
||||||
'from_date': month_start,
|
|
||||||
'to_date': tomorrow
|
|
||||||
})
|
|
||||||
if recs:
|
|
||||||
stats['month_amount'] = float(recs[0].total or 0)
|
|
||||||
|
|
||||||
return stats
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "acc_balance",
|
|
||||||
"title": "账户余额表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accountid",
|
|
||||||
"title": "账户id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_date",
|
|
||||||
"title": "记账日期",
|
|
||||||
"type": "date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "balance",
|
|
||||||
"title": "账户余额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 20
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "acc_detail",
|
|
||||||
"title": "账户明细表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accountid",
|
|
||||||
"title": "账户id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_no",
|
|
||||||
"title": "明细顺序号",
|
|
||||||
"type": "short"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_date",
|
|
||||||
"title": "记账日期",
|
|
||||||
"type": "date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_timestamp",
|
|
||||||
"title": "记账时间戳",
|
|
||||||
"type": "timestamp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_dir",
|
|
||||||
"title": "记账方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "summary",
|
|
||||||
"title": "摘要",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "amount",
|
|
||||||
"title": "记账金额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "balance",
|
|
||||||
"title": "账户余额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acclogid",
|
|
||||||
"title": "账务流水id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "account",
|
|
||||||
"title": "机构账户表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_orgid",
|
|
||||||
"title": "账本机构",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "orgid",
|
|
||||||
"title": "主机构id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "org1id",
|
|
||||||
"title": "从机构id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjectid",
|
|
||||||
"title": "科目号",
|
|
||||||
"type": "str",
|
|
||||||
"length": 21
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "balance_at",
|
|
||||||
"title": "余额方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "max_detailno",
|
|
||||||
"title": "最大明细顺序号",
|
|
||||||
"type": "short"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "balance",
|
|
||||||
"title": "余额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 20
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"indexes": [
|
|
||||||
{
|
|
||||||
"name": "idx1",
|
|
||||||
"idxtype": "unique",
|
|
||||||
"idxfields": [
|
|
||||||
"accounting_orgid",
|
|
||||||
"orgid",
|
|
||||||
"subjectid",
|
|
||||||
"org1id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"codes": [
|
|
||||||
{
|
|
||||||
"field": "subjectid",
|
|
||||||
"table": "subject",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "orgid",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "balance_at",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='accounting_dir'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "org1id",
|
|
||||||
"table": "organization",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "orgname"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "account_config",
|
|
||||||
"title": "账户配置表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjectid",
|
|
||||||
"title": "科目id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "partytype",
|
|
||||||
"title": "主参与方类型",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255,
|
|
||||||
"nullable": "no"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "party1type",
|
|
||||||
"title": "从参与方类型",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255,
|
|
||||||
"nullable": "yes"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"codes": [
|
|
||||||
{
|
|
||||||
"field": "party1type",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='partytype'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "subjectid",
|
|
||||||
"table": "subject",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "partytype",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='partytype'"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,98 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "accounting_config",
|
|
||||||
"title": "记账配置表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "action",
|
|
||||||
"title": "交易",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_orgtype",
|
|
||||||
"title": "账务机构",
|
|
||||||
"type": "str",
|
|
||||||
"length": 256
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_dir",
|
|
||||||
"title": "记账方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "orgtype",
|
|
||||||
"title": "机构类型",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "org1type",
|
|
||||||
"title": "从机构类型",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32,
|
|
||||||
"nullable": "yes"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjectid",
|
|
||||||
"title": "科目id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 21
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "amt_pattern",
|
|
||||||
"title": "金额模板",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"codes": [
|
|
||||||
{
|
|
||||||
"field": "accounting_orgtype",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='partytype'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "accounting_dir",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='accounting_dir'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "orgtype",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='partytype'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "org1type",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='partytype'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "subjectid",
|
|
||||||
"table": "subject",
|
|
||||||
"valuefield": "id",
|
|
||||||
"textfield": "name"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "accounting_log",
|
|
||||||
"title": "账务流水表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accountid",
|
|
||||||
"title": "账户id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_date",
|
|
||||||
"title": "记账日期",
|
|
||||||
"type": "date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_timestamp",
|
|
||||||
"title": "记账时间戳",
|
|
||||||
"type": "timestamp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_dir",
|
|
||||||
"title": "记账方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "summary",
|
|
||||||
"title": "摘要",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "amount",
|
|
||||||
"title": "记账金额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "billid",
|
|
||||||
"title": "账单id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"codes": [
|
|
||||||
{
|
|
||||||
"field": "acc_dir",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='accounting_dir'"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "bill",
|
|
||||||
"title": "账单",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "customerid",
|
|
||||||
"title": "客户编号",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "resellerid",
|
|
||||||
"title": "商户id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "productid",
|
|
||||||
"title": "产品id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "resourceid",
|
|
||||||
"title": "资源id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "orderid",
|
|
||||||
"title": "订单编号",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "business_op",
|
|
||||||
"title": "业务操作",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "amount",
|
|
||||||
"title": "金额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bill_date",
|
|
||||||
"title": "账单日期",
|
|
||||||
"type": "date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bill_timestamp",
|
|
||||||
"title": "账单时间戳",
|
|
||||||
"type": "timestamp"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "bill_state",
|
|
||||||
"title": "账单状态",
|
|
||||||
"type": "str",
|
|
||||||
"length": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "bill_detail",
|
|
||||||
"title": "账单明细",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_orgid",
|
|
||||||
"title": "账务机构id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "billid",
|
|
||||||
"title": "账单ID",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "description",
|
|
||||||
"title": "账务说明",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "participantid",
|
|
||||||
"title": "记账方id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "participanttype",
|
|
||||||
"title": "记账方类型",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjectname",
|
|
||||||
"title": "科目名称",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_dir",
|
|
||||||
"title": "记账方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "amount",
|
|
||||||
"title": "账单金额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "ledger",
|
|
||||||
"title": "总账表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "accounting_orgid",
|
|
||||||
"title": "账本机构",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjectid",
|
|
||||||
"title": "科目号",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "acc_date",
|
|
||||||
"title": "账务日期",
|
|
||||||
"type": "date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "d_balance",
|
|
||||||
"title": "借方余额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "c_balance",
|
|
||||||
"title": "贷方余额",
|
|
||||||
"type": "float",
|
|
||||||
"length": 18
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
{
|
|
||||||
"summary": [
|
|
||||||
{
|
|
||||||
"name": "subject",
|
|
||||||
"title": "科目表",
|
|
||||||
"primary": [
|
|
||||||
"id"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"name": "id",
|
|
||||||
"title": "id",
|
|
||||||
"type": "str",
|
|
||||||
"length": 32
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"title": "科目名称",
|
|
||||||
"type": "str",
|
|
||||||
"length": 255
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "balance_side",
|
|
||||||
"title": "余额方向",
|
|
||||||
"type": "str",
|
|
||||||
"length": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subjecttype",
|
|
||||||
"title": "科目类别",
|
|
||||||
"type": "str",
|
|
||||||
"length": 30
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"codes": [
|
|
||||||
{
|
|
||||||
"field": "balance_side",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='balance_side'"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"field": "subjecttype",
|
|
||||||
"table": "appcodes_kv",
|
|
||||||
"valuefield": "k",
|
|
||||||
"textfield": "v",
|
|
||||||
"cond": "parentid='subjecttype'"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
192
wwwroot/index.ui
192
wwwroot/index.ui
@ -1,192 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%",
|
|
||||||
"padding": "0",
|
|
||||||
"bgcolor": "#0B1120"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "HBox",
|
|
||||||
"options": {
|
|
||||||
"width": "100%",
|
|
||||||
"alignItems": "center",
|
|
||||||
"marginBottom": "24px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Title2",
|
|
||||||
"options": {
|
|
||||||
"text": "计费管理",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"fontWeight": "700"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Filler"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "账户管理、账单明细与计费配置",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#64748B"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "ResponsableBox",
|
|
||||||
"options": {
|
|
||||||
"gap": "16px",
|
|
||||||
"minWidth": "200px",
|
|
||||||
"marginBottom": "24px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "urlwidget",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('/accounting/stat_total_balance.ui')}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "urlwidget",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('/accounting/stat_today_consumption.ui')}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "urlwidget",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('/accounting/stat_month_consumption.ui')}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "urlwidget",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('/accounting/stat_account_count.ui')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "ResponsableBox",
|
|
||||||
"options": {
|
|
||||||
"gap": "16px",
|
|
||||||
"minWidth": "250px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "24px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"cursor": "pointer"
|
|
||||||
},
|
|
||||||
"binds": [
|
|
||||||
{
|
|
||||||
"wid": "self",
|
|
||||||
"event": "click",
|
|
||||||
"actiontype": "urlwidget",
|
|
||||||
"target": "app.accounting_content",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('myaccounts')}}"
|
|
||||||
},
|
|
||||||
"mode": "replace"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22C55E\" stroke-width=\"1.5\"><path d=\"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125H3.375a.75.75 0 01-.75-.75V4.5m0 0V3.75c0-.621.504-1.125 1.125-1.125h1.5c1.243 0 2.25 1.007 2.25 2.25v.375M3.75 4.5h15.75m0 0v-.375c0-.621-.504-1.125-1.125-1.125h-1.5c-1.243 0-2.25 1.007-2.25 2.25v.375M3.75 12.75h15.75M3.75 16.5h15.75\"/></svg>",
|
|
||||||
"width": "36px",
|
|
||||||
"height": "36px",
|
|
||||||
"marginBottom": "16px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Title4",
|
|
||||||
"options": {
|
|
||||||
"text": "我的账户",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"fontWeight": "600",
|
|
||||||
"marginBottom": "8px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "查看账户余额与充值记录",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "24px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"cursor": "pointer"
|
|
||||||
},
|
|
||||||
"binds": [
|
|
||||||
{
|
|
||||||
"wid": "self",
|
|
||||||
"event": "click",
|
|
||||||
"actiontype": "urlwidget",
|
|
||||||
"target": "app.accounting_content",
|
|
||||||
"options": {
|
|
||||||
"url": "{{entire_url('accdetail')}}"
|
|
||||||
},
|
|
||||||
"mode": "replace"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#3B82F6\" stroke-width=\"1.5\"><path d=\"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z\"/></svg>",
|
|
||||||
"width": "36px",
|
|
||||||
"height": "36px",
|
|
||||||
"marginBottom": "16px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Title4",
|
|
||||||
"options": {
|
|
||||||
"text": "账单明细",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"fontWeight": "600",
|
|
||||||
"marginBottom": "8px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "查看计费明细与消费流水",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"id": "accounting_content",
|
|
||||||
"css": "filler",
|
|
||||||
"options": {
|
|
||||||
"width": "100%",
|
|
||||||
"overflowY": "auto"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
{% set stats = get_accounting_stats(request) %}
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "20px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"flex": "1",
|
|
||||||
"minHeight": "110px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "HBox",
|
|
||||||
"options": {
|
|
||||||
"alignItems": "center",
|
|
||||||
"marginBottom": "12px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#3B82F6\" stroke-width=\"2\"><path d=\"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z\"/></svg>",
|
|
||||||
"width": "24px",
|
|
||||||
"height": "24px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Filler"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "{{stats.account_count}}",
|
|
||||||
"fontSize": "32px",
|
|
||||||
"fontWeight": "700",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"lineHeight": "1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "账户数量",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"marginTop": "4px"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
{% set stats = get_accounting_stats(request) %}
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "20px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"flex": "1",
|
|
||||||
"minHeight": "110px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "HBox",
|
|
||||||
"options": {
|
|
||||||
"alignItems": "center",
|
|
||||||
"marginBottom": "12px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#8B5CF6\" stroke-width=\"2\"><path d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5\"/></svg>",
|
|
||||||
"width": "24px",
|
|
||||||
"height": "24px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Filler"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "¥{{'%.2f' % stats.month_amount}}",
|
|
||||||
"fontSize": "32px",
|
|
||||||
"fontWeight": "700",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"lineHeight": "1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "本月消费",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"marginTop": "4px"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
{% set stats = get_accounting_stats(request) %}
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "20px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"flex": "1",
|
|
||||||
"minHeight": "110px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "HBox",
|
|
||||||
"options": {
|
|
||||||
"alignItems": "center",
|
|
||||||
"marginBottom": "12px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#F59E0B\" stroke-width=\"2\"><path d=\"M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z\"/></svg>",
|
|
||||||
"width": "24px",
|
|
||||||
"height": "24px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Filler"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "¥{{'%.2f' % stats.today_amount}}",
|
|
||||||
"fontSize": "32px",
|
|
||||||
"fontWeight": "700",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"lineHeight": "1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "今日消费",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"marginTop": "4px"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
{% set stats = get_accounting_stats(request) %}
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"options": {
|
|
||||||
"bgcolor": "#1E293B",
|
|
||||||
"padding": "20px",
|
|
||||||
"borderRadius": "12px",
|
|
||||||
"border": "1px solid #334155",
|
|
||||||
"flex": "1",
|
|
||||||
"minHeight": "110px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "HBox",
|
|
||||||
"options": {
|
|
||||||
"alignItems": "center",
|
|
||||||
"marginBottom": "12px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Svg",
|
|
||||||
"options": {
|
|
||||||
"svg": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#22C55E\" stroke-width=\"2\"><path d=\"M2.25 18.75a60.07 60.07 0 0115.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 013 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125H3.375a.75.75 0 01-.75-.75V4.5m0 0V3.75c0-.621.504-1.125 1.125-1.125h1.5c1.243 0 2.25 1.007 2.25 2.25v.375M3.75 4.5h15.75m0 0v-.375c0-.621-.504-1.125-1.125-1.125h-1.5c-1.243 0-2.25 1.007-2.25 2.25v.375M3.75 12.75h15.75M3.75 16.5h15.75\"/></svg>",
|
|
||||||
"width": "24px",
|
|
||||||
"height": "24px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Filler"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "¥{{'%.2f' % stats.total_balance}}",
|
|
||||||
"fontSize": "32px",
|
|
||||||
"fontWeight": "700",
|
|
||||||
"color": "#F1F5F9",
|
|
||||||
"lineHeight": "1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"widgettype": "Text",
|
|
||||||
"options": {
|
|
||||||
"text": "账户总余额",
|
|
||||||
"fontSize": "14px",
|
|
||||||
"color": "#94A3B8",
|
|
||||||
"marginTop": "4px"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user