enverdersin
Yeni Üye
- Katılım
- 8 Şub 2019
- Mesajlar
- 163
- En iyi yanıt
- 0
- Puanları
- 18
- Yaş
- 46
- Konum
- istanbul
- Ad Soyad
- ENVER DERSİN
Aşağıdaki koddan son stok miktarlarını çekebilirsiniz.
SELECT 'FİRMA İSMİ' FİRMA, IT.CODE MALZEME_KODU, IT.NAME MALZEME_AÇIKLAMASI, IT.SPECODE MALZEME_GRUP, MINLEVEL MIN_STOK, SUM(GN.ONHAND) FİİLİ_STOK, SUM(GN.ONHAND - GN.RESERVED) GERÇEK_STOK, MAX(PRICE) FIYAT, CAP.NAME AMBAR
FROM LG_720_ITEMS IT LEFT JOIN
LV_720_01_GNTOTST GN ON GN.STOCKREF = IT.LOGICALREF AND IT.ACTIVE = 0 LEFT JOIN
LG_720_INVDEF INV ON IT.LOGICALREF = INV.ITEMREF AND GN.INVENNO = INV.INVENNO INNER JOIN
L_CAPIWHOUSE CAP ON CAP.NR = GN.INVENNO LEFT JOIN
LG_720_PRCLIST PRCLIST ON PRCLIST.CARDREF = IT.LOGICALREF AND PTYPE = 2 AND GETDATE() BETWEEN BEGDATE AND ENDDATE
WHERE FIRMNR = 720 AND GN.INVENNO <> - 1
GROUP BY IT.CODE, IT.NAME, INV.MINLEVEL, CAP.NAME, IT.SPECODE
SELECT 'FİRMA İSMİ' FİRMA, IT.CODE MALZEME_KODU, IT.NAME MALZEME_AÇIKLAMASI, IT.SPECODE MALZEME_GRUP, MINLEVEL MIN_STOK, SUM(GN.ONHAND) FİİLİ_STOK, SUM(GN.ONHAND - GN.RESERVED) GERÇEK_STOK, MAX(PRICE) FIYAT, CAP.NAME AMBAR
FROM LG_720_ITEMS IT LEFT JOIN
LV_720_01_GNTOTST GN ON GN.STOCKREF = IT.LOGICALREF AND IT.ACTIVE = 0 LEFT JOIN
LG_720_INVDEF INV ON IT.LOGICALREF = INV.ITEMREF AND GN.INVENNO = INV.INVENNO INNER JOIN
L_CAPIWHOUSE CAP ON CAP.NR = GN.INVENNO LEFT JOIN
LG_720_PRCLIST PRCLIST ON PRCLIST.CARDREF = IT.LOGICALREF AND PTYPE = 2 AND GETDATE() BETWEEN BEGDATE AND ENDDATE
WHERE FIRMNR = 720 AND GN.INVENNO <> - 1
GROUP BY IT.CODE, IT.NAME, INV.MINLEVEL, CAP.NAME, IT.SPECODE