bugfix:银行一正一负交易不自动核销

This commit is contained in:
Elliott
2026-01-08 14:48:54 +08:00
parent 90cbcf8a13
commit bad857217d
2 changed files with 2 additions and 27 deletions

View File

@@ -75,23 +75,6 @@
<if test="likeFiled!=null and likeFiled!=''">
and C_SHDDH like concat('%',concat(#{likeFiled},'%'))
</if>
and C_SHDDH in (
select C_SHDDH
from bankbill_history
<where>
<if test="startTime!=null and startTime!=''">
and C_JYRQ &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!=''">
and C_JYRQ &lt;= #{endTime}
</if>
<if test="c_zffs!=null and c_zffs!=''">
and C_ZFFS = #{c_zffs}
</if>
</where>
group by C_SHDDH
having ROUND(SUM(CAST(C_JYJE AS DECIMAL(18,2))), 2) != 0
)
</where>
order by C_JYRQ,C_JYSJ
</select>

View File

@@ -217,7 +217,7 @@
from (select * from hisbill_history where trade_date = #{trade_date} and payType!=#{cash_code}
and PayMethod != '2' -- 排除不参与对账的记录
and PayType != '9' -- 排除账户支付,不参与常规对账
and PayType != '10' -- 排除统筹支付,不参与常规对账
and PayType != '10'
<if test="military_code != null and military_code != ''">
and payType!=#{military_code}
</if>
@@ -236,15 +236,7 @@
select * from bankbill_history
where C_JYRQ = #{trade_date}
and (is_inpatient is null or is_inpatient = '0')
and C_SHDDH in (
select C_SHDDH
from bankbill_history
where C_JYRQ = #{trade_date}
and (is_inpatient is null or is_inpatient = '0')
group by C_SHDDH
having ROUND(SUM(CAST(C_JYJE AS DECIMAL(18,2))), 2) != 0
)
) b -- 排除住院订单且排除同订单号正负抵消为0的记录
) b
on a.PlatformTransId = b.C_SHDDH and a.TradingStatus = b.C_JYLX and ROUND(CAST(a.Amount AS DECIMAL(18,2)), 2) = ROUND(CAST(b.C_JYJE AS DECIMAL(18,2)), 2)
where a.PlatformTransId is null
</insert>