Commit cd516d11 by Aeolus

退款接口把寒山寺的agent_total按照80%的比例下调

25改为20,50改为40,75改为60
parent 9ac16817
...@@ -229,6 +229,11 @@ def rent_refund(): ...@@ -229,6 +229,11 @@ def rent_refund():
fee = RentService.check_fee(rent.pay_time.strftime('%Y-%m-%d %H:%M:%S'), str(back_time), rent.one_day_price, fee = RentService.check_fee(rent.pay_time.strftime('%Y-%m-%d %H:%M:%S'), str(back_time), rent.one_day_price,
rent.free_time, production_info.Machine.id, production_info.Machine.price_type) rent.free_time, production_info.Machine.id, production_info.Machine.price_type)
total = fee['total'] if fee['total'] < rent.deposit else rent.deposit total = fee['total'] if fee['total'] < rent.deposit else rent.deposit
# 寒山寺agent_total把25修改为20,80%的比例
if rent.spot_id == '48':
agent_total = total * 0.8
else:
agent_total = total
refund_money = rent.deposit - total refund_money = rent.deposit - total
...@@ -249,7 +254,7 @@ def rent_refund(): ...@@ -249,7 +254,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.agent_total + total rent.agent_total = rent.agent_total + agent_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
...@@ -259,7 +264,7 @@ def rent_refund(): ...@@ -259,7 +264,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.agent_total = agent_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':
...@@ -430,7 +435,13 @@ def rent_money_refund_new(): ...@@ -430,7 +435,13 @@ def rent_money_refund_new():
rent = rent_info.Rent rent = rent_info.Rent
production = rent_info.Production production = rent_info.Production
new_total = int(time_price[-1]) new_total = int(time_price[-1]) # 传入的收费标准参考["60分钟","75分钟",1500],["75分钟","1天",2500]
# 寒山寺agent_total把25修改为20,80%的比例
if rent.spot_id == '48':
new_agent_total = new_total * 0.8
else:
new_agent_total = new_total
if production.is_return: if production.is_return:
refund_money = production.total - new_total refund_money = production.total - new_total
else: else:
...@@ -447,7 +458,7 @@ def rent_money_refund_new(): ...@@ -447,7 +458,7 @@ def rent_money_refund_new():
if tmp.id == production.id: if tmp.id == production.id:
rent_total += new_total rent_total += new_total
rent_real_total += new_total rent_real_total += new_total
rent_agent_total += new_total rent_agent_total += new_agent_total
else: else:
rent_total += tmp.total if tmp.total is not None else 0 rent_total += tmp.total if tmp.total is not None else 0
rent_real_total += tmp.total if tmp.total is not None else 0 rent_real_total += tmp.total if tmp.total is not None else 0
...@@ -478,7 +489,7 @@ def rent_money_refund_new(): ...@@ -478,7 +489,7 @@ def rent_money_refund_new():
rent.is_over = 1 rent.is_over = 1
production.total = new_total production.total = new_total
production.agent_total = new_total production.agent_total = new_agent_total
if not production.is_return: if not production.is_return:
production.is_return = 1 production.is_return = 1
production.return_time = datetime.datetime.now() production.return_time = datetime.datetime.now()
......
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