查询删除付款单中的入库单
select voucher_no
from ac_payrec_flow a
left join ac_payrec_record b on b.settle_no = a.voucher_no
where b.settle_no is null
and a.pay_date > '2019-01-01'
and a.sheet_amt = a.paid_amt
修改单据状态
update a set paid_amt = 0
from ac_payrec_flow a
left join ac_payrec_record b on b.settle_no = a.voucher_no
where b.settle_no is null
and a.pay_date > '2019-01-01'
and a.sheet_amt = a.paid_amt