Commit 789b4c16 by zhouhaibao

feat(data-process): 更新门店分成计算逻辑支持岚图品牌特殊处理

- 添加岚图品牌判断逻辑,根据渗透率区间计算不同比例
- 实现渗透率低于30%时使用88%比例,30%-50%时使用85%比例,高于50%时使用80%比例
- 对门店产值乘以对应比例并四舍五入到分
- 保留原有普通品牌的系统流量费计算方式
- 修改注释说明岚图品牌的特殊计算规则
1 parent 35915b38
......@@ -219,8 +219,21 @@ class WarrantyProcessor:
product_cost = biz_data.get('product_cost', Decimal('0'))
market_fee = biz_data.get('market_fee', Decimal('0'))
service_fee = Decimal('0') if resident_type == '直营' else biz_data.get('service_fee', Decimal('0'))
# 门店分成 = 流量费累计 = shop_traffic_money(来自主汇总记录)
store_share = biz_data.get('shop_traffic_money', Decimal('0'))
# —— 门店分成:普通品牌取系统流量费 shop_traffic_money;岚图按渗透率区间算比例 * 门店产值 ——
# penetration_rate 范围 0-100(safe_div_pct 已 ×100)
is_lantu = '岚图' in (brand or '')
if is_lantu:
pr = float(penetration_rate)
if pr < 30:
lantu_ratio = Decimal('0.88')
elif pr < 50:
lantu_ratio = Decimal('0.85')
else:
lantu_ratio = Decimal('0.80')
store_share = (store_output_value * lantu_ratio).quantize(Decimal('0.01'), rounding=ROUND_HALF_UP)
else:
store_share = biz_data.get('shop_traffic_money', Decimal('0'))
guarantee_amount = Decimal('0')
gl_share = store_output_value - product_cost - store_share - guarantee_amount
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!