--增加委外入库单 委外核销数量 委外核销基本数量 委外未核销数量 委外未核销基本数量
/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MPDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILLENTRY_R' AND KSQL_COL_NAME ='FOUTVERIFYQTY') 
 ALTER TABLE T_IM_MDC_OMINBILLENTRY_R ADD (FOUTVERIFYQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILLENTRY_R' AND KSQL_COL_NAME ='FOUTVERIFYBASEQTY') 
 ALTER TABLE T_IM_MDC_OMINBILLENTRY_R ADD (FOUTVERIFYBASEQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILLENTRY_R' AND KSQL_COL_NAME ='FOUTUNVERIFYQTY') 
 ALTER TABLE T_IM_MDC_OMINBILLENTRY_R ADD (FOUTUNVERIFYQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDC_OMINBILLENTRY_R' AND KSQL_COL_NAME ='FOUTUNVERIFYBASEQTY') 
 ALTER TABLE T_IM_MDC_OMINBILLENTRY_R ADD (FOUTUNVERIFYBASEQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

 --委外领料单
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY_R' AND KSQL_COL_NAME ='FOUTVERIFYQTY') 
 ALTER TABLE T_IM_MDCOM_MQBENTRY_R ADD (FOUTVERIFYQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY_R' AND KSQL_COL_NAME ='FOUTVERIFYBASEQTY') 
 ALTER TABLE T_IM_MDCOM_MQBENTRY_R ADD (FOUTVERIFYBASEQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY_R' AND KSQL_COL_NAME ='FOUTUNVERIFYQTY') 
 ALTER TABLE T_IM_MDCOM_MQBENTRY_R ADD (FOUTUNVERIFYQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MQBENTRY_R' AND KSQL_COL_NAME ='FOUTUNVERIFYBASEQTY') 
 ALTER TABLE T_IM_MDCOM_MQBENTRY_R ADD (FOUTUNVERIFYBASEQTY DECIMAL(23,10)  DEFAULT 0 NOT NULL );
 
 --委外领料单 补料单 增加供应商字段   fsupplier       NUMBER(19)
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IM_MDCOM_MREQOUTBILL' AND KSQL_COL_NAME ='fsupplier') 
 ALTER TABLE T_IM_MDCOM_MREQOUTBILL ADD (fsupplier bigint  DEFAULT 0 NOT NULL );
  
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MPDM_table.sql **/