/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNISSUEDAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNISSUEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNINVOICEAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNINVOICEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNTOTALAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNISSUEDTOTALAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNISSUEDTOTALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNISSUEDTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNISSUEDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFOREIGNTAXDIFFERENCE') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFOREIGNTAXDIFFERENCE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FFROMCURR') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FFROMCURR BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FTOCURR') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FTOCURR BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FEXRATETABLE') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FEXRATETABLE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FEXRATE') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FEXRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL' AND KSQL_COL_NAME ='FQUOTATION') 
 ALTER TABLE T_SIM_ORIGINAL_BILL ADD (FQUOTATION VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMTAXPRICE') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMTAXPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMPRICE') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMTAXAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FCOMBINELOCALAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FCOMBINELOCALAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMISSUEDAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMISSUEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMISSUEDTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMISSUEDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMDISCOUNTAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMDISCOUNTAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMTAXDEVIATION') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMTAXDEVIATION DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMISSUEDTAXAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMISSUEDTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_ITEM' AND KSQL_COL_NAME ='FFROMAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_ITEM ADD (FFROMAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );

/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_table.sql **/
