-- =============================================
-- Author:		<Gentilezza,,Marco>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [C6Mart].[PL_S47ContoCorrenteBF] 
	-- Add the parameters for the stored procedure here
	-- Add the parameters for the stored procedure here
	@Rete char(1), 
	@CodiceFiscale varchar(16)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SELECT     
		dbo.ToShortDateString(ANAG_CC.DATA_APERTURA) AS datadiSottoscrizione, 
		ANAG_CC.COD_CC AS conto, 
		cast(ANAG_CC.SALDO as decimal(15,2)) as Controvalore,
        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
	ORDER BY
		ANAG_CC.SALDO DESC
END