zoukankan      html  css  js  c++  java
  • SQL-005验证门店收货单没有完成的

    /* Formatted on 2020/12/08 17:31:50 (QP5 v5.326) */
      SELECT DISTINCT head.VBILLCODE         AS 单据号,
                      head.DBILLDATE         AS 单据日期,
                      head.CBILLTYPECODE     AS 业务类型,
                      head.cothercorpid,
                      bcb.BODYNAME           AS 库存组织,
                      bsd.STORNAME           AS 门店
        FROM ic_general_h head
             LEFT JOIN ic_general_b body ON head.cgeneralhid = body.cgeneralhid
             LEFT JOIN ic_general_bb3 bb3
                 ON body.cgeneralbid = bb3.cgeneralbid AND bb3.dr = 0
             LEFT JOIN to_bill tobill ON body.cfirstbillhid = tobill.cbillid
             LEFT JOIN bd_calbody bcb ON head.cothercalbodyid = bcb.PK_CALBODY
             LEFT JOIN bd_stordoc bsd ON head.cotherwhid = bsd.PK_STORDOC
       WHERE     head.dr = 0
             AND body.dr = 0
             AND (head.fbillflag = 3 OR head.fbillflag = 4)
             AND NVL (head.dr, 0) = 0
             AND NVL (body.dr, 0) = 0
             AND head.cbilltypecode = '4Y'
             AND NVL (bb3.dr, 0) = 0
             AND body.isok = 'N'
             AND body.noutnum IS NOT NULL
             AND NVL (body.btou8rm, 'N') = 'N'
             AND NOT EXISTS
                     (SELECT 1
                        FROM ic_general_b
                       WHERE     csourcetype = '4Y'
                             AND ic_general_b.csourcebillbid = body.cgeneralbid
                             AND NVL (dr, 0) = 0)
             AND head.cbilltypecode = '4Y'
             AND (head.dbilldate >= '2014-01-01')
             -- AND (head.dbilldate <= '2022-10-27')
             AND (cbilltypecode = '4Y')
    ORDER BY 单据日期 DESC
  • 相关阅读:
    浏览器检测
    EcmaScript基础
    js中的内置对象
    cursor 与refcursor及sys_refcursor的区别 (转载)
    各种连接数据方法的网站
    UVa11627 Slalom
    UVa1450 Airport
    UVa12124 Assemble
    UVa11384 Help is needed for Dexter
    UVa11464 Even Parity
  • 原文地址:https://www.cnblogs.com/Chengjr/p/14103809.html
Copyright © 2011-2022 走看看