/**Begin C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICEDETAIL' AND KSQL_COL_NAME IN ('FINVOICETYPEID')) 
 ALTER TABLE T_PUR_INVOICEDETAIL ADD (FINVOICETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICEDETAIL' AND KSQL_COL_NAME IN ('FCURRENCYID')) 
 ALTER TABLE T_PUR_INVOICEDETAIL ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICEDETAIL' AND KSQL_COL_NAME IN ('FINVCOMPANY')) 
 ALTER TABLE T_PUR_INVOICEDETAIL ADD (FINVCOMPANY NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICEDETAIL' AND KSQL_COL_NAME IN ('FRECCOMPANY')) 
 ALTER TABLE T_PUR_INVOICEDETAIL ADD (FRECCOMPANY NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_INVOICENTRY2_A' AND KSQL_COL_NAME IN ('FCHECKBILLNO')) 
 ALTER TABLE T_PUR_INVOICENTRY2_A ADD (FCHECKBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL );

/**End C:\PDM_UPGRADE\PDM1\PUR_table.sql **/
