/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
-- 采购入库单、销售出库单、委外采购入库单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FINWAREHOUSE') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FINWAREHOUSE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_SALOUTBILLENTRY' AND KSQL_COL_NAME ='FINLOCATION') 
 ALTER TABLE T_IM_SALOUTBILLENTRY ADD (FINLOCATION BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FOUTLOCATION') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FOUTLOCATION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_PURINBILLENTRY' AND KSQL_COL_NAME ='FOUTWAREHOUSE') 
 ALTER TABLE T_IM_PURINBILLENTRY ADD (FOUTWAREHOUSE BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSPURINBILLENTRY' AND KSQL_COL_NAME ='FOUTLOCATION') 
 ALTER TABLE T_IM_OSPURINBILLENTRY ADD (FOUTLOCATION BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_OSPURINBILLENTRY' AND KSQL_COL_NAME ='FOUTWAREHOUSE') 
 ALTER TABLE T_IM_OSPURINBILLENTRY ADD (FOUTWAREHOUSE BIGINT DEFAULT 0 NOT NULL );
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_table.sql **/
