private static boolean isInvoiceTypeRecurse(GenericValue invoiceType,String inputTypeId) throws GenericEntityException {
  String invoiceTypeId=invoiceType.getString("invoiceTypeId");
  String parentTypeId=invoiceType.getString("parentTypeId");
  if (parentTypeId == null || invoiceTypeId.equals(parentTypeId)) {
    return false;
  }
  if (parentTypeId.equals(inputTypeId)) {
    return true;
  }
  return isInvoiceTypeRecurse(invoiceType.getRelatedOne("ParentInvoiceType",false),inputTypeId);
}

private static boolean isInvoiceTypeRecurse ( GenericValue invoiceType , String inputTypeId ) throws GenericEntityException { String invoiceTypeId = invoiceType . getString ( "invoiceTypeId" ) ; String parentTypeId = invoiceType . getString ( "parentTypeId" ) ; if ( parentTypeId == null || invoiceTypeId . equals ( parentTypeId ) ) { return false ; } if ( parentTypeId . equals ( inputTypeId ) ) { return true ; } return isInvoiceTypeRecurse ( invoiceType . getRelatedOne ( "ParentInvoiceType" , false ) , inputTypeId ) ; }
recurses up invoice type tree via parenttypeid to see if input invoice type id is in tree .
