问题现象: | 委外结算单无加工费的单价,发票打印时无材料费,只有加工费单价,请解决,谢谢 |
问题原因: | |
解决方案: | 您好: 触发器已在第一次回复里写了,请查看 if exists(select name from sysobjects where name=N'OM_SetProcessFeeCostOnPs_TRI' and xtype=N'TR') drop trigger OM_SetProcessFeeCostOnPs_TRI GO --将自由项1设置为加工费单价 create trigger OM_SetProcessFeeCostOnPs_TRI on pursettlevouchs for insert,update as declare @icostbit nvarchar(2) declare @strSql nvarchar(2000) if update(processfee) begin select inserted.id into #tmp_pursettlevouchs_tmp from inserted join pursettlevouch p on inserted.psvid=p.psvid where p.cbustype=N'委外加工' select @icostbit=isnull(cvalue,cdefault) from accinformation where cname=N'istrspridecdgt' --print @icostbit set @strSql='update ps set ps.cfree1=case when isnull(ps.isvquantity,0)=0 then null else cast(ps.processfee/ps.isvquantity as decimal(36,' + @icostbit + ')) end from pursettlevouchs ps join #tmp_pursettlevouchs_tmp tmp on ps.id=tmp.id ' exec sp_executesql @strSql end GO 请参考! |
相关补丁: | |
版本: | U8 V10.0 |
模块: | 委外管理 |
产品: | 供应链 |
问题名称: | 委外问题 |
最后更新: | 2012-01-07 23:56:41 |