set xact_abort on;
go

begin transaction;
go

set ANSI_NULLS on;
go

/***************************************
* STORED stp_RLP_getBloccateMovByUdc
*
* ottiene ELENCO RLP bloccati x movimentazione dato UDC
*
* Steamware, S.E.L.
* mod: 2012.07.11
*
****************************************/
create PROCEDURE stp_RLP_getBloccateMovByUdc
(
	@UDC		VARCHAR(50)
)
AS

	SELECT	rldp.*
	FROM	RigheListePrelievo rldp INNER JOIN ElencoListePrelievo ldp 
		ON	ldp.CodLista=rldp.CodLista INNER JOIN AnagStatiListe asl
		ON	ldp.CodStatoLista = asl.CodStatoLista
	WHERE	asl.canMovUDC = 0
	AND		rldp.UDC=@UDC
	
RETURN
go

/***************************************
* STORED stp_RLP_getBloccateQtaByUdc
*
* ottiene ELENCO RLP bloccati x rettifica qta dato UDC
*
* Steamware, S.E.L.
* mod: 2012.07.11
*
****************************************/
create PROCEDURE stp_RLP_getBloccateQtaByUdc
(
	@UDC		VARCHAR(50)
)
AS

	SELECT	rldp.*
	FROM	RigheListePrelievo rldp INNER JOIN ElencoListePrelievo ldp 
		ON	ldp.CodLista=rldp.CodLista INNER JOIN AnagStatiListe asl
		ON	ldp.CodStatoLista = asl.CodStatoLista
	WHERE	asl.canQtaUDC = 0
	AND		rldp.UDC=@UDC
	
RETURN
go

commit;
go






-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(463, GETDATE())
GO
