/*对公报销单 增加资产组织、资产类型、成本中心、需安装字段*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMBILL' AND KSQL_COL_NAME ='FASSETORGID') 
 ALTER TABLE T_ER_PUBREIMBILL ADD (FASSETORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMBILL' AND KSQL_COL_NAME ='FASSETTYPE') 
 ALTER TABLE T_ER_PUBREIMBILL ADD (FASSETTYPE VARCHAR(20) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMBILL' AND KSQL_COL_NAME ='FSTDCOSTCENTERID') 
 ALTER TABLE T_ER_PUBREIMBILL ADD (FSTDCOSTCENTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMBILL' AND KSQL_COL_NAME ='FISNEEDINSTALL') 
 ALTER TABLE T_ER_PUBREIMBILL ADD (FISNEEDINSTALL CHAR(1) DEFAULT '0' NOT NULL );

 /*对公报销单-费用明细（资产明细） 增加资产编号、资产名称、实物卡片、资产类别、规格型号、存放地点、标的物、计量单位、数量、含税单价、成本中心、产品类别字段*/
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETNUMBER') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETNAME') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETNAME VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETBILLNO') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETBILLNO BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETCAT') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETCAT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETMODEL') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETMODEL VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETSTOREPLACE') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETSTOREPLACE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FSUBJECTMATTER') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FSUBJECTMATTER VARCHAR(150) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETUNIT') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETUNIT BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FASSETQUANTITY') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FASSETQUANTITY DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FPRICEWITHTAX') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FPRICEWITHTAX DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FSTDENTRYCOSTCENTERID') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FSTDENTRYCOSTCENTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMEXPDET' AND KSQL_COL_NAME ='FENTRYPRODUCTTYPE') 
 ALTER TABLE T_ER_PUBREIMEXPDET ADD (FENTRYPRODUCTTYPE BIGINT DEFAULT 0 NOT NULL );