Commit a54a6f84 by Aeolus

退款接口修改代理商收入字段

parent abb82ccf
...@@ -183,6 +183,7 @@ def rent_refund(): ...@@ -183,6 +183,7 @@ def rent_refund():
try: try:
rent.total = rent.total + total rent.total = rent.total + total
rent.real_total = rent.real_total + total rent.real_total = rent.real_total + total
rent.agent_total = rent.real_total + total
rent.is_over = 1 rent.is_over = 1
rent.over_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') rent.over_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
rent.back_money = rent.back_money + refund_money rent.back_money = rent.back_money + refund_money
...@@ -192,6 +193,7 @@ def rent_refund(): ...@@ -192,6 +193,7 @@ def rent_refund():
production.return_machine_id = production_info.Machine.id production.return_machine_id = production_info.Machine.id
production.return_time = back_time production.return_time = back_time
production.total = total production.total = total
production.agent_total = total
production.is_refund = 1 production.is_refund = 1
production.refund_no = refund_no production.refund_no = refund_no
if refund_type == '1': if refund_type == '1':
...@@ -412,6 +414,7 @@ def force_refund(): ...@@ -412,6 +414,7 @@ def force_refund():
try: try:
rent.total = rent.deposit - int(money) rent.total = rent.deposit - int(money)
rent.real_total = rent.deposit - int(money) rent.real_total = rent.deposit - int(money)
rent.agent_total = rent.deposit - int(money)
rent.is_over = 1 rent.is_over = 1
rent.over_time = back_time rent.over_time = back_time
rent.back_money += int(money) rent.back_money += int(money)
...@@ -420,6 +423,7 @@ def force_refund(): ...@@ -420,6 +423,7 @@ def force_refund():
production.return_machine_id = production.rent_machine_id production.return_machine_id = production.rent_machine_id
production.return_time = back_time production.return_time = back_time
production.total = rent.deposit - int(money) production.total = rent.deposit - int(money)
production.agent_total = rent.deposit - int(money)
production.is_refund = 1 production.is_refund = 1
production.refund_no = rent_refund_no production.refund_no = rent_refund_no
production.return_hatch_no = production.rent_hatch_no production.return_hatch_no = production.rent_hatch_no
...@@ -506,6 +510,7 @@ def rent_money_liuyuan(): ...@@ -506,6 +510,7 @@ def rent_money_liuyuan():
try: try:
rent_info.Rent.total -= int(money) rent_info.Rent.total -= int(money)
rent_info.Rent.real_total -= int(money) rent_info.Rent.real_total -= int(money)
rent_info.Rent.agent_total -= int(money)
rent_info.Rent.back_money += int(money) rent_info.Rent.back_money += int(money)
# rent_refund_log = RentRefund() # rent_refund_log = RentRefund()
...@@ -517,6 +522,7 @@ def rent_money_liuyuan(): ...@@ -517,6 +522,7 @@ def rent_money_liuyuan():
# rent_refund_log.updated_at = datetime.datetime.now() # rent_refund_log.updated_at = datetime.datetime.now()
rent_info.Production.total -= int(money) rent_info.Production.total -= int(money)
rent_info.Production.agent_total -= int(money)
# db.session.add(rent_refund_log) # db.session.add(rent_refund_log)
db.session.add(rent_info.Rent) 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