物控档欠料计算方法与生成领料单计算方法不一至,需要尽快更新才行
生成领料单欠料计算方法: case when ov_sfcmocontrol_out.bom_type ='0' then (ov_sfcmocontrol_out.use_total_qty - ov_sfcmocontrol_out.use_replaceqty3 - ov_sfcmocontrol_out.out_qty3 - ov_sfcmocontrol_out.out_tempqty_in2 - ov_sfcmocontrol_out.use_tempreplaceqty3) else 0 end as ql_qty
物控档欠料计算方法:
dbo.uf_format(case when oscm_control.bom_type='0' and
(oscm_control.out_llqty+oscm_control.out_tempqty+oscm_control.out_preqty+oscm_control.out_transqty+
oscm_control.out_borrowqty-oscm_control.out_goodqty-oscm_control.out_purqty - oscm_control.out_badqty)
- ( oscm_control.use_qty - oscm_control.use_tempreplaceqty - oscm_control.use_replaceqty)<0 then
(oscm_control.use_qty - oscm_control.use_tempreplaceqty - oscm_control.use_replaceqty) -
(oscm_control.out_llqty+oscm_control.out_tempqty+oscm_control.out_preqty+oscm_control.out_transqty+
oscm_control.out_borrowqty-oscm_control.out_goodqty-oscm_control.out_purqty -oscm_control.out_badqty)
else
0
end,'len_qty1',opur_pur1.org_no) as ql_qty