Pythontr

husonet | Tarih: 19.10.2012

Logo LKS Stok Kartı Adı, Açıklama, Fiyat ve Birim unsurlarının çekilmesi

Örnek Sql
SELECT  URUN.CODE       AS STOK_KOD,
URUN.NAME AS STOK_ADI,
URUN.STGRPCODE AS GRUP_KODU,
URUN.CARDTYPE AS KARTTIPI,
AMBARM.MIKTAR AS STOK,
ALIS.FIYAT AS ALIS_FIYATI,
SATIS.FIYAT AS SATIS_FIYATI,
BIRIM.CODE AS BIRIM,
BBARKOD.BARCODE AS BARKOD
FROM LG_211_ITEMS URUN·
LEFT JOIN (SELECT SUM(ONHAND) MIKTAR,STOCKREF FROM LG_211_01_STINVTOT WHERE INVENNO=-1 GROUP BY STOCKREF) AMBARM ON URUN.LOGICALREF = AMBARM.STOCKREF
LEFT JOIN ((SELECT MAX(PRICE) AS 'FIYAT',CARDREF FROM LG_211_PRCLIST WHERE PTYPE=1 GROUP BY CARDREF)) ALIS ON URUN.LOGICALREF = ALIS.CARDREF
LEFT JOIN ((SELECT MAX(PRICE) AS 'FIYAT',CARDREF FROM LG_211_PRCLIST WHERE PTYPE=2 GROUP BY CARDREF)) SATIS ON URUN.LOGICALREF = SATIS.CARDREF
LEFT JOIN LG_211_UNITSETL BIRIM ON URUN.UNITSETREF=BIRIM.UNITSETREF
LEFT JOIN LG_211_ITMUNITA BBARKOD ON URUN.UNITSETREF=BBARKOD.ITEMREF
WHERE URUN.CODE = 'xxxxxxxxxxxx' AND
URUN.CARDTYPE = 11 AND
URUN.UNITSETREF=BIRIM.UNITSETREF AND
AMBARM.MIKTAR > 0 AND
SATIS.FIYAT > 0


Sadece Barkodları Çekmek İçin
1
SELECT LG_212_UNITBARCODE.*
FROM LG_212_ITEMS
LEFT JOIN LG_212_UNITBARCODE ON LG_212_ITEMS.LOGICALREF = LG_212_UNITBARCODE.ITEMREF
WHERE LG_212_ITEMS.CODE = 'xxxxxxx'


2
SELECT *
FROM LG_212_ITEMS
LEFT JOIN LG_212_ITMUNITA ON LG_212_ITEMS.LOGICALREF = LG_212_ITMUNITA.ITEMREF
WHERE LG_212_ITEMS.CODE = 'xxxxxxx'