Cloud V6.0 9月1日补丁
销售管理下的“可发量报表”查询时报错
parse error. detail message is :
unexcept token. token is : ',', at line 19 column 84, token type is 'Punctuation'
source sql is :
INSERT INTO #TM_SAL_AWAITQTY (FMATERIALID,FAUXPROPID,FBOMID,FSTOCKID,FSTOCKLOCID,FLOT,FPRODUCEDATE,FEXPIRYDATE,
FSTOCKSTATUSID,FOWNERTYPEID,FOWNERID,FKEEPERTYPEID,FKEEPERID,FMTONO,FSTOCKORGID,FBASEAWAITQTY)
SELECT TSDNE.FMATERIALID AS FMATERIALID,TSDNE.FAUXPROPID AS FAUXPROPID,ISNULL(TBOM.FMASTERID,0) AS FBOMID,
TSDNE.FSHIPMENTSTOCKID AS FSTOCKID,TSDNE.FSHIPMENTSTOCKLOCID AS FSTOCKLOCID,ISNULL(TBDLM.FLOTID,0) AS FLOT,
ISNULL(TSDNE.FPRODUCEDATE,@MINTIME1) AS FPRODUCEDATE,--生产日期
ISNULL(TSDNE.FEXPIRYDATE,@MINTIME2) AS FEXPIRYDATE,--过去日期
case when TSDNE.FSTOCKSTATUSID=0 then 10000 else TSDNE.FSTOCKSTATUSID end as FSTOCKSTATUSID,TSDNEE.FOWNERTYPEID,
ISNULL(TOWNER.FMASTERID,0) AS FOWNERID,'',0,TSDNE.FMTONO AS FMTONO,TSDN.FDELIVERYORGID AS FSTOCKORGID,
SUM(TSDNEE.FSTOCKBASEQTY - TSDNEE.FSTOCKBASESUMOUTQTY) AS FBASEAWAITQTY
FROM T_SAL_DELIVERYNOTICEENTRY TSDNE
INNER JOIN T_SAL_DELIVERYNOTICEENTRY_E TSDNEE ON TSDNEE.FEntryID = TSDNE.FEntryID
INNER JOIN T_SAL_DELIVERYNOTICE TSDN ON TSDN.FID = TSDNE.FID
INNER JOIN T_BD_MATERIAL TM ON TSDNE.FMATERIALID = TM.FMATERIALID
INNER JOIN T_BD_MATERIAL_L TML ON TSDNE.FMATERIALID = TML.FMATERIALID AND FLOCALEID=2052
LEFT JOIN T_BD_LOTMASTER TBDLM ON TBDLM.FNUMBER = TSDNE.FLOT_TEXT AND TBDLM.FMATERIALID = TM.FMASTERID
AND TBDLM.FBIZTYPE = '1' AND TBDLM.FUSEORGID = TSDN.FDELIVERYORGID
LEFT JOIN T_ENG_BOM TBOM ON TSDNE.FBOMID = TBOM.FID
LEFT JOIN T_BD_STOCK TS ON TS.FSTOCKID =TSDNE.FSHIPMENTSTOCKID OR TS.FSTOCKID =TSDNE.FBACKUPSTOCKID
LEFT JOIN T_BD_STOCK_L TSL ON (TSL.FSTOCKID =TSDNE.FSHIPMENTSTOCKID OR TSL.FSTOCKID =TSDNE.FBACKUPSTOCKID) AND TSL.FLOCALEID=2052
LEFT JOIN V_ITEMCLASS_OWNER TOWNER ON TSDNEE.FOWNERID = TOWNER.FITEMID
WHERE 1=1 AND ISNULLTML.FName,' '<>' ' AND TSDN.FDOCUMENTSTATUS <>'Z' AND TSDN.FCLOSESTATUS = 'A' AND TSDN.FCANCELSTATUS = 'A' AND TSDNE.FCLOSESTATUS='A' AND TSDNEE.FTERMINATIONSTATUS='A'
GROUP BY TSDNE.FMATERIALID,TSDNE.FAUXPROPID,TBOM.FMASTERID,TSDNE.FSHIPMENTSTOCKID,
TSDNE.FSHIPMENTSTOCKLOCID,TBDLM.FLOTID,TSDNE.FPRODUCEDATE,TSDNE.FEXPIRYDATE,TSDNE.FSTOCKSTATUSID,
TSDNEE.FOWNERTYPEID,TOWNER.FMASTERID,TSDNE.FMTONO,TSDN.FDELIVERYORGID
推荐阅读