/**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_CONFIRM_DETAIL_TC' AND KSQL_COL_NAME ='FISSUEDAMOUNT') 
 ALTER TABLE T_SIM_CONFIRM_DETAIL_TC ADD (FISSUEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_CONFIRM_DETAIL_TC' AND KSQL_COL_NAME ='FISSUEDTAX') 
 ALTER TABLE T_SIM_CONFIRM_DETAIL_TC ADD (FISSUEDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_E' AND KSQL_COL_NAME ='FMAINISSUEDAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_E ADD (FMAINISSUEDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_E' AND KSQL_COL_NAME ='FMAINISSUEDTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_E ADD (FMAINISSUEDTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_E' AND KSQL_COL_NAME ='FSURPLUSAMOUNT') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_E ADD (FSURPLUSAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_E' AND KSQL_COL_NAME ='FSURPLUSTAX') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_E ADD (FSURPLUSTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SIM_ORIGINAL_BILL_E' AND KSQL_COL_NAME ='FMAINTAXDEVIATION') 
 ALTER TABLE T_SIM_ORIGINAL_BILL_E ADD (FMAINTAXDEVIATION DECIMAL(23,10) DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_SIM_COUNT_CHECK_ITEMS', 'FORIGTOTALAMOUNT', 'DECIMAL(23,10)', 'NOT NULL', '1111', '0';

 EXEC p_AlterColumn 'T_SIM_COUNT_CHECK_ITEMS', 'FORIGINVOICEAMOUNT', 'DECIMAL(23,10)', 'NOT NULL', '1111', '0';

 EXEC p_AlterColumn 'T_SIM_COUNT_CHECK_ITEMS', 'FORIGTOTALTAX', 'DECIMAL(23,10)', 'NOT NULL', '1111', '0';


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