• 库存现有量


    SELECT company.flex_value,
           company.description,
           inv.item_code,
           --inv.lot_number,--批次
           inv.quantity
      FROM (SELECT ffvt.description, ffv.flex_value, ffv.attribute1
              FROM fnd_flex_value_sets ffvs,
                   fnd_flex_values     ffv,
                   fnd_flex_values_tl  ffvt
             WHERE ffvs.flex_value_set_id = ffv.flex_value_set_id
               AND ffv.flex_value_id = ffvt.flex_value_id
               AND ffvt.language = 'ZHS'
               AND ffv.summary_flag = 'N'
               AND ffv.enabled_flag = 'Y'
                  
               AND ffvs.flex_value_set_name = 'BZ_COMPANY') company,
           (SELECT v.flex_value  company_code,
                   msib.segment1 item_code,
                   --mtln.lot_number,--批次
                   SUM(mtln.transaction_quantity) quantity
              FROM mtl_material_transactions   mmt,
                   mtl_transaction_lot_numbers mtln,
                   mtl_system_items_b          msib,
                   fnd_flex_value_sets         vs,
                   fnd_flex_values             v
             WHERE mmt.transaction_id = mtln.transaction_id
               AND mmt.subinventory_code LIKE '%-INV'
               AND mtln.lot_number <> 'EBS_20131231'
               AND mmt.transaction_date < to_date('20140201', 'YYYYMMDD')
                  --and mmt.transaction_date >= to_date('2014-01-01','YYYY-MM-DD')
               AND flex_value_set_name = 'BZ_COMPANY'
               AND v.flex_value_set_id = vs.flex_value_set_id
               AND v.attribute1 = mmt.organization_id
               AND msib.inventory_item_id = mmt.inventory_item_id
               AND msib.organization_id = 82
            -- and msib.segment1 = 'TLJW1067'--物料
             GROUP BY v.flex_value, msib.segment1 /*, mtln.lot_number*/ --批次
            ) inv
     WHERE inv.company_code = company.flex_value
    

  • 相关阅读:
    nginx 怎么通过域名访问8080端口(指定端口)
    node.js 部署的 vue 项目怎么在局域网访问
    MySQL的疑难问题解决
    win10下装ubuntu双系统(免U盘)
    文件、块、对象存储
    OpenShift定义的安全上下文约束(SCCs)
    OpenShift资源类型
    yum命令详解
    OCP3.9的网络
    NTP时间服务器搭建部署
  • 原文地址:https://www.cnblogs.com/wanghang/p/6299326.html
Copyright © 2020-2023  润新知