kboss/b/test/accounting.dspy
2025-07-16 14:27:17 +08:00

14 lines
449 B
Plaintext
Executable File

db = DBPools()
orderid = params_kw.get('orderid', 'JsNa3vy6u4XdeBCVq7nfD')
async with db.sqlorContext('kboss') as sor:
await order2bill(orderid, sor)
bills = await sor.sqlExe("select * from bill where orderid=${orderid}$", {'orderid':orderid})
if len(bills) == 0:
print('bill not found')
return Error(555, msg='bill not found')
print('accounting ..............')
for b in bills:
ba = BillAccounting(b)
ret = await ba.accounting(sor)