zoukankan      html  css  js  c++  java
  • Oracle EBS-SQL (PO-10):检查过期采购未接收订单.sql

     Select pha.segment1               采购订单,
               MSI.SEGMENT1             物料编码,
               MSI.DESCRIPTION         物料描述,
               pla.LINE_NUM                     行号,
               PLLA.QUANTITY                   数量,
               ppf.FULL_NAME                采购员,
               plla.NEED_BY_DATE       需求日期
      From po.po_headers_all                pha,
               po.po_lines_all                     pla,
               po.po_line_locations_all       plla,
               apps.per_people_f               ppf,
               INV.MTL_SYSTEM_ITEMS_B   MSI
     Where pha.PO_HEADER_ID = pla.PO_HEADER_ID                               AND
               pha.type_lookup_code = 'STANDARD'                                       AND
               pha.PO_HEADER_ID = pla.PO_HEADER_ID                                AND
               ppf.PERSON_ID = pha.agent_id                                                AND
               pla.po_line_id = plla.po_line_id                                                 AND
               MSI.INVENTORY_ITEM_ID = PLA.ITEM_ID                                  AND

                MSI.ORGANIZATION_ID = X                                                     AND
                ((pha.CLOSED_CODE = 'OPEN') Or (pha.CLOSED_CODE Is Null)) AND
                pha.AUTHORIZATION_STATUS = 'APPROVED'                             AND
                ((pha.user_hold_flag = 'N') or (pha.user_hold_flag is null))         AND
                ((pha.CANCEL_FLAG = 'N') or (pha.CANCEL_FLAG is null))          AND
                (plla.NEED_BY_DATE+15) < Sysdate and not exists
                      (select 'X'
                         from po.rcv_transactions rt
                       where rt.PO_HEADER_ID = plla.PO_HEADER_ID                  AND
                                 rt.po_line_id = plla.po_line_id                                  AND
                                 rt.PO_LINE_LOCATION_ID = plla.LINE_LOCATION_ID)

  • 相关阅读:
    Linux中批量添加文件和修改文件小笔记
    scp 命令快速使用讲解
    使用Apache Spark 对 mysql 调优 查询速度提升10倍以上
    阿里云CentOS-7.2安装mysql
    yum安装网络配置图形界面
    忘记了root密码,如何进入系统?
    Linux学习之竿头直上
    Linux命令之初出茅庐
    Linux学习之要点必备
    阿里云CentOS7.2服务器的安装
  • 原文地址:https://www.cnblogs.com/st-sun/p/3780013.html
Copyright © 2011-2022 走看看