LOGO_Paytrans_ÖnModül Karşılaştırması
SELECT * FROM (select CASE WHEN PAY.MODULENR=4 THEN INV.NETTOTAL WHEN PAY.MODULENR=5 THEN CLF.AMOUNT WHEN PAY.MODULENR=6 THEN CSR.TOTAL WHEN PAY.MODULENR=7 THEN BNF.AMOUNT WHEN PAY.MODULENR=10 THEN KSL.AMOUNT ELSE 1 END Clfline ,PAY.TL Paytrans, CASE WHEN PAY.MODULENR=4 THEN INV.FICHENO +'Invoice' WHEN PAY.MODULENR=5 THEN CLF.TRANNO+'Clfline' WHEN PAY.MODULENR=6 THEN CSR.ROLLNO+'Rollno' WHEN PAY.MODULENR=7 THEN 'BANKAFİŞ' WHEN PAY.MODULENR=10 THEN KSL.FICHENO +'Kasano' ELSE '' END Fis, CASE WHEN PAY.MODULENR=4 THEN INV.LOGICALREF WHEN PAY.MODULENR=5 THEN CLF.LOGICALREF WHEN PAY.MODULENR=6 THEN CSR.LOGICALREF WHEN PAY.MODULENR=7 THEN 0 WHEN PAY.MODULENR=10 THEN KSL.LOGICALREF ELSE '' END FisLogical from ( SELECT ROund(SUM(TOTAL*TRRATE),2)TL, FICHEREF, TRCODE, MODULENR FROM LG_208_01_PAYTRANS PAY WHERE PAY.CARDREF=4179 GROUP BY FICHEREF,TRCODE,MODULENR ) Pay LEFT JOIN LG_208_01_INVOICE INV ON (PAY.MODULENR=4 AND PAY.TRCODE=INV.TRCODE )AND INV.LOGICALREF=PAY.FICHEREF LEFT JOIN LG_208_01_CLFLINE CLF ON (PAY.MODULENR=5 AND PAY.TRCODE=CLF.TRCODE )AND CLF.LOGICALREF=PAY.FICHEREF LEFT JOIN LG_208_01_CSROLL CSR ON (PAY.MODULENR=6 AND PAY.TRCODE=CSR.TRCODE) AND CSR.LOGICALREF=PAY.FICHEREF LEFT JOIN LG_208_01_BNFLINE BNF ON (PAY.MODULENR=7 AND PAY.TRCODE=BNF.TRCODE) AND BNF.LOGICALREF=PAY.FICHEREF LEFT JOIN LG_208_01_KSLINES KSL ON (PAY.MODULENR=10 AND PAY.TRCODE=KSL.TRCODE )AND KSL.LOGICALREF=PAY.FICHEREF ) PAYY WHERE PAYY.ClflinePAYY.Paytrans AND (PAYY.Paytrans-PAYY.Clfline)>1