DROP PROCEDURE OP_SALESPOINTSETTINGUpdProc
GO
CREATE PROCEDURE OP_SALESPOINTSETTINGUpdProc
(
    @SALESPOINT            UD_PTOVTA,
    @TERMINALNAME          varchar(25),
    @ENDDATEACT            UD_FECHA,
    @SERIALNUMBER          char(16),
    @STKTICKFAC            bit,
    @STKTICKBOL            bit,
    @CURYID                UD_CURYID,
    @STKLOADSALE           bit,
    @STKPRINTERFAC         bit,
    @STKPRINTEDBOL         bit,
    @TYPEDISPFAC           UD_TYPE_DISP_SALIDA,
    @DISPFAC               UD_DISP_SALIDA,
    @TYPEDISPBOL           UD_TYPE_DISP_SALIDA,
    @DISPBOL               UD_DISP_SALIDA,
    @TYPEDISPNC            UD_TYPE_DISP_SALIDA,
    @DISPNC                UD_DISP_SALIDA,
    @TYPEDISPND            UD_TYPE_DISP_SALIDA,
    @DISPND                UD_DISP_SALIDA,
    @TYPEDISORDER          UD_TYPE_DISP_SALIDA,
    @DISPORDER             UD_DISP_SALIDA,
    @TYPEDISPTICKFAC       UD_TYPE_DISP_SALIDA,
    @DISPTICKFAC           UD_DISP_SALIDA,
    @NBRTICKFAC            UD_CORRELATIVOS,
    @TYPEDISPTICKBOL       UD_TYPE_DISP_SALIDA,
    @DISPTICKBOL           UD_DISP_SALIDA,
    @NBRTICKBOL            UD_CORRELATIVOS,
    @DISPDISPLAY           UD_DISP_SALIDA,
    @STKJUMPAUTOMAT        bit,
    @QTYJUMPAUTOMAT        tinyint,
    @STKHOTKEYS            bit,
    @STKDELETEDOC          bit,
    @BUSINESSTYPE          char(1),
    @SITEID                UD_IDSITE,
    @STKTOFORCEZ	   BIT,
    @PRINTERTYPEID	   CHAR(2)
)
AS
BEGIN
    BEGIN TRAN

    UPDATE OP_SALESPOINTSETTING
       SET TERMINALNAME           = @TERMINALNAME,
           ENDDATEACT             = @ENDDATEACT,
           SERIALNUMBER           = @SERIALNUMBER,
           STKTICKFAC             = @STKTICKFAC,
           STKTICKBOL             = @STKTICKBOL,
           CURYID                 = @CURYID,
           STKLOADSALE            = @STKLOADSALE,
           STKPRINTERFAC          = @STKPRINTERFAC,
           STKPRINTEDBOL          = @STKPRINTEDBOL,
           TYPEDISPFAC            = @TYPEDISPFAC,
           DISPFAC                = @DISPFAC,
           TYPEDISPBOL            = @TYPEDISPBOL,
           DISPBOL                = @DISPBOL,
           TYPEDISPNC             = @TYPEDISPNC,
           DISPNC                 = @DISPNC,
           TYPEDISPND             = @TYPEDISPND,
           DISPND                 = @DISPND,
           TYPEDISORDER           = @TYPEDISORDER,
           DISPORDER              = @DISPORDER,
           TYPEDISPTICKFAC        = @TYPEDISPTICKFAC,
           DISPTICKFAC            = @DISPTICKFAC,
           NBRTICKFAC             = @NBRTICKFAC,
           TYPEDISPTICKBOL        = @TYPEDISPTICKBOL,
           DISPTICKBOL            = @DISPTICKBOL,
           NBRTICKBOL             = @NBRTICKBOL,
           DISPDISPLAY            = @DISPDISPLAY,
           STKJUMPAUTOMAT         = @STKJUMPAUTOMAT,
           QTYJUMPAUTOMAT         = @QTYJUMPAUTOMAT,
           STKHOTKEYS             = @STKHOTKEYS,
           STKDELETEDOC           = @STKDELETEDOC,
           BUSINESSTYPE           = @BUSINESSTYPE,
           SITEID                 = @SITEID,
	   STKTOFORCEZ		  = @STKTOFORCEZ,
	   PRINTERTYPEID	  = @PRINTERTYPEID

     WHERE SALESPOINT = @SALESPOINT

    IF (@@error!=0)
    BEGIN
        RAISERROR  20001 'Error actualizando en OP_SALESPOINTSETTING '
        ROLLBACK TRAN
        RETURN(1)
    
    END

    COMMIT TRAN

    RETURN(0)
END