dvbbs
收藏本页
联系我们
论坛帮助
dvbbs

>> 用友U8、TONG系统软件交流
搜一搜相关精彩主题 
安易免费财务软件交流论坛其它财务软件交流用友财务软件交流 → 财务通标准版821存货核算财务通现存量不对怎么办?

您是本帖的第 1249 个阅读者
树形 打印
标题:
财务通标准版821存货核算财务通现存量不对怎么办?
iabc3000
帅哥哟,离线,有人找我吗?
等级:侠圣
文章:4389
积分:24360
注册:2009年7月18日
楼主
  点击这里发送电子邮件给iabc3000

发贴心情
财务通标准版821存货核算财务通现存量不对怎么办?
财务通标准版821存货核算财务通现存量不对怎么办?
ip地址已设置保密
2009/8/16 18:02:28
iabc3000
帅哥哟,离线,有人找我吗?
等级:侠圣
文章:4389
积分:24360
注册:2009年7月18日
2
  点击这里发送电子邮件给iabc3000

发贴心情
执行以下脚本能解决问题
   
    select * from sysobjects where name='tempcurrentstock'
    drop table TempCurrentStock
    SELECT cWhCode,cInvCode,(CASE WHEN cFree1=''THEN NULL ELSE cFree1 END) AS
    cFree1 ,(CASE WHEN cFree2=''THEN NULL ELSE cFree2 END) AS cFree2 ,iainquantity
    AS iQuantity, CAST(0 AS FLOAT) AS fOutQuantity,CAST(0 AS FLOAT) AS fInQuantity
    INTO TempCurrentStock
    From ia_subsidiary
    Where cvoutype='34'
    group by ia_subsidiary.cWhCode,ia_subsidiary.cInvCode,ia_subsidiary.cFree1,
    ia_subsidiary.cFree2,ia_subsidiary.iainquantity
    INSERT INTO TempCurrentStock(cWhCode,cInvCode,cFree1,cFree2,iQuantity) SELECT
    cWhCode, cInvCode,(CASE WHEN cFree1=''THEN NULL ELSE cFree1 END) AS cFree1 ,(
    CASE WHEN cFree2=''THEN NULL ELSE cFree2 END) AS cFree2 , (CASE WHEN bRdFlag<>0
    THEN iQuantity ELSE -iQuantity END) AS iQuantity
    FROM RdRecord INNER JOIN RdRecords ON RdRecord.ID = RdRecords.ID
    WHERE cVouchType<>'33'AND cVouchType<>'34' AND RdRecord.dDate>='2007-1-01'
    INSERT INTO TempCurrentStock(cWhCode,cInvCode,cFree1,cFree2,fOutQuantity)
    SELECT EnDispatchs.cWhCode, EnDispatchs.cInvCode,(CASE WHEN EnDispatchs.cFree1=
    '' THEN NULL ELSE EnDispatchs.cFree1 END) AS cFree1 ,(CASE WHEN EnDispatchs.
    cFree2='' THEN NULL ELSE EnDispatchs.cFree2 END) AS cFree2 , (ISNULL(iQuantity,
    0)-ISNULL(fOutQuantity,0)) AS fOutQuantity
    FROM EnDispatch INNER JOIN EnDispatchs ON EnDispatch.EDID = EnDispatchs.EDID
    WHERE ISNULL(EnDispatchs.cWhCode,'')<>'' AND ISNULL(EnDispatch.cSTCode,'')<>''
    AND EnDispatchs.iQuantity>0 AND bReturnFlag=0
    INSERT INTO TempCurrentStock(cWhCode,cInvCode,cFree1,cFree2,fOutQuantity)
    SELECT DispatchLists.cWhCode as cWhCode, DispatchLists.cInvCode as cInvCode,(
    CASE WHEN DispatchLists.cFree1='' THEN NULL ELSE DispatchLists.cFree1 END) AS
    cFree1 , (CASE WHEN DispatchLists.cFree2='' THEN NULL ELSE DispatchLists.cFree2
    END) AS cFree2 , (ISNULL(iQuantity,0)-ISNULL(fOutQuantity,0)) AS fOutQuantity
    FROM DispatchLists INNER JOIN DispatchList ON DispatchLists.DLID =
    DispatchList.DLID
    WHERE DispatchList.cVouchType='05' AND ISNULL(DispatchLists.cWhCode,'')<>''
    AND ISNULL(DispatchList.cSTCode,'')<>'' AND (DispatchList.iSale=0 or
    DispatchList.iSale IS NULL) AND DispatchLists.iQuantity>0
    INSERT INTO TempCurrentStock(cWhCode,cInvCode,cFree1,cFree2,fOutQuantity)
    SELECT cWhCode, cInvCode,(CASE WHEN cFree1=''THEN NULL ELSE cFree1 END) AS
    cFree1 , (CASE WHEN cFree2=''THEN NULL ELSE cFree2 END) AS cFree2 , (ISNULL(
    iQuantity,0)-ISNULL(fOutQuantity,0)) AS fOutQuantity
    FROM SaleBillVouchs INNER JOIN SaleBillVouch ON SaleBillVouch.SBVID=
    SaleBillVouchs.SBVID
    WHERE ISNULL(SaleBillVouchs.cWhCode,'')<>'' AND (SaleBillVouch.iDisp=0 OR
    SaleBillVouch.iDisp IS NULL) AND ISNULL(cBusType,'')<>'委托' AND ISNULL(
    cSTCode,'')<>'' AND ISNULL(cInvalider,'')='' AND SaleBillVouchs.iQuantity>
    0INSERT INTO CurrentStock(cWhCode,cInvCode,cFree1,cFree2,iQuantity,fOutQuantity,
    fInQuantity)
    SELECT cWhCode, cInvCode,cFree1,cFree2 , sum(iQuantity) AS iQuantity,sum(
    ISNULL(fOutQuantity,0)) AS fOutQuantity, sum(ISNULL(fInQuantity,0)) AS
    fInQuantity
    FROM TempCurrentStock
    GROUP BY cWhCode,cInvCode,cFree1,cFree2
    Delete From CurrentStock
    where iquantity is null and foutquantity=0 and finquantity=0
ip地址已设置保密
2009/8/16 18:02:59
清风生
帅哥哟,离线,有人找我吗?
等级:论坛游民
文章:194
积分:940
注册:2010年1月19日
3
  点击这里发送电子邮件给清风生

发贴心情

这样啊

图片点击可在新窗口打开查看
ip地址已设置保密
2010/4/26 22:08:36
caritas
帅哥哟,离线,有人找我吗?
等级:论坛游侠
文章:198
积分:725
注册:2011年1月5日
4
  点击这里发送电子邮件给caritas

发贴心情
看不懂哦
ip地址已设置保密
2011/3/2 17:59:32
sunjiacun
帅哥哟,离线,有人找我吗?
等级:论坛游侠
文章:203
积分:835
注册:2011年9月13日
5
  点击这里发送电子邮件给sunjiacun

发贴心情
看不明白
ip地址已设置保密
2011/10/7 15:28:36
hlp34567
美女呀,离线,留言给我吧!
等级:论坛游民
文章:119
积分:585
注册:2011年8月18日
6
  点击这里发送电子邮件给hlp34567

发贴心情
好麻烦看不懂
ip地址已设置保密
2011/10/8 8:25:41
dmacc906
帅哥哟,离线,有人找我吗?
等级:论坛游侠
文章:202
积分:775
注册:2011年8月7日
7
  点击这里发送电子邮件给dmacc906

发贴心情
应该不会啊~~
ip地址已设置保密
2011/11/5 21:35:23

 7   7   1/1页      1    
网上贸易 创造奇迹! 阿里巴巴 Alibaba
北京安易天地软件有限公司北方论坛
联系电话:010-51268244 13611231185 QQ:511102924
Powered By Dvbbs Version 7.1.0 Sp1
页面执行时间 0.10938 秒, 4 次数据查询