|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
UPDATE RdRecordS01 SET IUNITCOST=IUNITPRICE,FACOST=IUNITPRICE,IPRICE=IUNITPRICE*iQuantity,iAPrice =IUNITPRICE*iQuantity,iOriTaxCost=iTaxUnitPrice
,iOriCost=IUNITPRICE,iorimoney=IUNITPRICE*iQuantity,iOriTaxPrice=(iOriTaxCost-ioricost)*iQuantity ,iorisum=iOriMoney+ioritaxprice,iTaxRate=RdRecordS01.iTaxRate,iTaxPrice=(iOriTaxCost-ioricost)*iQuantity
,isum=iOriMoney+ioritaxpriceFROM (
SELECT cvencode ,cinvcode,iUnitPrice ,iTaxRate,ITAXUNITPRICE FROM PU_PriceJustMain,PU_PriceJustDetail
where iSupplyType ='1' and PU_PriceJustMain.id=PU_PriceJustDetail.id
and autoid in (
select autoid1 from(
select MAX(autoid) as autoid1,cvencode ,cinvcode
from PU_PriceJustDetail ,PU_PriceJustMain where iSupplyType ='1' and PU_PriceJustMain.id=PU_PriceJustDetail.id
GROUP BY cvencode ,cinvcode
)as a )
GROUP BY autoid,cvencode ,cinvcode ,iUnitPrice ,iTaxRate,ITAXUNITPRICE
) AS B, RdRecord01 , RdRecordS01
WHERE cRdCode='11' AND RdRecord01.ID = RdRecordS01.ID AND RdRecord01.cVenCode=B.cvencode and RdRecord01.cVenCode='填写供应商编号' AND RdRecordS01.CINVCODE =B.cinvcode
------可自己加入单据时间便于修改
该贴已经同步到 chenchenjie的微博 |
|