dve.addAlias("EntityAccess", "partyEntityType", null, null, null, null, null);
dve.addAlias("EntityAccess", "entity", null, null, null, null, null);
dve.addAlias("TeamMember", "tmPartyId", "partyId", null, null, null, null);
EntityCondition condition = new EntityConditionList(UtilMisc.toList(
new EntityExpr("entity", EntityOperator.EQUALS, "Deal"),
new EntityExpr("partyEntityType", EntityOperator.EQUALS, "Team"),
new EntityExpr("tmPartyId", EntityOperator.EQUALS, partyId),
new EntityExpr("projectedCloseDate", EntityOperator.LESS_THAN_EQUAL_TO, endDate),
new EntityExpr("projectedCloseDate", EntityOperator.GREATER_THAN_EQUAL_TO, beginDate),
new EntityExpr("isInForecast", EntityOperator.EQUALS, "1")
),
EntityOperator.AND);
return EntityHelper.findByCondition( delegator, dve, condition, UtilMisc.toList("projectedCloseDate") );
}