✨ 限制应收账单仅拉取指定上游订单状态
This commit is contained in:
@@ -616,8 +616,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<!-- 仅指定上游订单状态可参与应收账单生成,预览、合计与实际生成共用。 -->
|
||||||
|
<sql id="arBillSourceOrderStatusCondition">
|
||||||
|
and p.order_status in (3, 4, 5, 6, 7, 8, 11)
|
||||||
|
</sql>
|
||||||
|
|
||||||
<!-- 有未出账费用的订单,或尚未纳入有效账单的无费用计费失败订单。 -->
|
<!-- 有未出账费用的订单,或尚未纳入有效账单的无费用计费失败订单。 -->
|
||||||
<sql id="arBillEligibleSourceCondition">
|
<sql id="arBillEligibleSourceCondition">
|
||||||
|
<include refid="arBillSourceOrderStatusCondition"/>
|
||||||
and (
|
and (
|
||||||
exists (
|
exists (
|
||||||
select 1 from prc_income_bill_fee f
|
select 1 from prc_income_bill_fee f
|
||||||
@@ -685,6 +691,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
inner join prc_income_bill_fee f on f.bill_id = p.bill_id
|
inner join prc_income_bill_fee f on f.bill_id = p.bill_id
|
||||||
and f.ar_bill_status = #{feeArBillStatus}
|
and f.ar_bill_status = #{feeArBillStatus}
|
||||||
where p.customer_id = #{customerId}
|
where p.customer_id = #{customerId}
|
||||||
|
<include refid="arBillSourceOrderStatusCondition"/>
|
||||||
<if test="customerCode != null and customerCode != ''">
|
<if test="customerCode != null and customerCode != ''">
|
||||||
and p.customer_code like concat('%', #{customerCode}, '%')
|
and p.customer_code like concat('%', #{customerCode}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user