public static boolean isEarlierTransaction(MCostDetail cd,int C_AcctSchema_ID,int M_CostType_ID,int M_CostElement_ID,String costingLevel){
  MTransaction trx=new MTransaction(cd.getCtx(),cd.getM_Transaction_ID(),cd.get_TrxName());
  MCostDetail last_cd=getLastTransaction(trx,C_AcctSchema_ID,M_CostType_ID,M_CostElement_ID,costingLevel);
  if (last_cd == null)   return false;
  if (cd.getSeqNo() <= last_cd.getSeqNo() && cd.getM_Transaction_ID() != last_cd.getM_Transaction_ID()) {
    return true;
  }
  return false;
}

public static boolean isEarlierTransaction ( MCostDetail cd , int C_AcctSchema_ID , int M_CostType_ID , int M_CostElement_ID , String costingLevel ) { MTransaction trx = new MTransaction ( cd . getCtx ( ) , cd . getM_Transaction_ID ( ) , cd . get_TrxName ( ) ) ; MCostDetail last_cd = getLastTransaction ( trx , C_AcctSchema_ID , M_CostType_ID , M_CostElement_ID , costingLevel ) ; if ( last_cd == null ) return false ; if ( cd . getSeqNo ( ) <= last_cd . getSeqNo ( ) && cd . getM_Transaction_ID ( ) != last_cd . getM_Transaction_ID ( ) ) { return true ; } return false ; }
detect if cost detail delayed entry
