Logo Go / Tiger Hareketsiz Carileri Kullanımdışı yapma

Logo Go / Tiger Hareketsiz Carileri Kullanımdışı yapma


with bb as (SELECT LOGICALREF,CODE, DEFINITION_,( select count (CLIENTREF) from dbo.LV_115_01_CLEKSTRE where 

CLIENTREF = aa.LOGICALREF ) as say FROM dbo.LG_115_CLCARD as aa with (nolock) where CARDTYPE = 3 )

update LG_115_CLCARD set ACTIVE = 1 where LOGICALREF in ( select LOGICALREF from bb where say = 0)


Logo Tiger Hesap Özeti SQL

DSYB Bilgi Yönetim Sisteminde Kullanmış olduğım Cari hesap özetinin SQL Kodları

ALTER FUNCTION [dbo].[GET_LOGO_EKSTRE] ( -- Add the parameters for the function here
                                         @REF INTEGER )
RETURNS TABLE
AS
RETURN
    ( 
    
    SELECT  DATE_ AS TARIH ,
        TRANNO AS BELGENO ,
        LINEEXP ,
        DEBIT AS BORC ,
        CREDIT AS ALACAK
FROM    BDSYB2014.dbo.LV_001_01_CLEKSTRE
WHERE   CLIENTREF = @REF
        AND TRCODE NOT IN ( 38, 39 )
UNION ALL
SELECT  BDSYB2014.dbo.LV_001_01_CLEKSTRE.DATE_ ,
        BDSYB2014.dbo.LV_001_01_CLEKSTRE.TRANNO ,
        CONVERT(VARCHAR, BDSYB2014.dbo.LV_001_01_STLINE.AMOUNT, 102)
        + '- Ad. ' + BDSYB2014.dbo.LV_001_01_STLINE.LINEEXP AS ACIKLAMA ,
        ( SELECT    VATAMNT + VATMATRAH
          FROM      BDSYB2014.dbo.LG_001_01_STLINE
          WHERE     BDSYB2014.dbo.LG_001_01_STLINE.LOGICALREF = BDSYB2014.dbo.LV_001_01_STLINE.LOGICALREF
        ) AS BORC ,
        CASE ( SELECT TOP 1
                        PAIDINCASH
               FROM     BDSYB2014.dbo.LG_001_01_INVOICE
               WHERE    LOGICALREF = BDSYB2014.dbo.LV_001_01_CLEKSTRE.SOURCEFREF
             )
          WHEN 1
          THEN ( SELECT VATAMNT + VATMATRAH
                 FROM   BDSYB2014.dbo.LG_001_01_STLINE
                 WHERE  BDSYB2014.dbo.LG_001_01_STLINE.LOGICALREF = BDSYB2014.dbo.LV_001_01_STLINE.LOGICALREF
               )
          ELSE 0
        END AS ALACAK
FROM    BDSYB2014.dbo.LV_001_01_CLEKSTRE
        INNER JOIN BDSYB2014.dbo.LV_001_01_STLINE ON BDSYB2014.dbo.LV_001_01_CLEKSTRE.SOURCEFREF = BDSYB2014.dbo.LV_001_01_STLINE.INVOICEREF
WHERE   ( BDSYB2014.dbo.LV_001_01_CLEKSTRE.CLIENTREF = @REF )
        AND ( BDSYB2014.dbo.LV_001_01_CLEKSTRE.TRCODE IN ( 38, 39 ) )
    
    )