找回密码
 注册账号

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

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

[技巧] nc操作路径:供应链-->库存管理->库存存量查询-->现存量

[复制链接]
发表于 2022-1-27 07:49:20 | 显示全部楼层 |阅读模式

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

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

×
--nc操作路径:供应链-->库存管理->库存存量查询-->现存量
select org_stockorg.code 组织编码,
       org_stockorg.name 组织名称,
       meta.code 物料编码,
       meta.name 物料名称,
       meta.materialspec 到货规则,
       bd_measdoc.name 计量单位名称,
       onhand.stordoccode 仓库,
       onhand.stordocname 仓库名称,
       sum(onhand.nonhandnum) 结存数量,
       sum(onhand.nnum1) 借入量,
       sum(onhand.nnum2) 借出量,
       sum(onhand.nlocknum) 冻结数量,
       sum(onhand.nrsnum) 预留数量
  from (select hand.pk_group       pk_group,
               hand.pk_org         pk_org,
               hand.cwarehouseid   cwarehouseid,
               hand.cmaterialvid   cmaterialvid,
               hand.cmaterialoid   cmaterialoid,
               hand.castunitid     castunitid,
               hand.clocationid    clocationid,
               hand.pk_batchcode   pk_batchcode,
               hand.vbatchcode     vbatchcode,
               hand.vchangerate    vchangerate,
               hand.cvmivenderid   cvmivenderid,
               hand.ctplcustomerid ctplcustomerid,
               hand.cstateid       cstateid,
               hand.cvendorid      cvendorid,
               hand.cprojectid     cprojectid,
               hand.casscustid     casscustid,
               hand.cproductorid   cproductorid,
               hand.cffileid       cffileid,
               hand.nonhandnum     nonhandnum,
               hand.nonhandastnum  nonhandastnum,
               hand.ngrossnum      ngrossnum,
               hand.nnum1          nnum1,
               hand.nastnum1       nastnum1,
               hand.ngrossnum1     ngrossnum1,
               hand.nnum2          nnum2,
               hand.nastnum2       nastnum2,
               hand.ngrossnum2     ngrossnum2,
               hand.nlocknum       nlocknum,
               hand.nlockastnum    nlockastnum,
               hand.nlockgrossnum  nlockgrossnum,
               hand.nrsnum         nrsnum,
               hand.nrsastnum      nrsastnum,
               hand.nrsgrossnum    nrsgrossnum,
               hand.stordoccode    stordoccode,
               hand.stordocname    stordocname
          from (select handdim.pk_group           pk_group,
                       handdim.pk_org             pk_org,
                       handdim.cwarehouseid       cwarehouseid,
                       handdim.cmaterialvid       cmaterialvid,
                       handdim.cmaterialoid       cmaterialoid,
                       handdim.castunitid         castunitid,
                       handdim.clocationid        clocationid,
                       handdim.pk_batchcode       pk_batchcode,
                       handdim.vbatchcode         vbatchcode,
                       handdim.vchangerate        vchangerate,
                       handdim.cvmivenderid       cvmivenderid,
                       handdim.ctplcustomerid     ctplcustomerid,
                       handdim.cstateid           cstateid,
                       handdim.cvendorid          cvendorid,
                       handdim.cprojectid         cprojectid,
                       handdim.casscustid         casscustid,
                       handdim.cproductorid       cproductorid,
                       handdim.cffileid           cffileid,
                       ic_onhandnum.nonhandnum    nonhandnum,
                       ic_onhandnum.nonhandastnum nonhandastnum,
                       ic_onhandnum.ngrossnum     ngrossnum,
                       ic_onhandnum.nnum1         nnum1,
                       ic_onhandnum.nastnum1      nastnum1,
                       ic_onhandnum.ngrossnum1    ngrossnum1,
                       ic_onhandnum.nnum2         nnum2,
                       ic_onhandnum.nastnum2      nastnum2,
                       ic_onhandnum.ngrossnum2    ngrossnum2,
                       ic_onhandnum.nlocknum      nlocknum,
                       ic_onhandnum.nlockastnum   nlockastnum,
                       ic_onhandnum.nlockgrossnum nlockgrossnum,
                       ic_onhandnum.nrsnum        nrsnum,
                       ic_onhandnum.nrsastnum     nrsastnum,
                       ic_onhandnum.nrsgrossnum   nrsgrossnum,
                       bd_stordoc.code            stordoccode,
                       bd_stordoc.name            stordocname
                  from ic_onhandnum ic_onhandnum --现存量
                 inner join ic_onhanddim handdim --现存量维度
                    on (ic_onhandnum.pk_onhanddim = handdim.pk_onhanddim)
                  left outer join scm_batchcode scm_batchcode --批次档案
                    on (handdim.pk_batchcode = scm_batchcode.pk_batchcode)
                 inner join bd_stordoc bd_stordoc --仓库
                    on (handdim.cwarehouseid = bd_stordoc.pk_stordoc)) hand) onhand
  left outer join bd_material_v meta --物料基本信息
    on onhand.cmaterialoid = meta.pk_source
inner join bd_measdoc bd_measdoc
    on meta.pk_measdoc = bd_measdoc.pk_measdoc
inner join org_stockorg org_stockorg
    on onhand.pk_org = org_stockorg.pk_stockorg --组织_业务单元_库存组织
where org_stockorg.code = '129' --业务单元代码
--and meta.code = '20400002'
group by org_stockorg.code,
          org_stockorg.name,
          meta.code,
          meta.materialmnecode,
          meta.name,
          meta.materialspec,
          meta.materialtype,
          meta.graphid,
          bd_measdoc.name,
          onhand.stordoccode,
          onhand.stordocname
having sum(onhand.nonhandnum) <> 0;


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

本版积分规则

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

GMT+8, 2024-4-26 10:33 , Processed in 0.048287 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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