Commit ca3eefad by 马丽华

Merge branch 'mlh_jzjx_project' into 'master'

玖姿空值转换

See merge request !30
parents c7b10f38 ff93a123
......@@ -41,6 +41,12 @@ class ProductIncomeExpenseIframe(http.Controller):
latest_record = model.search([], order="business_date desc,create_date desc", limit=1)
if latest_record:
data = data_list[0]
expenditure = data.get("expenditure")
if expenditure in ['', None, False]:
data.update({"expenditure": 0})
income = data.get("income")
if income in ['', None, False]:
data.update({"income": 0})
balance = round(latest_record.balance + float(data.get("income")) - float(data.get("expenditure")), 2)
else:
# 如果没有找到任何记录
......
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