/***************************************
* STORED stp_RLP_getOpenByUserTipo
*
* ottiene RLP aperte da soggetto e tipo
*
* Steamware, S.E.L.
* mod: 2012.03.01
*
****************************************/
create PROCEDURE [dbo].[stp_RLP_getOpenByUserTipo]
(
	@CodSoggetto NVARCHAR(17),
	@CodTipoLista NVARCHAR(10)
)
AS

	SELECT	RLP.*
	FROM    V_elencoListePrelievo LP INNER JOIN RigheListePrelievo RLP ON LP.CodLista = RLP.CodLista
	WHERE   (LP.CodSoggetto = @CodSoggetto) AND (LP.CodTipoLista = @CodTipoLista)
	AND		LP.CodStatoLista < 3
	
RETURN
