--[C6Mart].[PL_S43ContoCorrenteBF] 'F','QDRFNC49E21A367Z'
CREATE procedure [C6Mart].[PL_S43ContoCorrenteBF] 
 @Rete char(1), 
 @CodiceFiscale varchar(16)
AS
BEGIN
 SELECT     
  dbo.ToShortDateString(ANAG_CC.DATA_APERTURA) AS datadiSottoscrizione, 
  ANAG_CC.COD_CC AS conto, 
  cast(ANAG_CC.SALDOCONTABILE as decimal(15,2)) as Controvalore,
  cast(ANAG_CC.SALDODISPONIBILE as decimal(15,2)) as SALDO_DISPONIBILE,
        null as creditrisk ,
        'n.a.' as creditriskstring,
  0 as var,
  null as varString,
  0 as totaleVar,
  null as totaleVarString
 FROM       
  C6Mart.ANAG_CC 
 WHERE 
  ANAG_CC.rete= @Rete
  AND ANAG_CC.cod_fiscale= @CodiceFiscale
  AND ANAG_CC.SALDOCONTABILE < 0
 ORDER BY
  ANAG_CC.SALDOCONTABILE DESC
END