Logo Banka Hesapları Sql
Aşağıdaki Sorgu ile Logo Banka Hesapları Listesini alabiliriz.
CREATE VIEW [dbo].[Umt_039_BankaHesaplari]
AS
SELECT
‘039’ AS FIRMA,
BNK.LOGICALREF,
BNK.CODE AS BANKAKODU,
BNK.DEFINITION_ AS BANKAADI,
BNKHS.CODE AS HESAPKODU,
BNKHS.DEFINITION_ AS HESAPADI,
BNKHS.CURRENCY,
CASE WHEN CL.CURCODE IS NULL THEN ‘TL’ ELSE CL.CURCODE END AS DOVIZTIPI, BNFLINE.DATE_ AS TARIH,BNFLINE.LINEEXP AS ACIKLAMA, BNFLINE.SIGN, BNFLINE.TRCODE, BNFLINE.TRCURR, BNFLINE.AMOUNT, BNFLINE.TRRATE,
BNFLINE.TRNET, BNFLINE.REPORTRATE, BNFLINE.REPORTNET, BNFLINE.TRANSTYPE,
(SELECT EMH.CODE
FROM GOPLUS.DBO.LG_039_CRDACREF AS CRD INNER JOIN
GOPLUS.DBO.LG_039_EMUHACC AS EMH ON CRD.ACCOUNTREF = EMH.LOGICALREF
WHERE (CRD.TRCODE = 6) AND (CRD.CARDREF = BNKHS.LOGICALREF) AND (CRD.TYP = 1)) AS MUHKODU, BNKHS.CARDTYPE
FROM GOPLUS.DBO.LG_039_BNCARD AS BNK INNER JOIN
GOPLUS.DBO.LG_039_BANKACC AS BNKHS ON BNK.LOGICALREF = BNKHS.BANKREF LEFT OUTER JOIN
GOPLUS.DBO.LG_039_01_BNFLINE AS BNFLINE ON BNKHS.BANKREF = BNFLINE.BANKREF AND BNKHS.LOGICALREF = BNFLINE.BNACCREF LEFT OUTER JOIN
(SELECT CURTYPE, CURCODE, CURNAME
FROM GOPLUS.DBO.L_CURRENCYLIST
WHERE (FIRMNR = 039)) AS CL ON BNKHS.CURRENCY = CL.CURTYPE WHERE BNKHS.CARDTYPE IN (1,3) AND BNK.ACTIVE = 0 AND BNKHS.ACTIVE=0