--UPDATE FROM 8.10.0.20 TO 8.10.0.30


DROP TABLE VERSION_8_10_0_20;


/*  VERSION_8_10_0_30  */
CREATE TABLE VERSION_8_10_0_30 (
	 DUMMY	NUMBER	    NULL
)
;


ALTER TABLE YRCH MODIFY YRCH_DISPLORDER NUMBER(4);

ALTER TABLE YRCH MODIFY YRCH_SELECTORDER NUMBER(4);
 
ALTER TABLE ZFCF ADD ZFCF_SIGNATURE VARCHAR2(400 CHAR);
  
ALTER TABLE ZFCF ADD ZFCF_RUNNING_TOTAL NUMBER(30,4);
  
ALTER TABLE ZFCF ADD ZFCF_WPCA_ID NUMBER (30,0);
 
COMMENT ON COLUMN ZFCF.ZFCF_SIGNATURE IS 'Fiscal NUMBER / Signature from FiscalPrinter';

COMMENT ON COLUMN ZFCF.ZFCF_RUNNING_TOTAL IS 'Running total provided by FiscalPrinter';

COMMENT ON COLUMN ZFCF.ZFCF_WPCA_ID IS 'link to wpca (workstation id)';
 
ALTER TABLE ZFCF ADD ZFCF_RECEIPT_NUMBER VARCHAR2(30 CHAR);

ALTER TABLE WPCA ADD WPCA_FISCAL_PRINTER_URL VARCHAR2(60 CHAR);

COMMENT ON COLUMN ZFCF.ZFCF_RECEIPT_NUMBER IS 'Receipt NUMBER received from FiscalPrinter';

COMMENT ON COLUMN WPCA.WPCA_FISCAL_PRINTER_URL IS 'URL of fiscal layer';

ALTER TABLE ZFCF ADD ZFCF_DEP CLOB;

COMMENT ON COLUMN ZFCF.ZFCF_DEP IS 'Contains the DEP received from FiscalPrinter in json format';

ALTER TABLE ZFCF ADD ZFCF_CASH_REGISTER_ID VARCHAR2(16 CHAR);

COMMENT ON COLUMN ZFCF.ZFCF_CASH_REGISTER_ID IS 'Contains the cash register id of the terminal send the invoice'; 

CREATE TABLE WCPL (
    WCPL_ID NUMBER(30) not null
   ,WCPL_WLOG_ID NUMBER(30) not null
   ,WCPL_TABLENAME VARCHAR2(30) not null 
   ,WCPL_TABLE_ID NUMBER(30) not null
   ,WCPL_FROMPRICE NUMBER(30, 4)
   ,WCPL_TOPRICE NUMBER(30, 4)
   ,WCPL_TEXT VARCHAR2(400)
   ,CONSTRAINT WCPL_PK PRIMARY KEY (WCPL_id) USING INDEX TABLESPACE V8INDEX) TABLESPACE V8MAIN;

CREATE SEQUENCE SEQ_WCPL INCREMENT BY 1 START WITH 1000 NOMAXVALUE NOCYCLE NOCACHE NOORDER;

COMMENT ON TABLE WCPL is 'Price Change Log';

COMMENT ON COLUMN WCPL.WCPL_ID is 'ID';

COMMENT ON COLUMN WCPL.WCPL_WLOG_ID is 'wlog id';

COMMENT ON COLUMN WCPL.WCPL_TABLENAME is 'Table Name';

COMMENT ON COLUMN WCPL.WCPL_TABLE_ID is 'Table id';

COMMENT ON COLUMN WCPL.WCPL_FROMPRICE is ' from price';

COMMENT ON COLUMN WCPL.WCPL_TOPRICE is 'to price';

COMMENT ON COLUMN WCPL.WCPL_TEXT is 'Log text';

ALTER TABLE YCGV ADD YCGV_PERCENTAGE NUMBER(1);

ALTER TABLE YRGV ADD YRGV_PERCENTAGE NUMBER(1);