DROP PROCEDURE TMP_OP_PRCLVLCUSTDETUpdProc
GO
CREATE PROCEDURE TMP_OP_PRCLVLCUSTDETUpdProc
(
    @CORRNBR	    INT,
    @SITEID	    UD_IDSITE,
    @DISCMTO        UD_MONTO,
    @SLS_PRICE      UD_PRECIO,
    @SLS_PRICECUST  UD_PRECIO,
    @INVTIDSKU      UD_IDCORPORATIVO
)
AS
BEGIN
    BEGIN TRAN

    	UPDATE 	TMP_OP_PRCLVLCUSTDET
       	SET 	
		DISCMTO=@DISCMTO,
		SLS_PRICE=@SLS_PRICE,
		SLS_PRICECUST=@SLS_PRICECUST
     	WHERE 	INVTIDSKU = @INVTIDSKU AND CORRNBR=@CORRNBR AND SITEID=@SITEID

    IF (@@error!=0)
    BEGIN
        ROLLBACK TRAN
        RETURN(1)
    
    END

    COMMIT TRAN

    RETURN(0)
END
