1.查询所有已经销账但是尚未回款的结算单.
Select * From RSM_SettleGatheringBillDetail
Inner join RSM_GatheringBill on ChargeUpGatheringBillCode=RSM_GatheringBill.Code
Where
SettleAmount=RSM_GatheringBill.Amount and RSM_GatheringBill.Amount<>ExtDecimalA
2. 更新所有已经销账但是尚未回款的结算单金额.
Update RSM_GatheringBill set ExtDecimalA =A.SettleAmount
From
(
Select RSM_GatheringBill.Code,SettleAmount From RSM_SettleGatheringBillDetail
inner join RSM_GatheringBill
on ChargeUpGatheringBillCode=RSM_GatheringBill.Code
where SettleAmount=RSM_GatheringBill.Amount and RSM_GatheringBill.Amount<>ExtDecimalA
) A
where A.Code=RSM_GatheringBill.Code
这个是处理所有结算单的,执行的时候一定要看清楚。
如果是部分销账,需要手动某一条更改结算单的回款金额