From 567e451a3214fcf184d05e1203295629dd8290a5 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 9 Jan 2025 16:46:35 +0800 Subject: [PATCH] bugfix --- accounting/bill.py | 13 +++++++++++++ accounting/init.py | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/accounting/bill.py b/accounting/bill.py index 04f7878..150cb31 100644 --- a/accounting/bill.py +++ b/accounting/bill.py @@ -10,6 +10,19 @@ from .accounting_config import get_accounting_config, AccountingOrgs from .businessdate import get_business_date # from .settle import SettleAccounting +async def write_bill(sor, customerid, userid, orderid, business_op, amount): + bill = DictObject() + bill.customerid = customerid + bill.id = getID() + bill.userid = userid + bill.orderid = orderid + bill.business_op = business_op + bill.amount = amount + bill.bill_date = await get_business_date(sor) + bill_state = '0' + await sor.C('bill', bill.copy()) + return bill + class BillAccounting: def __init__(self, bill): self.curdate = bill['bill_date'] diff --git a/accounting/init.py b/accounting/init.py index f8aeddc..9ab0772 100644 --- a/accounting/init.py +++ b/accounting/init.py @@ -2,7 +2,8 @@ from appPublic.registerfunction import RegisterFunction from appPublic.dictOBject import DictObject from appPublic.log import debug, exception, error from ahserver.serverenv import ServerEnv -from accounting_config import AccountingOrgs +from accounting.accounting_config import AccountingOrgs +from accounting.bill import write_bill def load_accounting(): g = ServerEnv() @@ -14,4 +15,4 @@ def load_accounting(): g.open_provider_account = open_provider_account g.open_owner_account = open_owner_account g.get_customer_balance = get_customer_balance - + g.write_bill = write_bill