-- 领料差异分摊事务类型历史数据处理
update t_im_mdc_mftbackdifshare set ftransactiontypeid =
(select t2.ftransactiontype from t_pom_mftorderentry t1 inner join t_pom_mftorder t2 on t1.fid= t2.fid where t1.fentryid =forderentryid group by t2.ftransactiontype)
where exists (select t2.ftransactiontype from t_pom_mftorderentry t1 inner join t_pom_mftorder t2 on t1.fid= t2.fid where t1.fentryid =forderentryid group by t2.ftransactiontype);


-- 领料差异分摊明细事务类型历史数据处理
update t_im_mdc_shdifsharedetail set ftransactiontypeid =
(select t2.ftransactiontype from t_pom_mftorderentry t1 inner join t_pom_mftorder t2 on t1.fid= t2.fid where t1.fentryid =fshorderentryid group by t2.ftransactiontype)
where exists (select t2.ftransactiontype from t_pom_mftorderentry t1 inner join t_pom_mftorder t2 on t1.fid= t2.fid where t1.fentryid =fshorderentryid group by t2.ftransactiontype);

