ALTER TABLE SERVICO ADD IDCLIENTE  VARCHAR2(01)  DEFAULT 'N'
        CONSTRAINT CKC_IDCLIENTE   CHECK (IDCLIENTE  IN ('S','N'))
/
ALTER TABLE SERVICO ADD IDNOTIFICAREFE VARCHAR2(30)  DEFAULT 'NAO NOTIFICA' NOT NULL
        CONSTRAINT CKC_IDNOTIFICAREFE  CHECK (IDNOTIFICAREFE  IN ('NOTIFICA ACIMA LIMITE','NOTIFICA ABAIXO LIMITE', 'NOTIFICA TODAS', 'NAO NOTIFICA'))  
/

ALTER TABLE SERVICO ADD HRALTERACLI   VARCHAR2(4)
/

ALTER TABLE SERVICO ADD VRACRESCIMO   FLOAT
/

ALTER TABLE SERVICO ADD VRREDUCAO     FLOAT
/

ALTER TABLE SERVICO ADD NRDIASALT     FLOAT
/

ALTER TABLE SERVICO ADD DSEMAILNOTIF  VARCHAR2(200) 
/
ALTER TABLE SERVICO ADD IDFORMALTERA  VARCHAR2(01) DEFAULT 'C'
         CONSTRAINT CKC_IDFORMALTERA  CHECK (IDFORMALTERA  IN ('C','A'))
/

CREATE TABLE CONFIRMAREFE
(NRCONFIRMAREFE        NUMBER NOT NULL,
 CDFILIAL              VARCHAR2(04),
 CDSERVFILI            VARCHAR2(5),
 NRCARDAPIO            VARCHAR2(10),
 DTCARDAPIO            DATE,
 CDCLIENTE             VARCHAR2(21),
 CDDESTFILI            VARCHAR2(3),
 CDTURNO               VARCHAR2(1),
 QTCOMEORIGINAL        FLOAT,
 QTCOMEALTERADA        FLOAT,
 IDQTDEAPROVADA        VARCHAR2(30) DEFAULT 'PENDENTE' NOT NULL
                      CONSTRAINT CKC_IDQTDEAPROVADA CHECK (IDQTDEAPROVADA IN ('PENDENTE','APROVADA')),
 DSPARAMETROS          VARCHAR2(200),
 NRORG                 NUMBER,             
 IDATIVO               VARCHAR2(1)  DEFAULT 'S' NOT NULL
                      CONSTRAINT CKC_IDATIVO_CONFIRMAREFE CHECK (IDATIVO IN ('S','N')),
 DTINCLUSAO           DATE           NULL,
 DTULTATU             DATE           NULL,
 NRORGINCLUSAO        NUMBER         DEFAULT 1 NULL,
 CDOPERINCLUSAO       VARCHAR2(12)   DEFAULT '1' NULL,
 NRORGULTATU          NUMBER         DEFAULT 1 NULL,
 CDOPERULTATU         VARCHAR2(12)   DEFAULT '1',    
 CONSTRAINT PK_LOGPEDREF   PRIMARY KEY (NRCONFIRMAREFE)
)
/