找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

初学者课程:T3自学|T6自学|U8自学软件下载课件下载工具下载资料:通资料|U8资料|NC|培训|年结积分规则 | 使用常见问题Q&A
知识库:U8 | | NC | U9 | OA | 政务U8|U9|NCC|NC65|NC65客开|NCC客开新手必读 | 任务 | 快速增金币用友QQ群[微信群]
查看: 3178|回复: 3

[学习] 用自定义报表做的库存留存情况表

[复制链接]
发表于 2012-5-28 21:31:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册账号

×
--------直接在自定义报表上运行就可以了一张库存留存情况表T6U6..U8还没试过呵呵呵俺们给的是不要钱的

SELECT ISNULL(WSIN.业务类型1, '期初库存') + ' ' + ISNULL(WSOUT.业务类型2, '')
      AS 业务类型, WS.cWhName AS 调出仓库名称, WS.cDefine23 AS表体自定义项2,
      WS.cInvCode AS 存货编码, WSIN.单价1 AS 单价, ISNULL(WSOUT.数量2, 0)
      AS 发出数量, ISNULL(WSOUT.数量2 * WSIN.单价1, 0) AS 发出金额,
      ISNULL(WSIN.数量1, 0) - ISNULL(WSOUT.数量2, 0) AS 数量余额,
      (ISNULL(WSIN.数量1, 0) - ISNULL(WSOUT.数量2, 0)) * WSIN.单价1 AS 金额余额,
      WSIN.dDate AS 转入日期, WSOUT.dDate AS 转出日期, WSIN.数量1 AS 收入数量,
      dbo.Inventory.cInvName AS [存货编码]dbo.Inventory.cInvStd AS 规格型号,
      dbo.Warehouse.cWhCode AS 仓库编码, WSIN.业务类型1, WSOUT.业务类型2
FROM (SELECT DISTINCT A.cWhCode, B.cDefine23, B.cInvCode, C.cWhName
        FROM rdrecord A INNER JOIN
              rdrecords B ON A.id = B.id AND B.cDefine23 IS NOT NULL AND
              A.bpufirst = 0 INNER JOIN
              warehouse C ON A.cWhCode = C.cWhCode) WS INNER JOIN
      dbo.Inventory ON
      WS.cInvCode COLLATE Chinese_PRC_CI_AS = dbo.Inventory.cInvCode INNER JOIN
      dbo.Warehouse ON
      WS.cWhCode COLLATE Chinese_PRC_CI_AS = dbo.Warehouse.cWhCode LEFT OUTER
       JOIN
          (SELECT A.cBusType AS 业务类型1, A.cWhCode AS cWhCode1,
               B.cDefine23 AS 表体自定义项1, B.cInvCode AS 存货编码1,
               SUM(B.iQuantity) AS 数量1, AVG(B.iUnitCost) AS 单价1, A.dDate
         FROM dbo.RdRecord A INNER JOIN
               dbo.RdRecords B ON A.ID = B.ID AND A.bRdFlag = 1 AND
               B.cDefine23 IS NOT NULL AND A.bpufirst = 0
         GROUP BY A.cBusType, A.cWhCode, B.cDefine23, B.cInvCode, A.dDate) WSIN ON
      WS.cWhCode = WSIN.cWhCode1 AND WS.cDefine23 = WSIN.表体自定义项1 AND
      WS.cInvCode = WSIN.存货编码图号1 LEFT OUTER JOIN
          (SELECT A.cBusType AS 业务类型2, A.cWhCode AS cWhCode2,
               B.cDefine23 AS 表体自定义项2, B.cInvCode AS 存货编码2,
               SUM(B.iQuantity) AS 数量2, A.dDate
         FROM dbo.RdRecord A INNER JOIN
               dbo.RdRecords B ON A.ID = B.ID AND A.bRdFlag = 0 AND
               B.cDefine23 IS NOT NULL AND A.bpufirst = 0
         GROUP BY A.cBusType, A.cWhCode, B.cDefine23, B.cInvCode, A.dDate)
      WSOUT ON WS.cWhCode = WSOUT.cWhCode2 AND
      WS.cDefine23 = WSOUT.表体自定义项2 AND
      WS.cInvCode = WSOUT.存货编码2
WHERE (ISNULL(WSIN.数量1, 0) - ISNULL(WSOUT.数量2, 0)--------- > 0)
发表于 2012-5-28 22:03:37 | 显示全部楼层
自定义报表??????
.shl文件?
回复 点赞 拍砖

使用道具 举报

 楼主| 发表于 2012-5-30 23:13:41 | 显示全部楼层
在自定义报表上的SQL运行一下就行了,稍加改动就行
回复 点赞 拍砖

使用道具 举报

发表于 2012-6-3 10:09:26 | 显示全部楼层
该兄弟好人啊
回复 点赞 拍砖

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

QQ|站长微信|Archiver|手机版|小黑屋|用友之家 ( 蜀ICP备07505338号|51072502110008 )

GMT+8, 2024-11-25 20:37 , Processed in 0.054424 second(s), 9 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表