public Boolean isEffective(CUSTOMCRMDORentalType rentalType, CRMDODate asOfDate){
String dbtype = getCRMSession().getDbtype();
String sql =
"\n SELECT RENTTYPEID FROM TRN_RENTALTYPES RT " +
"\n WHERE RT.RENTTYPEID = ?" +
"\n AND PV.PRODVALIDITYDELETED = 0 " +
"\n AND " + DateUtil.getSelectSQLDate(dbtype, "RT.RENTTYPEEFFECTIVEDATE") + " <= " + DateUtil.getSQLDate(dbtype, asOfDate) +
"\n AND " + DateUtil.getSelectSQLDate(dbtype, "RT.RENTTYPEEXPIRATIONDATE") + " > " + DateUtil.getSQLDate(dbtype, asOfDate) ;
ArrayList<Object> parameters = new ArrayList<Object>();
parameters.add(rentalType.getId());
if (SQLUtil.queryReturnedRows(sql, getOrganisationID(), parameters, dbType))
{
return new Boolean(true);
}
return new Boolean(false);
} |