/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\AR_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_AR_LIQUIDATION', 'T_AR_LIQUIDATION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_LIQ_ORG') CREATE INDEX IDX_AR_LIQ_ORG ON T_AR_LIQUIDATION ( FORGID );


 EXEC P_ALTERPK 'PK_T_AR_LIQUIDATIONENTRY', 'T_AR_LIQUIDATIONENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_AR_BUSBILLTAXENTRY', 'T_AR_BUSBILLTAXENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUSTAXE_PID') CREATE INDEX IDX_AR_BUSTAXE_PID ON T_AR_BUSBILLTAXENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_AR_FINARBILLTAXENTRY', 'T_AR_FINARBILLTAXENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_FINTAXE_PID') CREATE INDEX IDX_AR_FINTAXE_PID ON T_AR_FINARBILLTAXENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_AR_FINARBILLENTRY_E', 'T_AR_FINARBILLENTRY_E', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_FIN_VATTAX') CREATE INDEX IDX_AR_FIN_VATTAX ON T_AR_FINARBILLENTRY_E ( FVATTAX );


 EXEC P_ALTERPK 'PK_T_AR_BUSBILLENTRY_E', 'T_AR_BUSBILLENTRY_E', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_AR_BUS_VATTAX') CREATE INDEX IDX_AR_BUS_VATTAX ON T_AR_BUSBILLENTRY_E ( FVATTAX );



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