SELECT GOODSSTOCK.GSTGDID,
GOODSBASE.GBANALCODE,
GOODSBASE.GBBARCODE,
GOODSBASE.GBCNAME,
GOODSBASE.GBSPEC,
GOODSBASE.GBSCCS,
GOODSBASE.GBCSHH,
GOODSBASE.GBPZWH,
to_number(NVL(GOODSBASE.GBZCFF,0))*goodsstock.gstkcsl GBZCFF,
(to_number(NVL(GOODSBASE.GBZCFF,0))/1.17)*goodsstock.gstkcsl GBbhsZCFF,
GOODSBASE.GBPPCODE,
GOODSBASE.GBCATCODE,
GOODSSTOCK.GSTMFID,
GOODSSTOCK.GSTSUPID,
SUPPLIERBASE.SBSUBJECT,
GOODSSTOCK.GSTWMID,
GOODSSTOCK.GSTMARKET,
GOODSSTOCK.GSTKCSL,
GOODSSTOCK.GSTKCHSJJJE,
GOODSSTOCK.GSTKCBHSJJJE,
GOODSSTOCK.GSTHSJJ,
GOODSSTOCK.GSTBHSJJ,
DECODE(FNULLTO0(GSTKCSL),0,GSTHSJJ,GSTKCHSJJJE/GSTKCSL) PJJJ,
FGETGOODSPRICE(GOODSSTOCK.GSTGDID) SJ,
(to_number(NVL(GOODSBASE.GBZCFF,0))*GOODSSTOCK.GSTKCSL)+GOODSSTOCK.GSTKCHSJJJE hsjjze,
((to_number(NVL(GOODSBASE.GBZCFF,0))/1.17)*GOODSSTOCK.GSTKCSL)+GOODSSTOCK.GSTKCBHSJJJE bhsjjze
FROM GOODSBASE,
GOODSSTOCK,
SUPPLIERBASE
WHERE GOODSBASE.GBID = GOODSSTOCK.GSTGDID AND
SUPPLIERBASE.SBID=GOODSSTOCK.GSTSUPID AND
'GOODSSTOCK.GSTSUPID'='GOODSSTOCK.GSTSUPID' AND
'GOODSSTOCK.GSTWMID'='GOODSSTOCK.GSTWMID' AND
GOODSSTOCK.GSTMARKET = '1002' AND
'GOODSSTOCK.GSTMFID'='GOODSSTOCK.GSTMFID' AND
'++GOODSSTOCK.GSTMFID'='++GOODSSTOCK.GSTMFID' AND
'GOODSSTOCK.GSTGDID'='GOODSSTOCK.GSTGDID' AND
'GOODSBASE.GBANALCODE'='GOODSBASE.GBANALCODE' AND
GOODSBASE.GBCNAME LIKE '如松柏茂%' AND
'GOODSBASE.GBPPCODE'='GOODSBASE.GBPPCODE' AND
'GOODSBASE.GBCATCODE'='GOODSBASE.GBCATCODE' AND
'GOODSSTOCK.GSTKCSL'='GOODSSTOCK.GSTKCSL' AND
'GOODSSTOCK.GSTKCHSJJJE'='GOODSSTOCK.GSTKCHSJJJE' AND
'GOODSBASE.GBBARCODE'='GOODSBASE.GBBARCODE' and
gstkcsl<>0
|