SELECT t0.FLOTID,t0.FLOTSTATUS,t0.FNUMBER
	,t1.FBILLDATE,t1.FINSTOCKDATETMP,t1.FORDERTYPE,t1.FBILLFORMID
FROM T_BD_LOTMASTER t0
	INNER JOIN T_BD_LOTMASTERBILLTRACE t1 on t0.FLOTID = t1.FLOTID
WHERE t1.FSTOCKDIRECT = 1
	--AND t0.FLOTID in (9078222,9139693)
ORDER BY t0.FLOTID,t1.FBILLDATE DESC