Commit fa88a9b2 by Aeolus

退款接口修改代理商收入

parent bcd8e6e5
......@@ -306,8 +306,10 @@ def rent_money_refund():
rent_total = rent_info.Rent.total - rent_info.Production.total
rent_real_total = rent_info.Rent.real_total - real_single_refund
rent_agent_total = rent_info.Rent.agent_total - real_single_refund
rent_info.Rent.total = rent_total if rent_total > 0 else 0
rent_info.Rent.real_total = rent_real_total if rent_real_total > 0 else 0
rent_info.Rent.agent_total = rent_agent_total if rent_agent_total > 0 else 0
data = {
"out_refund_no": rent_refund_no,
......@@ -327,6 +329,7 @@ def rent_money_refund():
rent_refund.updated_at = datetime.datetime.now()
rent_info.Production.total = 0
rent_info.Production.agent_total = 0
db.session.add(rent_refund)
db.session.add(rent_info.Rent)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment