✨ 应收账单计费重优先取 charge_weight,空值回退 weight

This commit is contained in:
caojia
2026-11-17 11:24:23 +08:00
parent 8ede0bb5ec
commit 33e8a5890a
@@ -104,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from prc_order_bill p
</sql>
<!-- 应收生成专用来源快照:income_total 只汇总当前仍未出账的费用。 -->
<!-- 应收生成专用来源快照:计费重优先取 charge_weight,空值回退 weight;income_total 只汇总未出账费用。 -->
<sql id="selectArBillSourceVo">
select p.bill_id, p.bill_key, p.order_no, p.tracking_no, p.transfer_no,
p.belong_saler, p.belong_saler_code, p.settlement_man, p.settlement_man_code, p.service_man, p.service_man_code,
@@ -114,7 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.product_code, p.product_name, p.country_code, p.country_name, p.weight, p.biz_date, p.tms_id,
p.product_floor_code, p.product_floor, p.price_set_id, p.price_set_code, p.price_set_name,
p.set_type, p.bind_priority, p.customer_priceset_id, p.psv_id, p.psd_id,
p.weight_min, p.weight_max, p.weight_label, p.effective_date, p.charge_weight,
p.weight_min, p.weight_max, p.weight_label, p.effective_date,
coalesce(p.charge_weight, p.weight) as charge_weight,
p.freight_rate, p.base_freight_rate, p.discount_percent, p.registration_fee,
p.freight_amount, p.surcharge_amount,
(select coalesce(sum(f.amount), 0)