K3 Cloud材料核算查询

 select  t1.FENTRYID,t1_A.FPARENTMATERIALID,t0.FDATE fbilldatefield, st1_A5_L.FNAME fproductid_fname, st1_A5.FNUMBER fproductid_fnumber,
 t1.FMATERIALID fmaterialfield, st11_L.FNAME fmaterialfield_fname, st11.FNUMBER fmaterialfield_fnumber, st11_L.FSPECIFICATION fspecification, st15_L.FNAME fstockfield_fname,*
 FROM T_PRD_PICKMTRL t0 INNER JOIN T_PRD_PICKMTRLDATA t1 ON t0.FID = t1.FID INNER JOIN T_PRD_PICKMTRLDATA_A t1_A ON t1.FENTRYID = t1_A.FENTRYID
 LEFT OUTER JOIN T_ORG_Organizations_L st05_L ON (t0.FPRDORGID = st05_L.FOrgID AND
st05_L.FLocaleId = 2052) LEFT OUTER JOIN T_BD_MATERIAL st11 ON t1.FMATERIALID = st11.FMATERIALID LEFT OUTER JOIN T_ENG_BOM st14 ON t1.FBOMID = st14.FID
LEFT OUTER JOIN t_BD_Stock_L st15_L ON (t1.FSTOCKID = st15_L.FStockId AND st15_L.FLocaleId = 2052) LEFT OUTER
JOIN t_BD_StockStatus_L st18_L ON (t1.FSTOCKSTATUSID = st18_L.FStockStatusId AND st18_L.FLocaleId = 2052)
LEFT OUTER JOIN T_BD_UNIT_L st111_L ON (t1.FBASEUNITID = st111_L.FUNITID AND st111_L.FLocaleId = 2052) LEFT OUTER JOIN T_BD_MATERIAL st1_A5 ON
t1_A.FPARENTMATERIALID = st1_A5.FMATERIALID LEFT OUTER JOIN T_BAS_BILLTYPE_L st07_L ON (t0.FBILLTYPE = st07_L.FBILLTYPEID AND st07_L.FLocaleId = 2052)
LEFT OUTER JOIN T_BD_MATERIAL_L st11_L ON (t1.FMATERIALID = st11_L.FMATERIALID AND st11_L.FLocaleId = 2052)
LEFT OUTER JOIN T_BD_LOTMASTER_L st119_L ON (t1.FLOT = st119_L.FLOTID AND st119_L.FLocaleId = 2052)
LEFT OUTER JOIN T_BD_MATERIAL_L st1_A5_L ON (t1_A.FPARENTMATERIALID = st1_A5_L.FMATERIALID AND st1_A5_L.FLocaleId = 2052)
LEFT OUTER JOIN t_BD_StockStatus st18 ON t1.FSTOCKSTATUSID = st18.FStockStatusId LEFT OUTER JOIN (SELECT seq.FBillEntryId, seq.FBILLFROMID, process.FID, seq.FAcctgAmount,
seq.FAdjAmount, seq.FORDERNUMBER FROM T_HS_OutInStockSeq_H seq INNER JOIN T_HS_AcctgProcess_H process ON seq.FProcessEntryId = process.FEntryId
INNER JOIN T_HS_OUTACCTG acctg ON (acctg.FID = process.FID AND acctg.FDIMENSIONID = 14)) seq ON (seq.FBillEntryId = t1.FENTRYID AND seq.FBILLFROMID = 'PRD_PickMtrl')
 where st11.FNUMBER='905011220-00009' and t0.fdate>='2019-01-01' and t0.fdate<='2019-01-31' and fordernumber='J3MO1901070015'

你可能感兴趣的:(K3 Cloud材料核算查询)