Commit c16efab4 authored by 李宗熹's avatar 李宗熹

修改对账单空数据格式

parent f702cdd6
......@@ -103,6 +103,10 @@ def num2chinese(number):
return num2chinese_dict.get(number)
# def get_ifa_name(user):
class Statement(object):
def __init__(self, user_id, year, month):
self.user_id = user_id
......@@ -165,16 +169,16 @@ class Statement(object):
'total_amount': Decimal(round(float(total_amount) / 10000.0, 2)),
'detail': detail})
if len(ifa_cus_order_info) == 0:
trade_record_data = [{'customer': '',
'total_amount': '',
'detail': [{'fund': '',
'pay_date': '',
'confirm_share_date': '',
'confirm_amount': '',
'nav': '',
'confirm_share': '',
'note': ''}]}]
# if len(ifa_cus_order_info) == 0:
# trade_record_data = [{'customer': '',
# 'total_amount': '',
# 'detail': [{'fund': '',
# 'pay_date': '',
# 'confirm_share_date': '',
# 'confirm_amount': '',
# 'nav': '',
# 'confirm_share': '',
# 'note': ''}]}]
return trade_record_data
def month_remain(self):
......@@ -257,15 +261,15 @@ class Statement(object):
subscription_data['total_after_tax'] = total_after_tax
subscription_data['customer_detail'] = customer_detail
if len(ifa_cus_order_monthly) == 0:
subscription_data['customer_detail'] = [{'customer': '',
'before_tax': '',
'after_tax': '',
'detail': [{'fund': '',
'confirm_amount': '',
'pay_date': '',
'subscription_fee': '',
'tax': ''}]}]
# if len(ifa_cus_order_monthly) == 0:
# subscription_data['customer_detail'] = [{'customer': '',
# 'before_tax': '',
# 'after_tax': '',
# 'detail': [{'fund': '',
# 'confirm_amount': '',
# 'pay_date': '',
# 'subscription_fee': '',
# 'tax': ''}]}]
return subscription_data
def manage_fee(self):
......@@ -289,8 +293,8 @@ class Statement(object):
detail.append({
'hold_share': customer_fund_df['retention_shares'].values[i],
'date': customer_fund_df['predict_date'].values[i].strftime('%Y-%m-%d'),
'manage_fee': customer_fund_df['manage_fee'].values[i],
'tax': customer_fund_df['manage_fee'].values[i] * tax_rate
'manage_fee': customer_fund_df['manage_predict_fee'].values[i],
'tax': customer_fund_df['manage_predict_fee'].values[i] * tax_rate
})
before_tax += customer_fund_df['manage_fee'].values[i]
......@@ -309,21 +313,23 @@ class Statement(object):
manage_data['total_after_tax'] = total_after_tax
manage_data['customer_detail'] = customer_detail
if len(processed_provision) == 0:
manage_data['customer_detail'] = [{'customer': '',
'before_tax': '',
'after_tax': '',
'detail': [{'fund': '',
'confirm_amount': '',
'pay_date': '',
'manage_fee': '',
'tax': ''}]}]
# if len(processed_provision) == 0:
# manage_data['customer_detail'] = [{'customer': '',
# 'before_tax': '',
# 'after_tax': '',
# 'detail': [{'fund': '',
# 'confirm_amount': '',
# 'pay_date': '',
# 'manage_fee': '',
# 'tax': ''}]}]
return manage_data
def bill_month(self):
return str(self.year) + '年' + str(self.month) + '月'
def user_name(self):
# user_name = get_ifa_name(user)
return "王菲女士"
def summary(self):
......
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