$1 VIEW [dbo].[CARI_HESAPLAR_SECIM_01]
AS
SELECT TOP 100 PERCENT
*,
T.[Borc]-T.[Alacak] AS [Bakiye]
FROM
(
SELECT
cari_kodu as Value,
cari_kodu as CariKod,
cari_unvan1 as Unvan1,
cari_unvan2 as Unvan2,
cari_vdaire_adi as VergiDaireAdi,
cari_vdaire_no as VergiKimlikNo,
(SELECT borc FROM dbo.fn_CariBorcAlacak(cari_kodu,GETDATE())) as Borc,
(SELECT alacak FROM dbo.fn_CariBorcAlacak(cari_kodu,GETDATE())) as Alacak
FROM CARI_HESAPLAR  WITH(NOLOCK))T
