diff --git a/process/Org_lib/process.js b/process/Org_lib/process.js index 4f8ac77408e18f137630d818d98819cbadced639..169a00701e653e5f7c6820eb211ab5c3482f3a66 100644 --- a/process/Org_lib/process.js +++ b/process/Org_lib/process.js @@ -85,7 +85,7 @@ OrgUtils.openOrgReport = function(pOrgId) + " from PERS join RELATION on PERSID = PERS_ID"; persSql = SqlCondition.begin() .andPrepare("RELATION.ORG_ID", pOrgId) - .and("RELATION.STATUS = 1") + .and("RELATION.STATUS = 'BSIC0rel-stat-actv-ae03-b6b04430e90b'") //TODO: replace this with something that isn't a hard coded id .buildSql(persSql, "", " order by PERS.LASTNAME asc"); var persData = db.table(persSql); @@ -121,7 +121,7 @@ OrgUtils.openOrgReport = function(pOrgId) var histSql = "select ENTRYDATE, CATEGORY, FIRSTNAME, LASTNAME, INFO from ACTIVITY " + " join ACTIVITYLINK on ACTIVITYLINK.ACTIVITY_ID = ACTIVITYID " - + " join RELATION on ACTIVITYLINK.ROW_ID = RELATIONID" + + " join RELATION on ACTIVITYLINK.OBJECT_ROWID = RELATIONID" + " left join PERS on RELATION.PERS_ID = PERSID"; histSql = SqlCondition.begin() .andPrepare("RELATION.ORG_ID", pOrgId) //= all activities linked to the organization or an employee