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
  • 相关阅读:
    图片处理
    define 常量的定义和读取
    curl
    stream_get_contents 和file_get_content的区别
    php flock 文件锁
    字符串函数
    php 常量
    debug_backtrace()
    pathlib模块替代os.path
    Python中对 文件 的各种骚操作
  • 原文地址:https://www.cnblogs.com/Chengjr/p/14103809.html
Copyright © 2011-2022 走看看