Sevkiyat Takip Raporu
Logo Yazılım dan Sql Managent tarafından Sevkiyat Takip Raporu için gerekli yerleri düzenledikten sonra aşağıdaki kodu çalıştırmanız yeterlidir.
SELECT CR.CODE AS 'Cari Kod', CR.DEFINITION_ AS 'Cari Ünvan', (SELECT CODE FROM LG_001_SHIPINFO WHERE LOGICALREF=SF.SHIPINFOREF) AS 'Sevk Adresi Kod', (SELECT NAME FROM LG_001_SHIPINFO WHERE LOGICALREF=SF.SHIPINFOREF) AS 'Sevk Adresi Adı', ST.CODE 'Stok Kodu', ST.NAME 'Stok Adı', CASE SL.TRCODE WHEN 6 THEN 'Alım İade İrs' WHEN 7 THEN 'Perakende Satış İrs.' WHEN 8 THEN 'Toptan Satış İrs.' WHEN 9 THEN 'Konsinye Çıkış İrs.' WHEN 10 THEN 'Konsinye Giriş İade İrs.' WHEN 11 THEN 'Fire Fişi' WHEN 12 THEN 'Sarf Fişi' WHEN 25 THEN 'Ambar Fişi' WHEN 51 THEN 'Sayım Eksiği Fişi' END AS 'İrsaliye Türü', CONVERT(nvarchar(50),(SF.DATE_),103) AS 'İrsaliye Tarihi', SF.FICHENO AS 'İrsaliye No', (SELECT (CONVERT(nvarchar(50),(DATE_),103)) FROM LG_001_01_INVOICE I WHERE I.LOGICALREF=SL.INVOICEREF) AS 'Fatura Tarihi', (SELECT FICHENO FROM LG_001_01_INVOICE I WHERE I.LOGICALREF=SL.INVOICEREF) AS 'Fatura No', (SELECT FICHENO FROM LG_001_01_ORFICHE SIP WHERE SIP.LOGICALREF=SL.ORDFICHEREF) AS 'Sipariş No', SL.AMOUNT AS 'Miktar', SL.PRICE AS 'Birim Fiyat', SL.TOTAL AS 'Tutar' FROM LG_001_01_STLINE SL,LG_001_ITEMS ST,LG_001_CLCARD CR,LG_001_01_STFICHE SF WHERE SL.STOCKREF=ST.LOGICALREF AND SL.CLIENTREF=CR.LOGICALREF AND SL.STFICHEREF=SF.LOGICALREF AND (SL.TRCODE IN (6,7,8,9,10,11,12,25,51)) AND ST.CODE LIKE '%' AND CR.CODE LIKE '%' And CONVERT(nvarchar(50),(SF.DATE_),103) Between '1.01.2016' And '31.12.2100' Order By SF.DATE_ |
Paylaş: