}
if (sTxpr.length()>0) {
Dms oDms = getSession().getDms();
TaxPayer oTxp = new TaxPayer(oDms, sTxpr);
Employees oEms = oTxp.employees(getSession());
Employee oEmp = new Employee();
Document e = oEmp.exists(getSession(), "employee_uuid", oUsr.getNickName());
if (e!=null) {
Log.out.debug("Employee already exists");
oEmp.load(getSession(), e.id());
if (!oEmp.parentId().equals(oEms.id()))
oEmp.getDocument().parents().replace(oDms.getDocument(oEmp.parentId()), oDms.getDocument(oEms.id()));
} else {
Log.out.debug("Employee does not exist");
oEmp = new Employee(getSession(), oEms);
oEmp.setUuid(oUsr.getNickName());
}
oEmp.setName(oUsr.getFirstName()+" "+oUsr.getLastName());
oEmp.setEmployeeId(getParam("employee.employeeId"));
oEmp.setTaxId(getParam("employee.taxId"));
oEmp.setActive(bActive);
oEmp.save(getSession());
}
oUsr.allowAll(getSession());
if (sSelected.length()>0) {
String[] aSelected = sSelected.split("###");
if (sPerms.equals("allow"))