From 055463afc3757ed92f12d120c50c62348ed4354e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 27 Dec 2025 11:30:41 +0800 Subject: [PATCH] bugfix --- accounting/consume.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accounting/consume.py b/accounting/consume.py index 0c3af10..f722968 100644 --- a/accounting/consume.py +++ b/accounting/consume.py @@ -15,7 +15,6 @@ class ConsumeBiz(PFBiz): self.db = DBPools() self.action = od.action self.orderid = od['orderid'] - self.curdate = await get_business_date(sor) self.timestamp = timestampstr() self.action = od['action'] self.billid = getID() @@ -46,9 +45,12 @@ class ConsumeBiz(PFBiz): async def consume_accounting(sor, orderid, order_details): ods = [] billid = getID() + env = ServerEnv() + curdate = await env.get_business_date(sor) for od in order_details: od['billid'] = billid od['orderid'] = orderid + od['curdate'] = curdate ods.append(ConsumeBiz(od)) ao = Accounting(ods) bill = { @@ -58,7 +60,7 @@ async def consume_accounting(sor, orderid, order_details): 'orderid':self.orderid, 'business_op':self.action, 'amount':log['transamt'], - 'bill_date':self.curdate, + 'bill_date':curdate, 'bill_timestamp':self.timestamp } await sor.C('bill', bill.copy())