-- 产品线字段sql脚本

-- 采购转固单、工程转固单添加字段产品线
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_PURCHASEBILLENTRY' AND KSQL_COL_NAME IN ('FPRODUCTLINEID'))
 ALTER TABLE T_FA_PURCHASEBILLENTRY ADD (FPRODUCTLINEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_ASSETINFOADDENTRY' AND KSQL_COL_NAME IN ('FPRODUCTLINEID'))
 ALTER TABLE T_FA_ASSETINFOADDENTRY ADD (FPRODUCTLINEID BIGINT DEFAULT 0 NOT NULL );

 --实物卡片添加产品线字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CARD_REAL' AND KSQL_COL_NAME IN ('FPRODUCTLINEID'))
 ALTER TABLE T_FA_CARD_REAL ADD (FPRODUCTLINEID BIGINT DEFAULT 0 NOT NULL );

-- 折旧汇总添加成本中心字段 T_FA_DEPREENTRY_D_SUM   FTOTALCOSTCENTERID
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREENTRY_D_SUM' AND KSQL_COL_NAME ='FTOTALPRODUCTLINEID')
ALTER TABLE T_FA_DEPREENTRY_D_SUM ADD (FTOTALPRODUCTLINEID BIGINT DEFAULT 0 NOT NULL );

-- 折旧明细添加成本中心字段 T_FA_DEPREDETAILENTRY   FCOSTCENTERID
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_DEPREDETAILENTRY' AND KSQL_COL_NAME ='FPRODUCTLINEID')
ALTER TABLE T_FA_DEPREDETAILENTRY ADD (FPRODUCTLINEID BIGINT DEFAULT 0 NOT NULL );




