
DROP PROCEDURE OP_SETUPUpdProc
GO
CREATE PROCEDURE OP_SETUPUpdProc
(	@AUTOMATICSALES	BIT,
	@CATEGORYFUEL	UD_CATEGORY,
	@BADGE		BIT,
	@MTOMAXSALES	UD_MONTO,
	@CCLASSIDCASH	UD_CUSTCLASSID,
	@CCLASSIDANTICIPATE	UD_CUSTCLASSID,
	@CCLASSIDCREDLOCAL	UD_CUSTCLASSID,
	@CCLASSIDCREDCORPORATE	UD_CUSTCLASSID,
	@CCLASSIDOTHER	UD_CUSTCLASSID,
	@DOCTYPEIDTICKET	UD_DOCTYPEID,
	@DOCTYPEIDFAC	UD_DOCTYPEID,
	@DOCTYPEIDBOL	UD_DOCTYPEID,
	@DOCTYPEIDNC	UD_DOCTYPEID,
	@DOCTYPEIDND	UD_DOCTYPEID,
	@STKCORRELATIVE	BIT,
	@REPORTPATH	UD_REPORTES,
	@STKODBCSTRING	INTEGER,
	@STRINGCONECC	VARCHAR(400),
	@UNITMEDFUEL	UD_STKUNITID

)

AS
BEGIN
	BEGIN TRAN

	UPDATE 	OP_SETUP
	SET	AUTOMATICSALES=@AUTOMATICSALES,
		CATEGORYFUEL=@CATEGORYFUEL,
		BADGE=@BADGE,
		MTOMAXSALES=@MTOMAXSALES,
		CCLASSIDCASH=@CCLASSIDCASH,
		CCLASSIDANTICIPATE=@CCLASSIDANTICIPATE,
		CCLASSIDCREDLOCAL=@CCLASSIDCREDLOCAL,
		CCLASSIDCREDCORPORATE=@CCLASSIDCREDCORPORATE,
		CCLASSIDOTHER=@CCLASSIDOTHER,
		DOCTYPEIDTICKET=@DOCTYPEIDTICKET,
		DOCTYPEIDFAC=@DOCTYPEIDFAC,
		DOCTYPEIDBOL=@DOCTYPEIDBOL,
		DOCTYPEIDNC=@DOCTYPEIDNC,
		DOCTYPEIDND=@DOCTYPEIDND,
		STKCORRELATIVE=@STKCORRELATIVE,
		REPORTPATH=@REPORTPATH,
		STKODBCSTRING=@STKODBCSTRING,
		STRINGCONECC=@STRINGCONECC,
		UNITMEDFUEL=@UNITMEDFUEL

	

    IF (@@error!=0 OR @@ROWCOUNT=0)
    BEGIN
        RAISERROR  20000 'Error Actualizando en OP_SETUP'
        ROLLBACK TRAN
        RETURN(1)
    
    END

	COMMIT TRAN
	RETURN(0)
END 

