/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_AR_PAYPROPERTYEXC', 'T_AR_PAYPROPERTYEXC', 'FDATAID,FUSEORGID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_PPEXC_CREATEORG') CREATE INDEX IDX_AR_PPEXC_CREATEORG ON T_AR_PAYPROPERTYEXC ( FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_AR_PAYPROPERTYUSEREG', 'T_AR_PAYPROPERTYUSEREG', 'FUSEORGID,FDATAID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_PPUSEREG_ADMIN') CREATE INDEX IDX_AR_PPUSEREG_ADMIN ON T_AR_PAYPROPERTYUSEREG ( FADMINORGID );


 EXEC P_ALTERPK 'PK_T_AR_BUSBILL', 'T_AR_BUSBILL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUS_ORGDATE') CREATE INDEX IDX_AR_BUS_ORGDATE ON T_AR_BUSBILL ( FORGID ,FBIZDATE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUS_FBILLNO') CREATE INDEX IDX_AR_BUS_FBILLNO ON T_AR_BUSBILL ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_AR_BUSBILLENTRY', 'T_AR_BUSBILLENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUSE_PID') CREATE INDEX IDX_AR_BUSE_PID ON T_AR_BUSBILLENTRY ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUSE_MATERIAL') CREATE INDEX IDX_AR_BUSE_MATERIAL ON T_AR_BUSBILLENTRY ( FMATERIALID );


 EXEC P_ALTERPK 'PK_T_AR_BUSPLANENTRY', 'T_AR_BUSPLANENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUSPLAN_FID') CREATE INDEX IDX_AR_BUSPLAN_FID ON T_AR_BUSPLANENTRY ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUSPLAN_DUEDATE') CREATE INDEX IDX_AR_BUSPLAN_DUEDATE ON T_AR_BUSPLANENTRY ( FPLANDUEDATE );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_constraint.sql **/
