We have Epicor set up for Program Managers to approve expense reports using what I believe is the standard approval process. We would like to be able to stop the PM from approving their own expense report and have it go to their supervisor for approval instead. Does anyone know how this might be accomplished? We have task and workgroup flows set up for multiple Time entry approvals, but it does not appear to allow you to stop the person from approving their own entries.
I am finally getting around to looking at this again. The trick with these approvals is that I don’t want to have their supervisor approve all expenses - just those against the project they are the manager for. I don’t want the supervisor to approve indirect expenses or those where another manager would be approving them.
I would imagine I need a BPM for this but I have no idea where to apply it.
I have tried to use a BPM for setting something in the EmpExpense table. I found when working in the Method Directive for SubmitSelected that there is a field called PendingApprovedBy that holds the name of the approver but it doesn’t change it into another person’s approval queue.
Is there anything out there that will let me change the workflow person via BPM? It looks like the BPMs for workflows are when you change the table data, not when they are invoked.
I finally got this working. I put in a Data Directive on the Task table with this custom code. It takes the EmpExpense record and changes the approver from the Project Manager to the employee’s supervisor.
var projectID = "";
var conProjMgr = "";
var conProjEng = "";
var empID = "";
var taskTs = new Erp.Tablesets.TaskTableset();
foreach(var t in ttTask.Where(o=>o.RowMod == "A" && o.RelatedToFile == "EmpExpense" && o.CompletionAction == "Aprv")) {
projectID = Db.EmpExpense.Where(l=>l.Company == Session.CompanyID && l.SysRowID == t.RelatedToSysRowID).FirstOrDefault().ProjectID;
empID = Db.EmpExpense.Where(l=>l.Company == Session.CompanyID && l.SysRowID == t.RelatedToSysRowID).FirstOrDefault().EmpID;
if(!String.IsNullOrEmpty(projectID)) {
conProjMgr = Db.Project.Where(o=>o.ProjectID == projectID).FirstOrDefault().ConProjMgr;
if(!String.IsNullOrEmpty(conProjMgr))
{
if (empID == conProjMgr)
{
//go get this person's supervisor instead of letting them sign their own expense report
conProjMgr = Db.EmpBasic.Where(o=>o.EmpID == empID).FirstOrDefault().SupervisorID;
}
t.SalesRepCode = conProjMgr;
}
}
}